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    /// Additional RTP buffer flags. These flags can potentially be used on any
11    /// buffers carrying RTP packets.
12    ///
13    /// Note that these are only valid for [`gst::Caps`][crate::gst::Caps] of type: application/x-rtp (x-rtcp).
14    /// They can conflict with other extended buffer flags.
15    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
16    #[doc(alias = "GstRTPBufferFlags")]
17    pub struct RTPBufferFlags: u32 {
18        /// The [`gst::Buffer`][crate::gst::Buffer] was once wrapped
19        ///  in a retransmitted packet as specified by RFC 4588.
20        #[doc(alias = "GST_RTP_BUFFER_FLAG_RETRANSMISSION")]
21        const RETRANSMISSION = ffi::GST_RTP_BUFFER_FLAG_RETRANSMISSION as _;
22        /// The packet represents redundant RTP packet.
23        ///  The flag is used in gstrtpstorage to be able to hold the packetback
24        ///  and use it only for recovery from packet loss.
25        ///  Since: 1.14
26        #[doc(alias = "GST_RTP_BUFFER_FLAG_REDUNDANT")]
27        const REDUNDANT = ffi::GST_RTP_BUFFER_FLAG_REDUNDANT as _;
28    }
29}
30
31#[doc(hidden)]
32impl IntoGlib for RTPBufferFlags {
33    type GlibType = ffi::GstRTPBufferFlags;
34
35    #[inline]
36    fn into_glib(self) -> ffi::GstRTPBufferFlags {
37        self.bits()
38    }
39}
40
41#[doc(hidden)]
42impl FromGlib<ffi::GstRTPBufferFlags> for RTPBufferFlags {
43    #[inline]
44    unsafe fn from_glib(value: ffi::GstRTPBufferFlags) -> Self {
45        skip_assert_initialized!();
46        Self::from_bits_truncate(value)
47    }
48}
49
50impl StaticType for RTPBufferFlags {
51    #[inline]
52    #[doc(alias = "gst_rtp_buffer_flags_get_type")]
53    fn static_type() -> glib::Type {
54        unsafe { from_glib(ffi::gst_rtp_buffer_flags_get_type()) }
55    }
56}
57
58impl glib::HasParamSpec for RTPBufferFlags {
59    type ParamSpec = glib::ParamSpecFlags;
60    type SetValue = Self;
61    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
62
63    fn param_spec_builder() -> Self::BuilderFn {
64        Self::ParamSpec::builder
65    }
66}
67
68impl glib::value::ValueType for RTPBufferFlags {
69    type Type = Self;
70}
71
72unsafe impl<'a> glib::value::FromValue<'a> for RTPBufferFlags {
73    type Checker = glib::value::GenericValueTypeChecker<Self>;
74
75    #[inline]
76    unsafe fn from_value(value: &'a glib::Value) -> Self {
77        skip_assert_initialized!();
78        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
79    }
80}
81
82impl ToValue for RTPBufferFlags {
83    #[inline]
84    fn to_value(&self) -> glib::Value {
85        let mut value = glib::Value::for_value_type::<Self>();
86        unsafe {
87            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
88        }
89        value
90    }
91
92    #[inline]
93    fn value_type(&self) -> glib::Type {
94        Self::static_type()
95    }
96}
97
98impl From<RTPBufferFlags> for glib::Value {
99    #[inline]
100    fn from(v: RTPBufferFlags) -> Self {
101        skip_assert_initialized!();
102        ToValue::to_value(&v)
103    }
104}
105
106bitflags! {
107    /// Additional mapping flags for [`RTPBuffer::from_buffer_readable()`][crate::RTPBuffer::from_buffer_readable()].
108    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
109    #[doc(alias = "GstRTPBufferMapFlags")]
110    pub struct RTPBufferMapFlags: u32 {
111        /// Skip mapping and validation of RTP
112        ///  padding and RTP pad count when present. Useful for buffers where
113        ///  the padding may be encrypted.
114        #[doc(alias = "GST_RTP_BUFFER_MAP_FLAG_SKIP_PADDING")]
115        const SKIP_PADDING = ffi::GST_RTP_BUFFER_MAP_FLAG_SKIP_PADDING as _;
116    }
117}
118
119#[doc(hidden)]
120impl IntoGlib for RTPBufferMapFlags {
121    type GlibType = ffi::GstRTPBufferMapFlags;
122
123    #[inline]
124    fn into_glib(self) -> ffi::GstRTPBufferMapFlags {
125        self.bits()
126    }
127}
128
129#[doc(hidden)]
130impl FromGlib<ffi::GstRTPBufferMapFlags> for RTPBufferMapFlags {
131    #[inline]
132    unsafe fn from_glib(value: ffi::GstRTPBufferMapFlags) -> Self {
133        skip_assert_initialized!();
134        Self::from_bits_truncate(value)
135    }
136}
137
138impl StaticType for RTPBufferMapFlags {
139    #[inline]
140    #[doc(alias = "gst_rtp_buffer_map_flags_get_type")]
141    fn static_type() -> glib::Type {
142        unsafe { from_glib(ffi::gst_rtp_buffer_map_flags_get_type()) }
143    }
144}
145
146impl glib::HasParamSpec for RTPBufferMapFlags {
147    type ParamSpec = glib::ParamSpecFlags;
148    type SetValue = Self;
149    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
150
151    fn param_spec_builder() -> Self::BuilderFn {
152        Self::ParamSpec::builder
153    }
154}
155
156impl glib::value::ValueType for RTPBufferMapFlags {
157    type Type = Self;
158}
159
160unsafe impl<'a> glib::value::FromValue<'a> for RTPBufferMapFlags {
161    type Checker = glib::value::GenericValueTypeChecker<Self>;
162
163    #[inline]
164    unsafe fn from_value(value: &'a glib::Value) -> Self {
165        skip_assert_initialized!();
166        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
167    }
168}
169
170impl ToValue for RTPBufferMapFlags {
171    #[inline]
172    fn to_value(&self) -> glib::Value {
173        let mut value = glib::Value::for_value_type::<Self>();
174        unsafe {
175            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
176        }
177        value
178    }
179
180    #[inline]
181    fn value_type(&self) -> glib::Type {
182        Self::static_type()
183    }
184}
185
186impl From<RTPBufferMapFlags> for glib::Value {
187    #[inline]
188    fn from(v: RTPBufferMapFlags) -> Self {
189        skip_assert_initialized!();
190        ToValue::to_value(&v)
191    }
192}
193
194#[cfg(feature = "v1_20")]
195bitflags! {
196    /// Direction to which to apply the RTP Header Extension
197    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
198    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
199    #[doc(alias = "GstRTPHeaderExtensionDirection")]
200    pub struct RTPHeaderExtensionDirection: u32 {
201        /// Neither send nor
202        /// receive RTP Header Extensions
203        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_INACTIVE")]
204        const INACTIVE = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_INACTIVE as _;
205        /// Only send RTP Header
206        /// Extensions [`RECVONLY`][Self::RECVONLY]: Only
207        /// receive RTP Header Extensions
208        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_SENDONLY")]
209        const SENDONLY = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_SENDONLY as _;
210        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_RECVONLY")]
211        const RECVONLY = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_RECVONLY as _;
212        /// Send and receive RTP
213        /// Header Extensions ext
214        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_SENDRECV")]
215        const SENDRECV = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_SENDRECV as _;
216        /// RTP header extension
217        /// direction is inherited from the stream
218        #[doc(alias = "GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED")]
219        const INHERITED = ffi::GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED as _;
220    }
221}
222
223#[cfg(feature = "v1_20")]
224#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
225#[doc(hidden)]
226impl IntoGlib for RTPHeaderExtensionDirection {
227    type GlibType = ffi::GstRTPHeaderExtensionDirection;
228
229    #[inline]
230    fn into_glib(self) -> ffi::GstRTPHeaderExtensionDirection {
231        self.bits()
232    }
233}
234
235#[cfg(feature = "v1_20")]
236#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
237#[doc(hidden)]
238impl FromGlib<ffi::GstRTPHeaderExtensionDirection> for RTPHeaderExtensionDirection {
239    #[inline]
240    unsafe fn from_glib(value: ffi::GstRTPHeaderExtensionDirection) -> Self {
241        skip_assert_initialized!();
242        Self::from_bits_truncate(value)
243    }
244}
245
246#[cfg(feature = "v1_20")]
247#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
248impl StaticType for RTPHeaderExtensionDirection {
249    #[inline]
250    #[doc(alias = "gst_rtp_header_extension_direction_get_type")]
251    fn static_type() -> glib::Type {
252        unsafe { from_glib(ffi::gst_rtp_header_extension_direction_get_type()) }
253    }
254}
255
256#[cfg(feature = "v1_20")]
257#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
258impl glib::HasParamSpec for RTPHeaderExtensionDirection {
259    type ParamSpec = glib::ParamSpecFlags;
260    type SetValue = Self;
261    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
262
263    fn param_spec_builder() -> Self::BuilderFn {
264        Self::ParamSpec::builder
265    }
266}
267
268#[cfg(feature = "v1_20")]
269#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
270impl glib::value::ValueType for RTPHeaderExtensionDirection {
271    type Type = Self;
272}
273
274#[cfg(feature = "v1_20")]
275#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
276unsafe impl<'a> glib::value::FromValue<'a> for RTPHeaderExtensionDirection {
277    type Checker = glib::value::GenericValueTypeChecker<Self>;
278
279    #[inline]
280    unsafe fn from_value(value: &'a glib::Value) -> Self {
281        skip_assert_initialized!();
282        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
283    }
284}
285
286#[cfg(feature = "v1_20")]
287#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
288impl ToValue for RTPHeaderExtensionDirection {
289    #[inline]
290    fn to_value(&self) -> glib::Value {
291        let mut value = glib::Value::for_value_type::<Self>();
292        unsafe {
293            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
294        }
295        value
296    }
297
298    #[inline]
299    fn value_type(&self) -> glib::Type {
300        Self::static_type()
301    }
302}
303
304#[cfg(feature = "v1_20")]
305#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
306impl From<RTPHeaderExtensionDirection> for glib::Value {
307    #[inline]
308    fn from(v: RTPHeaderExtensionDirection) -> Self {
309        skip_assert_initialized!();
310        ToValue::to_value(&v)
311    }
312}
313
314#[cfg(feature = "v1_20")]
315bitflags! {
316    /// Flags that apply to a RTP Audio/Video header extension.
317    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
318    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
319    #[doc(alias = "GstRTPHeaderExtensionFlags")]
320    pub struct RTPHeaderExtensionFlags: u32 {
321        /// The one byte rtp extension header.
322        ///  1-16 data bytes per extension with a maximum of
323        ///  14 extension ids in total.
324        #[doc(alias = "GST_RTP_HEADER_EXTENSION_ONE_BYTE")]
325        const ONE_BYTE = ffi::GST_RTP_HEADER_EXTENSION_ONE_BYTE as _;
326        /// The two byte rtp extension header.
327        ///  256 data bytes per extension with a maximum of 255 (or 256
328        ///  including appbits) extensions in total.
329        #[doc(alias = "GST_RTP_HEADER_EXTENSION_TWO_BYTE")]
330        const TWO_BYTE = ffi::GST_RTP_HEADER_EXTENSION_TWO_BYTE as _;
331    }
332}
333
334#[cfg(feature = "v1_20")]
335#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
336#[doc(hidden)]
337impl IntoGlib for RTPHeaderExtensionFlags {
338    type GlibType = ffi::GstRTPHeaderExtensionFlags;
339
340    #[inline]
341    fn into_glib(self) -> ffi::GstRTPHeaderExtensionFlags {
342        self.bits()
343    }
344}
345
346#[cfg(feature = "v1_20")]
347#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
348#[doc(hidden)]
349impl FromGlib<ffi::GstRTPHeaderExtensionFlags> for RTPHeaderExtensionFlags {
350    #[inline]
351    unsafe fn from_glib(value: ffi::GstRTPHeaderExtensionFlags) -> Self {
352        skip_assert_initialized!();
353        Self::from_bits_truncate(value)
354    }
355}
356
357#[cfg(feature = "v1_20")]
358#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
359impl StaticType for RTPHeaderExtensionFlags {
360    #[inline]
361    #[doc(alias = "gst_rtp_header_extension_flags_get_type")]
362    fn static_type() -> glib::Type {
363        unsafe { from_glib(ffi::gst_rtp_header_extension_flags_get_type()) }
364    }
365}
366
367#[cfg(feature = "v1_20")]
368#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
369impl glib::HasParamSpec for RTPHeaderExtensionFlags {
370    type ParamSpec = glib::ParamSpecFlags;
371    type SetValue = Self;
372    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
373
374    fn param_spec_builder() -> Self::BuilderFn {
375        Self::ParamSpec::builder
376    }
377}
378
379#[cfg(feature = "v1_20")]
380#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
381impl glib::value::ValueType for RTPHeaderExtensionFlags {
382    type Type = Self;
383}
384
385#[cfg(feature = "v1_20")]
386#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
387unsafe impl<'a> glib::value::FromValue<'a> for RTPHeaderExtensionFlags {
388    type Checker = glib::value::GenericValueTypeChecker<Self>;
389
390    #[inline]
391    unsafe fn from_value(value: &'a glib::Value) -> Self {
392        skip_assert_initialized!();
393        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
394    }
395}
396
397#[cfg(feature = "v1_20")]
398#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
399impl ToValue for RTPHeaderExtensionFlags {
400    #[inline]
401    fn to_value(&self) -> glib::Value {
402        let mut value = glib::Value::for_value_type::<Self>();
403        unsafe {
404            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
405        }
406        value
407    }
408
409    #[inline]
410    fn value_type(&self) -> glib::Type {
411        Self::static_type()
412    }
413}
414
415#[cfg(feature = "v1_20")]
416#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
417impl From<RTPHeaderExtensionFlags> for glib::Value {
418    #[inline]
419    fn from(v: RTPHeaderExtensionFlags) -> Self {
420        skip_assert_initialized!();
421        ToValue::to_value(&v)
422    }
423}