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

#[cfg(any(feature = "v1_10", feature = "dox"))]
bitflags! {
    pub struct RTPBufferFlags: u32 {
        const RETRANSMISSION = 1048576;
        const REDUNDANT = 2097152;
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for RTPBufferFlags {
    type GlibType = gst_rtp_sys::GstRTPBufferFlags;

    fn to_glib(&self) -> gst_rtp_sys::GstRTPBufferFlags {
        self.bits()
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gst_rtp_sys::GstRTPBufferFlags> for RTPBufferFlags {
    fn from_glib(value: gst_rtp_sys::GstRTPBufferFlags) -> RTPBufferFlags {
        skip_assert_initialized!();
        RTPBufferFlags::from_bits_truncate(value)
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl StaticType for RTPBufferFlags {
    fn static_type() -> Type {
        unsafe { from_glib(gst_rtp_sys::gst_rtp_buffer_flags_get_type()) }
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl<'a> FromValueOptional<'a> for RTPBufferFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl<'a> FromValue<'a> for RTPBufferFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl SetValue for RTPBufferFlags {
    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 RTPBufferMapFlags: u32 {
        const SKIP_PADDING = 65536;
    }
}

#[doc(hidden)]
impl ToGlib for RTPBufferMapFlags {
    type GlibType = gst_rtp_sys::GstRTPBufferMapFlags;

    fn to_glib(&self) -> gst_rtp_sys::GstRTPBufferMapFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<gst_rtp_sys::GstRTPBufferMapFlags> for RTPBufferMapFlags {
    fn from_glib(value: gst_rtp_sys::GstRTPBufferMapFlags) -> RTPBufferMapFlags {
        skip_assert_initialized!();
        RTPBufferMapFlags::from_bits_truncate(value)
    }
}

impl StaticType for RTPBufferMapFlags {
    fn static_type() -> Type {
        unsafe { from_glib(gst_rtp_sys::gst_rtp_buffer_map_flags_get_type()) }
    }
}

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

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

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