use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstRTSPAddressPoolResult")]
pub enum RTSPAddressPoolResult {
#[doc(alias = "GST_RTSP_ADDRESS_POOL_OK")]
Ok,
#[doc(alias = "GST_RTSP_ADDRESS_POOL_EINVAL")]
Einval,
#[doc(alias = "GST_RTSP_ADDRESS_POOL_ERESERVED")]
Ereserved,
#[doc(alias = "GST_RTSP_ADDRESS_POOL_ERANGE")]
Erange,
#[doc(alias = "GST_RTSP_ADDRESS_POOL_ELAST")]
Elast,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for RTSPAddressPoolResult {
type GlibType = ffi::GstRTSPAddressPoolResult;
fn into_glib(self) -> ffi::GstRTSPAddressPoolResult {
match self {
Self::Ok => ffi::GST_RTSP_ADDRESS_POOL_OK,
Self::Einval => ffi::GST_RTSP_ADDRESS_POOL_EINVAL,
Self::Ereserved => ffi::GST_RTSP_ADDRESS_POOL_ERESERVED,
Self::Erange => ffi::GST_RTSP_ADDRESS_POOL_ERANGE,
Self::Elast => ffi::GST_RTSP_ADDRESS_POOL_ELAST,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstRTSPAddressPoolResult> for RTSPAddressPoolResult {
unsafe fn from_glib(value: ffi::GstRTSPAddressPoolResult) -> Self {
skip_assert_initialized!();
match value {
0 => Self::Ok,
-1 => Self::Einval,
-2 => Self::Ereserved,
-3 => Self::Erange,
-4 => Self::Elast,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstRTSPFilterResult")]
pub enum RTSPFilterResult {
#[doc(alias = "GST_RTSP_FILTER_REMOVE")]
Remove,
#[doc(alias = "GST_RTSP_FILTER_KEEP")]
Keep,
#[doc(alias = "GST_RTSP_FILTER_REF")]
Ref,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for RTSPFilterResult {
type GlibType = ffi::GstRTSPFilterResult;
fn into_glib(self) -> ffi::GstRTSPFilterResult {
match self {
Self::Remove => ffi::GST_RTSP_FILTER_REMOVE,
Self::Keep => ffi::GST_RTSP_FILTER_KEEP,
Self::Ref => ffi::GST_RTSP_FILTER_REF,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstRTSPFilterResult> for RTSPFilterResult {
unsafe fn from_glib(value: ffi::GstRTSPFilterResult) -> Self {
skip_assert_initialized!();
match value {
0 => Self::Remove,
1 => Self::Keep,
2 => Self::Ref,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstRTSPMediaStatus")]
pub enum RTSPMediaStatus {
#[doc(alias = "GST_RTSP_MEDIA_STATUS_UNPREPARED")]
Unprepared,
#[doc(alias = "GST_RTSP_MEDIA_STATUS_UNPREPARING")]
Unpreparing,
#[doc(alias = "GST_RTSP_MEDIA_STATUS_PREPARING")]
Preparing,
#[doc(alias = "GST_RTSP_MEDIA_STATUS_PREPARED")]
Prepared,
#[doc(alias = "GST_RTSP_MEDIA_STATUS_SUSPENDED")]
Suspended,
#[doc(alias = "GST_RTSP_MEDIA_STATUS_ERROR")]
Error,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for RTSPMediaStatus {
type GlibType = ffi::GstRTSPMediaStatus;
fn into_glib(self) -> ffi::GstRTSPMediaStatus {
match self {
Self::Unprepared => ffi::GST_RTSP_MEDIA_STATUS_UNPREPARED,
Self::Unpreparing => ffi::GST_RTSP_MEDIA_STATUS_UNPREPARING,
Self::Preparing => ffi::GST_RTSP_MEDIA_STATUS_PREPARING,
Self::Prepared => ffi::GST_RTSP_MEDIA_STATUS_PREPARED,
Self::Suspended => ffi::GST_RTSP_MEDIA_STATUS_SUSPENDED,
Self::Error => ffi::GST_RTSP_MEDIA_STATUS_ERROR,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstRTSPMediaStatus> for RTSPMediaStatus {
unsafe fn from_glib(value: ffi::GstRTSPMediaStatus) -> Self {
skip_assert_initialized!();
match value {
0 => Self::Unprepared,
1 => Self::Unpreparing,
2 => Self::Preparing,
3 => Self::Prepared,
4 => Self::Suspended,
5 => Self::Error,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstRTSPPublishClockMode")]
pub enum RTSPPublishClockMode {
#[doc(alias = "GST_RTSP_PUBLISH_CLOCK_MODE_NONE")]
None,
#[doc(alias = "GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK")]
Clock,
#[doc(alias = "GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET")]
ClockAndOffset,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for RTSPPublishClockMode {
type GlibType = ffi::GstRTSPPublishClockMode;
fn into_glib(self) -> ffi::GstRTSPPublishClockMode {
match self {
Self::None => ffi::GST_RTSP_PUBLISH_CLOCK_MODE_NONE,
Self::Clock => ffi::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK,
Self::ClockAndOffset => ffi::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstRTSPPublishClockMode> for RTSPPublishClockMode {
unsafe fn from_glib(value: ffi::GstRTSPPublishClockMode) -> Self {
skip_assert_initialized!();
match value {
0 => Self::None,
1 => Self::Clock,
2 => Self::ClockAndOffset,
value => Self::__Unknown(value),
}
}
}
impl StaticType for RTSPPublishClockMode {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_rtsp_publish_clock_mode_get_type()) }
}
}
impl glib::value::ValueType for RTSPPublishClockMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for RTSPPublishClockMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for RTSPPublishClockMode {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstRTSPSuspendMode")]
pub enum RTSPSuspendMode {
#[doc(alias = "GST_RTSP_SUSPEND_MODE_NONE")]
None,
#[doc(alias = "GST_RTSP_SUSPEND_MODE_PAUSE")]
Pause,
#[doc(alias = "GST_RTSP_SUSPEND_MODE_RESET")]
Reset,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for RTSPSuspendMode {
type GlibType = ffi::GstRTSPSuspendMode;
fn into_glib(self) -> ffi::GstRTSPSuspendMode {
match self {
Self::None => ffi::GST_RTSP_SUSPEND_MODE_NONE,
Self::Pause => ffi::GST_RTSP_SUSPEND_MODE_PAUSE,
Self::Reset => ffi::GST_RTSP_SUSPEND_MODE_RESET,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstRTSPSuspendMode> for RTSPSuspendMode {
unsafe fn from_glib(value: ffi::GstRTSPSuspendMode) -> Self {
skip_assert_initialized!();
match value {
0 => Self::None,
1 => Self::Pause,
2 => Self::Reset,
value => Self::__Unknown(value),
}
}
}
impl StaticType for RTSPSuspendMode {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_rtsp_suspend_mode_get_type()) }
}
}
impl glib::value::ValueType for RTSPSuspendMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for RTSPSuspendMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for RTSPSuspendMode {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstRTSPThreadType")]
pub enum RTSPThreadType {
#[doc(alias = "GST_RTSP_THREAD_TYPE_CLIENT")]
Client,
#[doc(alias = "GST_RTSP_THREAD_TYPE_MEDIA")]
Media,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for RTSPThreadType {
type GlibType = ffi::GstRTSPThreadType;
fn into_glib(self) -> ffi::GstRTSPThreadType {
match self {
Self::Client => ffi::GST_RTSP_THREAD_TYPE_CLIENT,
Self::Media => ffi::GST_RTSP_THREAD_TYPE_MEDIA,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstRTSPThreadType> for RTSPThreadType {
unsafe fn from_glib(value: ffi::GstRTSPThreadType) -> Self {
skip_assert_initialized!();
match value {
0 => Self::Client,
1 => Self::Media,
value => Self::__Unknown(value),
}
}
}