gstreamer-rs/gstreamer-rtp/src/auto/flags.rs

139 lines
3.9 KiB
Rust
Raw Normal View History

// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
2020-11-22 10:32:36 +00:00
use bitflags::bitflags;
use glib::translate::*;
use glib::value::FromValue;
2021-04-19 16:24:43 +00:00
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
bitflags! {
pub struct RTPBufferFlags: u32 {
const RETRANSMISSION = 1048576;
const REDUNDANT = 2097152;
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(hidden)]
impl ToGlib for RTPBufferFlags {
2020-11-22 10:32:36 +00:00
type GlibType = ffi::GstRTPBufferFlags;
2020-11-22 10:32:36 +00:00
fn to_glib(&self) -> ffi::GstRTPBufferFlags {
self.bits()
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(hidden)]
2020-11-22 10:32:36 +00:00
impl FromGlib<ffi::GstRTPBufferFlags> for RTPBufferFlags {
2020-12-08 13:00:17 +00:00
unsafe fn from_glib(value: ffi::GstRTPBufferFlags) -> RTPBufferFlags {
skip_assert_initialized!();
RTPBufferFlags::from_bits_truncate(value)
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
impl StaticType for RTPBufferFlags {
fn static_type() -> Type {
2020-11-22 10:32:36 +00:00
unsafe { from_glib(ffi::gst_rtp_buffer_flags_get_type()) }
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
2021-04-19 16:24:43 +00:00
impl glib::value::ValueType for RTPBufferFlags {
type Type = Self;
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
2021-04-19 16:24:43 +00:00
unsafe impl<'a> FromValue<'a> for RTPBufferFlags {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
2020-11-22 10:32:36 +00:00
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
2021-04-19 16:24:43 +00:00
impl ToValue for RTPBufferFlags {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<RTPBufferFlags>();
unsafe {
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
bitflags! {
pub struct RTPBufferMapFlags: u32 {
const SKIP_PADDING = 65536;
}
}
#[doc(hidden)]
impl ToGlib for RTPBufferMapFlags {
2020-11-22 10:32:36 +00:00
type GlibType = ffi::GstRTPBufferMapFlags;
2020-11-22 10:32:36 +00:00
fn to_glib(&self) -> ffi::GstRTPBufferMapFlags {
self.bits()
}
}
#[doc(hidden)]
2020-11-22 10:32:36 +00:00
impl FromGlib<ffi::GstRTPBufferMapFlags> for RTPBufferMapFlags {
2020-12-08 13:00:17 +00:00
unsafe fn from_glib(value: ffi::GstRTPBufferMapFlags) -> RTPBufferMapFlags {
skip_assert_initialized!();
RTPBufferMapFlags::from_bits_truncate(value)
}
}
impl StaticType for RTPBufferMapFlags {
fn static_type() -> Type {
2020-11-22 10:32:36 +00:00
unsafe { from_glib(ffi::gst_rtp_buffer_map_flags_get_type()) }
}
}
2021-04-19 16:24:43 +00:00
impl glib::value::ValueType for RTPBufferMapFlags {
type Type = Self;
}
2021-04-19 16:24:43 +00:00
unsafe impl<'a> FromValue<'a> for RTPBufferMapFlags {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
2020-11-22 10:32:36 +00:00
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
2021-04-19 16:24:43 +00:00
impl ToValue for RTPBufferMapFlags {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<RTPBufferMapFlags>();
unsafe {
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}