use crate::ffi;
use glib::{prelude::*, translate::*};
#[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;
#[inline]
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 {
#[inline]
unsafe fn from_glib(value: ffi::GstRTSPAddressPoolResult) -> Self {
skip_assert_initialized!();
match value {
ffi::GST_RTSP_ADDRESS_POOL_OK => Self::Ok,
ffi::GST_RTSP_ADDRESS_POOL_EINVAL => Self::Einval,
ffi::GST_RTSP_ADDRESS_POOL_ERESERVED => Self::Ereserved,
ffi::GST_RTSP_ADDRESS_POOL_ERANGE => Self::Erange,
ffi::GST_RTSP_ADDRESS_POOL_ELAST => 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;
#[inline]
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 {
#[inline]
unsafe fn from_glib(value: ffi::GstRTSPFilterResult) -> Self {
skip_assert_initialized!();
match value {
ffi::GST_RTSP_FILTER_REMOVE => Self::Remove,
ffi::GST_RTSP_FILTER_KEEP => Self::Keep,
ffi::GST_RTSP_FILTER_REF => 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;
#[inline]
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 {
#[inline]
unsafe fn from_glib(value: ffi::GstRTSPMediaStatus) -> Self {
skip_assert_initialized!();
match value {
ffi::GST_RTSP_MEDIA_STATUS_UNPREPARED => Self::Unprepared,
ffi::GST_RTSP_MEDIA_STATUS_UNPREPARING => Self::Unpreparing,
ffi::GST_RTSP_MEDIA_STATUS_PREPARING => Self::Preparing,
ffi::GST_RTSP_MEDIA_STATUS_PREPARED => Self::Prepared,
ffi::GST_RTSP_MEDIA_STATUS_SUSPENDED => Self::Suspended,
ffi::GST_RTSP_MEDIA_STATUS_ERROR => 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;
#[inline]
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 {
#[inline]
unsafe fn from_glib(value: ffi::GstRTSPPublishClockMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GST_RTSP_PUBLISH_CLOCK_MODE_NONE => Self::None,
ffi::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK => Self::Clock,
ffi::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET => Self::ClockAndOffset,
value => Self::__Unknown(value),
}
}
}
impl StaticType for RTSPPublishClockMode {
#[inline]
#[doc(alias = "gst_rtsp_publish_clock_mode_get_type")]
fn static_type() -> glib::Type {
unsafe { from_glib(ffi::gst_rtsp_publish_clock_mode_get_type()) }
}
}
impl glib::HasParamSpec for RTSPPublishClockMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
Self::ParamSpec::builder_with_default
}
}
impl glib::value::ValueType for RTSPPublishClockMode {
type Type = Self;
}
unsafe impl<'a> glib::value::FromValue<'a> for RTSPPublishClockMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
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 {
#[inline]
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
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<RTSPPublishClockMode> for glib::Value {
#[inline]
fn from(v: RTSPPublishClockMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[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;
#[inline]
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 {
#[inline]
unsafe fn from_glib(value: ffi::GstRTSPSuspendMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GST_RTSP_SUSPEND_MODE_NONE => Self::None,
ffi::GST_RTSP_SUSPEND_MODE_PAUSE => Self::Pause,
ffi::GST_RTSP_SUSPEND_MODE_RESET => Self::Reset,
value => Self::__Unknown(value),
}
}
}
impl StaticType for RTSPSuspendMode {
#[inline]
#[doc(alias = "gst_rtsp_suspend_mode_get_type")]
fn static_type() -> glib::Type {
unsafe { from_glib(ffi::gst_rtsp_suspend_mode_get_type()) }
}
}
impl glib::HasParamSpec for RTSPSuspendMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
Self::ParamSpec::builder_with_default
}
}
impl glib::value::ValueType for RTSPSuspendMode {
type Type = Self;
}
unsafe impl<'a> glib::value::FromValue<'a> for RTSPSuspendMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
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 {
#[inline]
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
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<RTSPSuspendMode> for glib::Value {
#[inline]
fn from(v: RTSPSuspendMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[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;
#[inline]
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 {
#[inline]
unsafe fn from_glib(value: ffi::GstRTSPThreadType) -> Self {
skip_assert_initialized!();
match value {
ffi::GST_RTSP_THREAD_TYPE_CLIENT => Self::Client,
ffi::GST_RTSP_THREAD_TYPE_MEDIA => Self::Media,
value => Self::__Unknown(value),
}
}
}