// 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_sys;

bitflags! {
    pub struct RTSPEvent: u32 {
        const READ = 1;
        const WRITE = 2;
    }
}

#[doc(hidden)]
impl ToGlib for RTSPEvent {
    type GlibType = gst_rtsp_sys::GstRTSPEvent;

    fn to_glib(&self) -> gst_rtsp_sys::GstRTSPEvent {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_sys::GstRTSPEvent> for RTSPEvent {
    fn from_glib(value: gst_rtsp_sys::GstRTSPEvent) -> RTSPEvent {
        skip_assert_initialized!();
        RTSPEvent::from_bits_truncate(value)
    }
}

impl StaticType for RTSPEvent {
    fn static_type() -> Type {
        unsafe { from_glib(gst_rtsp_sys::gst_rtsp_event_get_type()) }
    }
}

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

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

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

bitflags! {
    pub struct RTSPLowerTrans: u32 {
        const UDP = 1;
        const UDP_MCAST = 2;
        const TCP = 4;
        const HTTP = 16;
        const TLS = 32;
    }
}

#[doc(hidden)]
impl ToGlib for RTSPLowerTrans {
    type GlibType = gst_rtsp_sys::GstRTSPLowerTrans;

    fn to_glib(&self) -> gst_rtsp_sys::GstRTSPLowerTrans {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_sys::GstRTSPLowerTrans> for RTSPLowerTrans {
    fn from_glib(value: gst_rtsp_sys::GstRTSPLowerTrans) -> RTSPLowerTrans {
        skip_assert_initialized!();
        RTSPLowerTrans::from_bits_truncate(value)
    }
}

impl StaticType for RTSPLowerTrans {
    fn static_type() -> Type {
        unsafe { from_glib(gst_rtsp_sys::gst_rtsp_lower_trans_get_type()) }
    }
}

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

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

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

bitflags! {
    pub struct RTSPMethod: u32 {
        const DESCRIBE = 1;
        const ANNOUNCE = 2;
        const GET_PARAMETER = 4;
        const OPTIONS = 8;
        const PAUSE = 16;
        const PLAY = 32;
        const RECORD = 64;
        const REDIRECT = 128;
        const SETUP = 256;
        const SET_PARAMETER = 512;
        const TEARDOWN = 1024;
        const GET = 2048;
        const POST = 4096;
    }
}

#[doc(hidden)]
impl ToGlib for RTSPMethod {
    type GlibType = gst_rtsp_sys::GstRTSPMethod;

    fn to_glib(&self) -> gst_rtsp_sys::GstRTSPMethod {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_sys::GstRTSPMethod> for RTSPMethod {
    fn from_glib(value: gst_rtsp_sys::GstRTSPMethod) -> RTSPMethod {
        skip_assert_initialized!();
        RTSPMethod::from_bits_truncate(value)
    }
}

impl StaticType for RTSPMethod {
    fn static_type() -> Type {
        unsafe { from_glib(gst_rtsp_sys::gst_rtsp_method_get_type()) }
    }
}

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

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

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

bitflags! {
    pub struct RTSPProfile: u32 {
        const AVP = 1;
        const SAVP = 2;
        const AVPF = 4;
        const SAVPF = 8;
    }
}

#[doc(hidden)]
impl ToGlib for RTSPProfile {
    type GlibType = gst_rtsp_sys::GstRTSPProfile;

    fn to_glib(&self) -> gst_rtsp_sys::GstRTSPProfile {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_sys::GstRTSPProfile> for RTSPProfile {
    fn from_glib(value: gst_rtsp_sys::GstRTSPProfile) -> RTSPProfile {
        skip_assert_initialized!();
        RTSPProfile::from_bits_truncate(value)
    }
}

impl StaticType for RTSPProfile {
    fn static_type() -> Type {
        unsafe { from_glib(gst_rtsp_sys::gst_rtsp_profile_get_type()) }
    }
}

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

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

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

bitflags! {
    pub struct RTSPTransMode: u32 {
        const RTP = 1;
        const RDT = 2;
    }
}

#[doc(hidden)]
impl ToGlib for RTSPTransMode {
    type GlibType = gst_rtsp_sys::GstRTSPTransMode;

    fn to_glib(&self) -> gst_rtsp_sys::GstRTSPTransMode {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtsp_sys::GstRTSPTransMode> for RTSPTransMode {
    fn from_glib(value: gst_rtsp_sys::GstRTSPTransMode) -> RTSPTransMode {
        skip_assert_initialized!();
        RTSPTransMode::from_bits_truncate(value)
    }
}

impl StaticType for RTSPTransMode {
    fn static_type() -> Type {
        unsafe { from_glib(gst_rtsp_sys::gst_rtsp_trans_mode_get_type()) }
    }
}

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

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

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