gstreamer_rtp/auto/
flags.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::{bitflags::bitflags, prelude::*, translate::*};
8
9bitflags! {
10    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
11    #[doc(alias = "GstRTPBufferFlags")]
12    pub struct RTPBufferFlags: u32 {
13        #[doc(alias = "GST_RTP_BUFFER_FLAG_RETRANSMISSION")]
14        const RETRANSMISSION = ffi::GST_RTP_BUFFER_FLAG_RETRANSMISSION as _;
15        #[doc(alias = "GST_RTP_BUFFER_FLAG_REDUNDANT")]
16        const REDUNDANT = ffi::GST_RTP_BUFFER_FLAG_REDUNDANT as _;
17    }
18}
19
20#[doc(hidden)]
21impl IntoGlib for RTPBufferFlags {
22    type GlibType = ffi::GstRTPBufferFlags;
23
24    #[inline]
25    fn into_glib(self) -> ffi::GstRTPBufferFlags {
26        self.bits()
27    }
28}
29
30#[doc(hidden)]
31impl FromGlib<ffi::GstRTPBufferFlags> for RTPBufferFlags {
32    #[inline]
33    unsafe fn from_glib(value: ffi::GstRTPBufferFlags) -> Self {
34        skip_assert_initialized!();
35        Self::from_bits_truncate(value)
36    }
37}
38
39impl StaticType for RTPBufferFlags {
40    #[inline]
41    #[doc(alias = "gst_rtp_buffer_flags_get_type")]
42    fn static_type() -> glib::Type {
43        unsafe { from_glib(ffi::gst_rtp_buffer_flags_get_type()) }
44    }
45}
46
47impl glib::HasParamSpec for RTPBufferFlags {
48    type ParamSpec = glib::ParamSpecFlags;
49    type SetValue = Self;
50    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
51
52    fn param_spec_builder() -> Self::BuilderFn {
53        Self::ParamSpec::builder
54    }
55}
56
57impl glib::value::ValueType for RTPBufferFlags {
58    type Type = Self;
59}
60
61unsafe impl<'a> glib::value::FromValue<'a> for RTPBufferFlags {
62    type Checker = glib::value::GenericValueTypeChecker<Self>;
63
64    #[inline]
65    unsafe fn from_value(value: &'a glib::Value) -> Self {
66        skip_assert_initialized!();
67        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
68    }
69}
70
71impl ToValue for RTPBufferFlags {
72    #[inline]
73    fn to_value(&self) -> glib::Value {
74        let mut value = glib::Value::for_value_type::<Self>();
75        unsafe {
76            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
77        }
78        value
79    }
80
81    #[inline]
82    fn value_type(&self) -> glib::Type {
83        Self::static_type()
84    }
85}
86
87impl From<RTPBufferFlags> for glib::Value {
88    #[inline]
89    fn from(v: RTPBufferFlags) -> Self {
90        skip_assert_initialized!();
91        ToValue::to_value(&v)
92    }
93}
94
95bitflags! {
96    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
97    #[doc(alias = "GstRTPBufferMapFlags")]
98    pub struct RTPBufferMapFlags: u32 {
99        #[doc(alias = "GST_RTP_BUFFER_MAP_FLAG_SKIP_PADDING")]
100        const SKIP_PADDING = ffi::GST_RTP_BUFFER_MAP_FLAG_SKIP_PADDING as _;
101    }
102}
103
104#[doc(hidden)]
105impl IntoGlib for RTPBufferMapFlags {
106    type GlibType = ffi::GstRTPBufferMapFlags;
107
108    #[inline]
109    fn into_glib(self) -> ffi::GstRTPBufferMapFlags {
110        self.bits()
111    }
112}
113
114#[doc(hidden)]
115impl FromGlib<ffi::GstRTPBufferMapFlags> for RTPBufferMapFlags {
116    #[inline]
117    unsafe fn from_glib(value: ffi::GstRTPBufferMapFlags) -> Self {
118        skip_assert_initialized!();
119        Self::from_bits_truncate(value)
120    }
121}
122
123impl StaticType for RTPBufferMapFlags {
124    #[inline]
125    #[doc(alias = "gst_rtp_buffer_map_flags_get_type")]
126    fn static_type() -> glib::Type {
127        unsafe { from_glib(ffi::gst_rtp_buffer_map_flags_get_type()) }
128    }
129}
130
131impl glib::HasParamSpec for RTPBufferMapFlags {
132    type ParamSpec = glib::ParamSpecFlags;
133    type SetValue = Self;
134    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
135
136    fn param_spec_builder() -> Self::BuilderFn {
137        Self::ParamSpec::builder
138    }
139}
140
141impl glib::value::ValueType for RTPBufferMapFlags {
142    type Type = Self;
143}
144
145unsafe impl<'a> glib::value::FromValue<'a> for RTPBufferMapFlags {
146    type Checker = glib::value::GenericValueTypeChecker<Self>;
147
148    #[inline]
149    unsafe fn from_value(value: &'a glib::Value) -> Self {
150        skip_assert_initialized!();
151        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
152    }
153}
154
155impl ToValue for RTPBufferMapFlags {
156    #[inline]
157    fn to_value(&self) -> glib::Value {
158        let mut value = glib::Value::for_value_type::<Self>();
159        unsafe {
160            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
161        }
162        value
163    }
164
165    #[inline]
166    fn value_type(&self) -> glib::Type {
167        Self::static_type()
168    }
169}
170
171impl From<RTPBufferMapFlags> for glib::Value {
172    #[inline]
173    fn from(v: RTPBufferMapFlags) -> Self {
174        skip_assert_initialized!();
175        ToValue::to_value(&v)
176    }
177}
178
179#[cfg(feature = "v1_20")]
180bitflags! {
181    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
182    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
183    #[doc(alias = "GstRTPHeaderExtensionDirection")]
184    pub struct RTPHeaderExtensionDirection: u32 {
185        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_INACTIVE")]
186        const INACTIVE = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_INACTIVE as _;
187        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_SENDONLY")]
188        const SENDONLY = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_SENDONLY as _;
189        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_RECVONLY")]
190        const RECVONLY = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_RECVONLY as _;
191        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_SENDRECV")]
192        const SENDRECV = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_SENDRECV as _;
193        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED")]
194        const INHERITED = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED as _;
195    }
196}
197
198#[cfg(feature = "v1_20")]
199#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
200#[doc(hidden)]
201impl IntoGlib for RTPHeaderExtensionDirection {
202    type GlibType = ffi::GstRTPHeaderExtensionDirection;
203
204    #[inline]
205    fn into_glib(self) -> ffi::GstRTPHeaderExtensionDirection {
206        self.bits()
207    }
208}
209
210#[cfg(feature = "v1_20")]
211#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
212#[doc(hidden)]
213impl FromGlib<ffi::GstRTPHeaderExtensionDirection> for RTPHeaderExtensionDirection {
214    #[inline]
215    unsafe fn from_glib(value: ffi::GstRTPHeaderExtensionDirection) -> Self {
216        skip_assert_initialized!();
217        Self::from_bits_truncate(value)
218    }
219}
220
221#[cfg(feature = "v1_20")]
222#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
223impl StaticType for RTPHeaderExtensionDirection {
224    #[inline]
225    #[doc(alias = "gst_rtp_header_extension_direction_get_type")]
226    fn static_type() -> glib::Type {
227        unsafe { from_glib(ffi::gst_rtp_header_extension_direction_get_type()) }
228    }
229}
230
231#[cfg(feature = "v1_20")]
232#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
233impl glib::HasParamSpec for RTPHeaderExtensionDirection {
234    type ParamSpec = glib::ParamSpecFlags;
235    type SetValue = Self;
236    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
237
238    fn param_spec_builder() -> Self::BuilderFn {
239        Self::ParamSpec::builder
240    }
241}
242
243#[cfg(feature = "v1_20")]
244#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
245impl glib::value::ValueType for RTPHeaderExtensionDirection {
246    type Type = Self;
247}
248
249#[cfg(feature = "v1_20")]
250#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
251unsafe impl<'a> glib::value::FromValue<'a> for RTPHeaderExtensionDirection {
252    type Checker = glib::value::GenericValueTypeChecker<Self>;
253
254    #[inline]
255    unsafe fn from_value(value: &'a glib::Value) -> Self {
256        skip_assert_initialized!();
257        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
258    }
259}
260
261#[cfg(feature = "v1_20")]
262#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
263impl ToValue for RTPHeaderExtensionDirection {
264    #[inline]
265    fn to_value(&self) -> glib::Value {
266        let mut value = glib::Value::for_value_type::<Self>();
267        unsafe {
268            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
269        }
270        value
271    }
272
273    #[inline]
274    fn value_type(&self) -> glib::Type {
275        Self::static_type()
276    }
277}
278
279#[cfg(feature = "v1_20")]
280#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
281impl From<RTPHeaderExtensionDirection> for glib::Value {
282    #[inline]
283    fn from(v: RTPHeaderExtensionDirection) -> Self {
284        skip_assert_initialized!();
285        ToValue::to_value(&v)
286    }
287}
288
289#[cfg(feature = "v1_20")]
290bitflags! {
291    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
292    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
293    #[doc(alias = "GstRTPHeaderExtensionFlags")]
294    pub struct RTPHeaderExtensionFlags: u32 {
295        #[doc(alias = "GST_RTP_HEADER_EXTENSION_ONE_BYTE")]
296        const ONE_BYTE = ffi::GST_RTP_HEADER_EXTENSION_ONE_BYTE as _;
297        #[doc(alias = "GST_RTP_HEADER_EXTENSION_TWO_BYTE")]
298        const TWO_BYTE = ffi::GST_RTP_HEADER_EXTENSION_TWO_BYTE as _;
299    }
300}
301
302#[cfg(feature = "v1_20")]
303#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
304#[doc(hidden)]
305impl IntoGlib for RTPHeaderExtensionFlags {
306    type GlibType = ffi::GstRTPHeaderExtensionFlags;
307
308    #[inline]
309    fn into_glib(self) -> ffi::GstRTPHeaderExtensionFlags {
310        self.bits()
311    }
312}
313
314#[cfg(feature = "v1_20")]
315#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
316#[doc(hidden)]
317impl FromGlib<ffi::GstRTPHeaderExtensionFlags> for RTPHeaderExtensionFlags {
318    #[inline]
319    unsafe fn from_glib(value: ffi::GstRTPHeaderExtensionFlags) -> Self {
320        skip_assert_initialized!();
321        Self::from_bits_truncate(value)
322    }
323}
324
325#[cfg(feature = "v1_20")]
326#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
327impl StaticType for RTPHeaderExtensionFlags {
328    #[inline]
329    #[doc(alias = "gst_rtp_header_extension_flags_get_type")]
330    fn static_type() -> glib::Type {
331        unsafe { from_glib(ffi::gst_rtp_header_extension_flags_get_type()) }
332    }
333}
334
335#[cfg(feature = "v1_20")]
336#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
337impl glib::HasParamSpec for RTPHeaderExtensionFlags {
338    type ParamSpec = glib::ParamSpecFlags;
339    type SetValue = Self;
340    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
341
342    fn param_spec_builder() -> Self::BuilderFn {
343        Self::ParamSpec::builder
344    }
345}
346
347#[cfg(feature = "v1_20")]
348#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
349impl glib::value::ValueType for RTPHeaderExtensionFlags {
350    type Type = Self;
351}
352
353#[cfg(feature = "v1_20")]
354#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
355unsafe impl<'a> glib::value::FromValue<'a> for RTPHeaderExtensionFlags {
356    type Checker = glib::value::GenericValueTypeChecker<Self>;
357
358    #[inline]
359    unsafe fn from_value(value: &'a glib::Value) -> Self {
360        skip_assert_initialized!();
361        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
362    }
363}
364
365#[cfg(feature = "v1_20")]
366#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
367impl ToValue for RTPHeaderExtensionFlags {
368    #[inline]
369    fn to_value(&self) -> glib::Value {
370        let mut value = glib::Value::for_value_type::<Self>();
371        unsafe {
372            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
373        }
374        value
375    }
376
377    #[inline]
378    fn value_type(&self) -> glib::Type {
379        Self::static_type()
380    }
381}
382
383#[cfg(feature = "v1_20")]
384#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
385impl From<RTPHeaderExtensionFlags> for glib::Value {
386    #[inline]
387    fn from(v: RTPHeaderExtensionFlags) -> Self {
388        skip_assert_initialized!();
389        ToValue::to_value(&v)
390    }
391}