// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_rtsp_server_sys;

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RTSPAddressPoolResult {
    Ok,
    Einval,
    Ereserved,
    Erange,
    Elast,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for RTSPAddressPoolResult {
    type GlibType = gst_rtsp_server_sys::GstRTSPAddressPoolResult;

    fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPAddressPoolResult {
        match *self {
            RTSPAddressPoolResult::Ok => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_OK,
            RTSPAddressPoolResult::Einval => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_EINVAL,
            RTSPAddressPoolResult::Ereserved => {
                gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ERESERVED
            }
            RTSPAddressPoolResult::Erange => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ERANGE,
            RTSPAddressPoolResult::Elast => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ELAST,
            RTSPAddressPoolResult::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPAddressPoolResult> for RTSPAddressPoolResult {
    fn from_glib(value: gst_rtsp_server_sys::GstRTSPAddressPoolResult) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RTSPAddressPoolResult::Ok,
            -1 => RTSPAddressPoolResult::Einval,
            -2 => RTSPAddressPoolResult::Ereserved,
            -3 => RTSPAddressPoolResult::Erange,
            -4 => RTSPAddressPoolResult::Elast,
            value => RTSPAddressPoolResult::__Unknown(value),
        }
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RTSPFilterResult {
    Remove,
    Keep,
    Ref,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for RTSPFilterResult {
    type GlibType = gst_rtsp_server_sys::GstRTSPFilterResult;

    fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPFilterResult {
        match *self {
            RTSPFilterResult::Remove => gst_rtsp_server_sys::GST_RTSP_FILTER_REMOVE,
            RTSPFilterResult::Keep => gst_rtsp_server_sys::GST_RTSP_FILTER_KEEP,
            RTSPFilterResult::Ref => gst_rtsp_server_sys::GST_RTSP_FILTER_REF,
            RTSPFilterResult::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPFilterResult> for RTSPFilterResult {
    fn from_glib(value: gst_rtsp_server_sys::GstRTSPFilterResult) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RTSPFilterResult::Remove,
            1 => RTSPFilterResult::Keep,
            2 => RTSPFilterResult::Ref,
            value => RTSPFilterResult::__Unknown(value),
        }
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RTSPMediaStatus {
    Unprepared,
    Unpreparing,
    Preparing,
    Prepared,
    Suspended,
    Error,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for RTSPMediaStatus {
    type GlibType = gst_rtsp_server_sys::GstRTSPMediaStatus;

    fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPMediaStatus {
        match *self {
            RTSPMediaStatus::Unprepared => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_UNPREPARED,
            RTSPMediaStatus::Unpreparing => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_UNPREPARING,
            RTSPMediaStatus::Preparing => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_PREPARING,
            RTSPMediaStatus::Prepared => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_PREPARED,
            RTSPMediaStatus::Suspended => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_SUSPENDED,
            RTSPMediaStatus::Error => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_ERROR,
            RTSPMediaStatus::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPMediaStatus> for RTSPMediaStatus {
    fn from_glib(value: gst_rtsp_server_sys::GstRTSPMediaStatus) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RTSPMediaStatus::Unprepared,
            1 => RTSPMediaStatus::Unpreparing,
            2 => RTSPMediaStatus::Preparing,
            3 => RTSPMediaStatus::Prepared,
            4 => RTSPMediaStatus::Suspended,
            5 => RTSPMediaStatus::Error,
            value => RTSPMediaStatus::__Unknown(value),
        }
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RTSPPublishClockMode {
    None,
    Clock,
    ClockAndOffset,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for RTSPPublishClockMode {
    type GlibType = gst_rtsp_server_sys::GstRTSPPublishClockMode;

    fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPPublishClockMode {
        match *self {
            RTSPPublishClockMode::None => gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_NONE,
            RTSPPublishClockMode::Clock => gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK,
            RTSPPublishClockMode::ClockAndOffset => {
                gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET
            }
            RTSPPublishClockMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPPublishClockMode> for RTSPPublishClockMode {
    fn from_glib(value: gst_rtsp_server_sys::GstRTSPPublishClockMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RTSPPublishClockMode::None,
            1 => RTSPPublishClockMode::Clock,
            2 => RTSPPublishClockMode::ClockAndOffset,
            value => RTSPPublishClockMode::__Unknown(value),
        }
    }
}

impl StaticType for RTSPPublishClockMode {
    fn static_type() -> Type {
        unsafe { from_glib(gst_rtsp_server_sys::gst_rtsp_publish_clock_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for RTSPPublishClockMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for RTSPPublishClockMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for RTSPPublishClockMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RTSPSuspendMode {
    None,
    Pause,
    Reset,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for RTSPSuspendMode {
    type GlibType = gst_rtsp_server_sys::GstRTSPSuspendMode;

    fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPSuspendMode {
        match *self {
            RTSPSuspendMode::None => gst_rtsp_server_sys::GST_RTSP_SUSPEND_MODE_NONE,
            RTSPSuspendMode::Pause => gst_rtsp_server_sys::GST_RTSP_SUSPEND_MODE_PAUSE,
            RTSPSuspendMode::Reset => gst_rtsp_server_sys::GST_RTSP_SUSPEND_MODE_RESET,
            RTSPSuspendMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPSuspendMode> for RTSPSuspendMode {
    fn from_glib(value: gst_rtsp_server_sys::GstRTSPSuspendMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RTSPSuspendMode::None,
            1 => RTSPSuspendMode::Pause,
            2 => RTSPSuspendMode::Reset,
            value => RTSPSuspendMode::__Unknown(value),
        }
    }
}

impl StaticType for RTSPSuspendMode {
    fn static_type() -> Type {
        unsafe { from_glib(gst_rtsp_server_sys::gst_rtsp_suspend_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for RTSPSuspendMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for RTSPSuspendMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for RTSPSuspendMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RTSPThreadType {
    Client,
    Media,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for RTSPThreadType {
    type GlibType = gst_rtsp_server_sys::GstRTSPThreadType;

    fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPThreadType {
        match *self {
            RTSPThreadType::Client => gst_rtsp_server_sys::GST_RTSP_THREAD_TYPE_CLIENT,
            RTSPThreadType::Media => gst_rtsp_server_sys::GST_RTSP_THREAD_TYPE_MEDIA,
            RTSPThreadType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPThreadType> for RTSPThreadType {
    fn from_glib(value: gst_rtsp_server_sys::GstRTSPThreadType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RTSPThreadType::Client,
            1 => RTSPThreadType::Media,
            value => RTSPThreadType::__Unknown(value),
        }
    }
}
