gstreamer/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::*, GStr};
8
9bitflags! {
10    /// GstBinFlags are a set of flags specific to bins. Most are set/used
11    /// internally. They can be checked using the GST_OBJECT_FLAG_IS_SET() macro,
12    /// and (un)set using GST_OBJECT_FLAG_SET() and GST_OBJECT_FLAG_UNSET().
13    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
14    #[doc(alias = "GstBinFlags")]
15    pub struct BinFlags: u32 {
16        /// Don't resync a state change when elements are added or linked in the bin
17        #[doc(alias = "GST_BIN_FLAG_NO_RESYNC")]
18        const NO_RESYNC = ffi::GST_BIN_FLAG_NO_RESYNC as _;
19        /// Indicates whether the bin can handle elements that add/remove source pads
20        /// at any point in time without first posting a no-more-pads signal.
21        #[doc(alias = "GST_BIN_FLAG_STREAMS_AWARE")]
22        const STREAMS_AWARE = ffi::GST_BIN_FLAG_STREAMS_AWARE as _;
23    }
24}
25
26#[doc(hidden)]
27impl IntoGlib for BinFlags {
28    type GlibType = ffi::GstBinFlags;
29
30    #[inline]
31    fn into_glib(self) -> ffi::GstBinFlags {
32        self.bits()
33    }
34}
35
36#[doc(hidden)]
37impl FromGlib<ffi::GstBinFlags> for BinFlags {
38    #[inline]
39    unsafe fn from_glib(value: ffi::GstBinFlags) -> Self {
40        skip_assert_initialized!();
41        Self::from_bits_truncate(value)
42    }
43}
44
45impl StaticType for BinFlags {
46    #[inline]
47    #[doc(alias = "gst_bin_flags_get_type")]
48    fn static_type() -> glib::Type {
49        unsafe { from_glib(ffi::gst_bin_flags_get_type()) }
50    }
51}
52
53impl glib::HasParamSpec for BinFlags {
54    type ParamSpec = glib::ParamSpecFlags;
55    type SetValue = Self;
56    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
57
58    fn param_spec_builder() -> Self::BuilderFn {
59        Self::ParamSpec::builder
60    }
61}
62
63impl glib::value::ValueType for BinFlags {
64    type Type = Self;
65}
66
67unsafe impl<'a> glib::value::FromValue<'a> for BinFlags {
68    type Checker = glib::value::GenericValueTypeChecker<Self>;
69
70    #[inline]
71    unsafe fn from_value(value: &'a glib::Value) -> Self {
72        skip_assert_initialized!();
73        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
74    }
75}
76
77impl ToValue for BinFlags {
78    #[inline]
79    fn to_value(&self) -> glib::Value {
80        let mut value = glib::Value::for_value_type::<Self>();
81        unsafe {
82            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
83        }
84        value
85    }
86
87    #[inline]
88    fn value_type(&self) -> glib::Type {
89        Self::static_type()
90    }
91}
92
93impl From<BinFlags> for glib::Value {
94    #[inline]
95    fn from(v: BinFlags) -> Self {
96        skip_assert_initialized!();
97        ToValue::to_value(&v)
98    }
99}
100
101bitflags! {
102    /// A set of flags that can be provided to the [`Buffer::copy_into()`][crate::Buffer::copy_into()]
103    /// function to specify which items should be copied.
104    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
105    #[doc(alias = "GstBufferCopyFlags")]
106    pub struct BufferCopyFlags: u32 {
107        /// flag indicating that buffer flags should be copied
108        #[doc(alias = "GST_BUFFER_COPY_FLAGS")]
109        const FLAGS = ffi::GST_BUFFER_COPY_FLAGS as _;
110        /// flag indicating that buffer pts, dts,
111        ///  duration, offset and offset_end should be copied
112        #[doc(alias = "GST_BUFFER_COPY_TIMESTAMPS")]
113        const TIMESTAMPS = ffi::GST_BUFFER_COPY_TIMESTAMPS as _;
114        /// flag indicating that buffer meta should be
115        ///  copied
116        #[doc(alias = "GST_BUFFER_COPY_META")]
117        const META = ffi::GST_BUFFER_COPY_META as _;
118        /// flag indicating that buffer memory should be reffed
119        ///  and appended to already existing memory. Unless the memory is marked as
120        ///  NO_SHARE, no actual copy of the memory is made but it is simply reffed.
121        ///  Add [`DEEP`][Self::DEEP] to force a real copy.
122        #[doc(alias = "GST_BUFFER_COPY_MEMORY")]
123        const MEMORY = ffi::GST_BUFFER_COPY_MEMORY as _;
124        /// flag indicating that buffer memory should be
125        ///  merged
126        #[doc(alias = "GST_BUFFER_COPY_MERGE")]
127        const MERGE = ffi::GST_BUFFER_COPY_MERGE as _;
128        /// flag indicating that memory should always be copied instead of reffed
129        #[doc(alias = "GST_BUFFER_COPY_DEEP")]
130        const DEEP = ffi::GST_BUFFER_COPY_DEEP as _;
131    }
132}
133
134#[doc(hidden)]
135impl IntoGlib for BufferCopyFlags {
136    type GlibType = ffi::GstBufferCopyFlags;
137
138    #[inline]
139    fn into_glib(self) -> ffi::GstBufferCopyFlags {
140        self.bits()
141    }
142}
143
144#[doc(hidden)]
145impl FromGlib<ffi::GstBufferCopyFlags> for BufferCopyFlags {
146    #[inline]
147    unsafe fn from_glib(value: ffi::GstBufferCopyFlags) -> Self {
148        skip_assert_initialized!();
149        Self::from_bits_truncate(value)
150    }
151}
152
153impl StaticType for BufferCopyFlags {
154    #[inline]
155    #[doc(alias = "gst_buffer_copy_flags_get_type")]
156    fn static_type() -> glib::Type {
157        unsafe { from_glib(ffi::gst_buffer_copy_flags_get_type()) }
158    }
159}
160
161impl glib::HasParamSpec for BufferCopyFlags {
162    type ParamSpec = glib::ParamSpecFlags;
163    type SetValue = Self;
164    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
165
166    fn param_spec_builder() -> Self::BuilderFn {
167        Self::ParamSpec::builder
168    }
169}
170
171impl glib::value::ValueType for BufferCopyFlags {
172    type Type = Self;
173}
174
175unsafe impl<'a> glib::value::FromValue<'a> for BufferCopyFlags {
176    type Checker = glib::value::GenericValueTypeChecker<Self>;
177
178    #[inline]
179    unsafe fn from_value(value: &'a glib::Value) -> Self {
180        skip_assert_initialized!();
181        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
182    }
183}
184
185impl ToValue for BufferCopyFlags {
186    #[inline]
187    fn to_value(&self) -> glib::Value {
188        let mut value = glib::Value::for_value_type::<Self>();
189        unsafe {
190            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
191        }
192        value
193    }
194
195    #[inline]
196    fn value_type(&self) -> glib::Type {
197        Self::static_type()
198    }
199}
200
201impl From<BufferCopyFlags> for glib::Value {
202    #[inline]
203    fn from(v: BufferCopyFlags) -> Self {
204        skip_assert_initialized!();
205        ToValue::to_value(&v)
206    }
207}
208
209bitflags! {
210    /// A set of buffer flags used to describe properties of a [`Buffer`][crate::Buffer].
211    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
212    #[doc(alias = "GstBufferFlags")]
213    pub struct BufferFlags: u32 {
214        /// the buffer is live data and should be discarded in
215        ///  the PAUSED state.
216        #[doc(alias = "GST_BUFFER_FLAG_LIVE")]
217        const LIVE = ffi::GST_BUFFER_FLAG_LIVE as _;
218        /// the buffer contains data that should be dropped
219        ///  because it will be clipped against the segment
220        ///  boundaries or because it does not contain data
221        ///  that should be shown to the user.
222        #[doc(alias = "GST_BUFFER_FLAG_DECODE_ONLY")]
223        const DECODE_ONLY = ffi::GST_BUFFER_FLAG_DECODE_ONLY as _;
224        /// the buffer marks a data discontinuity in the stream.
225        ///  This typically occurs after a seek or a dropped buffer
226        ///  from a live or network source.
227        #[doc(alias = "GST_BUFFER_FLAG_DISCONT")]
228        const DISCONT = ffi::GST_BUFFER_FLAG_DISCONT as _;
229        /// the buffer timestamps might have a discontinuity
230        ///  and this buffer is a good point to resynchronize.
231        #[doc(alias = "GST_BUFFER_FLAG_RESYNC")]
232        const RESYNC = ffi::GST_BUFFER_FLAG_RESYNC as _;
233        /// the buffer data is corrupted.
234        #[doc(alias = "GST_BUFFER_FLAG_CORRUPTED")]
235        const CORRUPTED = ffi::GST_BUFFER_FLAG_CORRUPTED as _;
236        /// the buffer contains a media specific marker. for
237        ///  video this is the end of a frame boundary, for audio
238        ///  this is the start of a talkspurt. for RTP
239        ///  packets this matches the marker flag in the
240        ///  RTP packet header.
241        #[doc(alias = "GST_BUFFER_FLAG_MARKER")]
242        const MARKER = ffi::GST_BUFFER_FLAG_MARKER as _;
243        /// the buffer contains header information that is
244        ///  needed to decode the following data.
245        #[doc(alias = "GST_BUFFER_FLAG_HEADER")]
246        const HEADER = ffi::GST_BUFFER_FLAG_HEADER as _;
247        /// the buffer has been created to fill a gap in the
248        ///  stream and contains media neutral data (elements can
249        ///  switch to optimized code path that ignores the buffer
250        ///  content).
251        #[doc(alias = "GST_BUFFER_FLAG_GAP")]
252        const GAP = ffi::GST_BUFFER_FLAG_GAP as _;
253        /// the buffer can be dropped without breaking the
254        ///  stream, for example to reduce bandwidth.
255        #[doc(alias = "GST_BUFFER_FLAG_DROPPABLE")]
256        const DROPPABLE = ffi::GST_BUFFER_FLAG_DROPPABLE as _;
257        /// this unit cannot be decoded independently.
258        #[doc(alias = "GST_BUFFER_FLAG_DELTA_UNIT")]
259        const DELTA_UNIT = ffi::GST_BUFFER_FLAG_DELTA_UNIT as _;
260        /// this flag is set when memory of the buffer
261        ///  is added/removed
262        #[doc(alias = "GST_BUFFER_FLAG_TAG_MEMORY")]
263        const TAG_MEMORY = ffi::GST_BUFFER_FLAG_TAG_MEMORY as _;
264        /// Elements which write to disk or permanent storage should ensure the data
265        /// is synced after writing the contents of this buffer.
266        #[doc(alias = "GST_BUFFER_FLAG_SYNC_AFTER")]
267        const SYNC_AFTER = ffi::GST_BUFFER_FLAG_SYNC_AFTER as _;
268        /// This buffer is important and should not be dropped.
269        ///
270        /// This can be used to mark important buffers, e.g. to flag RTP packets
271        /// carrying keyframes or codec setup data for RTP Forward Error Correction
272        /// purposes, or to prevent still video frames from being dropped by elements
273        /// due to QoS.
274        #[doc(alias = "GST_BUFFER_FLAG_NON_DROPPABLE")]
275        const NON_DROPPABLE = ffi::GST_BUFFER_FLAG_NON_DROPPABLE as _;
276    }
277}
278
279#[doc(hidden)]
280impl IntoGlib for BufferFlags {
281    type GlibType = ffi::GstBufferFlags;
282
283    #[inline]
284    fn into_glib(self) -> ffi::GstBufferFlags {
285        self.bits()
286    }
287}
288
289#[doc(hidden)]
290impl FromGlib<ffi::GstBufferFlags> for BufferFlags {
291    #[inline]
292    unsafe fn from_glib(value: ffi::GstBufferFlags) -> Self {
293        skip_assert_initialized!();
294        Self::from_bits_truncate(value)
295    }
296}
297
298impl StaticType for BufferFlags {
299    #[inline]
300    #[doc(alias = "gst_buffer_flags_get_type")]
301    fn static_type() -> glib::Type {
302        unsafe { from_glib(ffi::gst_buffer_flags_get_type()) }
303    }
304}
305
306impl glib::HasParamSpec for BufferFlags {
307    type ParamSpec = glib::ParamSpecFlags;
308    type SetValue = Self;
309    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
310
311    fn param_spec_builder() -> Self::BuilderFn {
312        Self::ParamSpec::builder
313    }
314}
315
316impl glib::value::ValueType for BufferFlags {
317    type Type = Self;
318}
319
320unsafe impl<'a> glib::value::FromValue<'a> for BufferFlags {
321    type Checker = glib::value::GenericValueTypeChecker<Self>;
322
323    #[inline]
324    unsafe fn from_value(value: &'a glib::Value) -> Self {
325        skip_assert_initialized!();
326        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
327    }
328}
329
330impl ToValue for BufferFlags {
331    #[inline]
332    fn to_value(&self) -> glib::Value {
333        let mut value = glib::Value::for_value_type::<Self>();
334        unsafe {
335            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
336        }
337        value
338    }
339
340    #[inline]
341    fn value_type(&self) -> glib::Type {
342        Self::static_type()
343    }
344}
345
346impl From<BufferFlags> for glib::Value {
347    #[inline]
348    fn from(v: BufferFlags) -> Self {
349        skip_assert_initialized!();
350        ToValue::to_value(&v)
351    }
352}
353
354bitflags! {
355    /// Additional flags to control the allocation of a buffer
356    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
357    #[doc(alias = "GstBufferPoolAcquireFlags")]
358    pub struct BufferPoolAcquireFlags: u32 {
359        /// buffer is keyframe
360        #[doc(alias = "GST_BUFFER_POOL_ACQUIRE_FLAG_KEY_UNIT")]
361        const KEY_UNIT = ffi::GST_BUFFER_POOL_ACQUIRE_FLAG_KEY_UNIT as _;
362        /// when the bufferpool is empty, acquire_buffer
363        /// will by default block until a buffer is released into the pool again. Setting
364        /// this flag makes acquire_buffer return [`FlowReturn::Eos`][crate::FlowReturn::Eos] instead of blocking.
365        #[doc(alias = "GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT")]
366        const DONTWAIT = ffi::GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT as _;
367        /// buffer is discont
368        #[doc(alias = "GST_BUFFER_POOL_ACQUIRE_FLAG_DISCONT")]
369        const DISCONT = ffi::GST_BUFFER_POOL_ACQUIRE_FLAG_DISCONT as _;
370    }
371}
372
373#[doc(hidden)]
374impl IntoGlib for BufferPoolAcquireFlags {
375    type GlibType = ffi::GstBufferPoolAcquireFlags;
376
377    #[inline]
378    fn into_glib(self) -> ffi::GstBufferPoolAcquireFlags {
379        self.bits()
380    }
381}
382
383#[doc(hidden)]
384impl FromGlib<ffi::GstBufferPoolAcquireFlags> for BufferPoolAcquireFlags {
385    #[inline]
386    unsafe fn from_glib(value: ffi::GstBufferPoolAcquireFlags) -> Self {
387        skip_assert_initialized!();
388        Self::from_bits_truncate(value)
389    }
390}
391
392impl StaticType for BufferPoolAcquireFlags {
393    #[inline]
394    #[doc(alias = "gst_buffer_pool_acquire_flags_get_type")]
395    fn static_type() -> glib::Type {
396        unsafe { from_glib(ffi::gst_buffer_pool_acquire_flags_get_type()) }
397    }
398}
399
400impl glib::HasParamSpec for BufferPoolAcquireFlags {
401    type ParamSpec = glib::ParamSpecFlags;
402    type SetValue = Self;
403    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
404
405    fn param_spec_builder() -> Self::BuilderFn {
406        Self::ParamSpec::builder
407    }
408}
409
410impl glib::value::ValueType for BufferPoolAcquireFlags {
411    type Type = Self;
412}
413
414unsafe impl<'a> glib::value::FromValue<'a> for BufferPoolAcquireFlags {
415    type Checker = glib::value::GenericValueTypeChecker<Self>;
416
417    #[inline]
418    unsafe fn from_value(value: &'a glib::Value) -> Self {
419        skip_assert_initialized!();
420        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
421    }
422}
423
424impl ToValue for BufferPoolAcquireFlags {
425    #[inline]
426    fn to_value(&self) -> glib::Value {
427        let mut value = glib::Value::for_value_type::<Self>();
428        unsafe {
429            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
430        }
431        value
432    }
433
434    #[inline]
435    fn value_type(&self) -> glib::Type {
436        Self::static_type()
437    }
438}
439
440impl From<BufferPoolAcquireFlags> for glib::Value {
441    #[inline]
442    fn from(v: BufferPoolAcquireFlags) -> Self {
443        skip_assert_initialized!();
444        ToValue::to_value(&v)
445    }
446}
447
448bitflags! {
449    /// The capabilities of this clock
450    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
451    #[doc(alias = "GstClockFlags")]
452    pub struct ClockFlags: u32 {
453        /// clock can do a single sync timeout request
454        #[doc(alias = "GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC")]
455        const CAN_DO_SINGLE_SYNC = ffi::GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC as _;
456        /// clock can do a single async timeout request
457        #[doc(alias = "GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC")]
458        const CAN_DO_SINGLE_ASYNC = ffi::GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC as _;
459        /// clock can do sync periodic timeout requests
460        #[doc(alias = "GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC")]
461        const CAN_DO_PERIODIC_SYNC = ffi::GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC as _;
462        /// clock can do async periodic timeout callbacks
463        #[doc(alias = "GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC")]
464        const CAN_DO_PERIODIC_ASYNC = ffi::GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC as _;
465        /// clock's resolution can be changed
466        #[doc(alias = "GST_CLOCK_FLAG_CAN_SET_RESOLUTION")]
467        const CAN_SET_RESOLUTION = ffi::GST_CLOCK_FLAG_CAN_SET_RESOLUTION as _;
468        /// clock can be slaved to a master clock
469        #[doc(alias = "GST_CLOCK_FLAG_CAN_SET_MASTER")]
470        const CAN_SET_MASTER = ffi::GST_CLOCK_FLAG_CAN_SET_MASTER as _;
471        /// clock needs to be synced before it can be used
472        #[doc(alias = "GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC")]
473        const NEEDS_STARTUP_SYNC = ffi::GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC as _;
474    }
475}
476
477#[doc(hidden)]
478impl IntoGlib for ClockFlags {
479    type GlibType = ffi::GstClockFlags;
480
481    #[inline]
482    fn into_glib(self) -> ffi::GstClockFlags {
483        self.bits()
484    }
485}
486
487#[doc(hidden)]
488impl FromGlib<ffi::GstClockFlags> for ClockFlags {
489    #[inline]
490    unsafe fn from_glib(value: ffi::GstClockFlags) -> Self {
491        skip_assert_initialized!();
492        Self::from_bits_truncate(value)
493    }
494}
495
496impl StaticType for ClockFlags {
497    #[inline]
498    #[doc(alias = "gst_clock_flags_get_type")]
499    fn static_type() -> glib::Type {
500        unsafe { from_glib(ffi::gst_clock_flags_get_type()) }
501    }
502}
503
504impl glib::HasParamSpec for ClockFlags {
505    type ParamSpec = glib::ParamSpecFlags;
506    type SetValue = Self;
507    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
508
509    fn param_spec_builder() -> Self::BuilderFn {
510        Self::ParamSpec::builder
511    }
512}
513
514impl glib::value::ValueType for ClockFlags {
515    type Type = Self;
516}
517
518unsafe impl<'a> glib::value::FromValue<'a> for ClockFlags {
519    type Checker = glib::value::GenericValueTypeChecker<Self>;
520
521    #[inline]
522    unsafe fn from_value(value: &'a glib::Value) -> Self {
523        skip_assert_initialized!();
524        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
525    }
526}
527
528impl ToValue for ClockFlags {
529    #[inline]
530    fn to_value(&self) -> glib::Value {
531        let mut value = glib::Value::for_value_type::<Self>();
532        unsafe {
533            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
534        }
535        value
536    }
537
538    #[inline]
539    fn value_type(&self) -> glib::Type {
540        Self::static_type()
541    }
542}
543
544impl From<ClockFlags> for glib::Value {
545    #[inline]
546    fn from(v: ClockFlags) -> Self {
547        skip_assert_initialized!();
548        ToValue::to_value(&v)
549    }
550}
551
552bitflags! {
553    /// These are some terminal style flags you can use when creating your
554    /// debugging categories to make them stand out in debugging output.
555    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
556    #[doc(alias = "GstDebugColorFlags")]
557    pub struct DebugColorFlags: u32 {
558        /// Use black as foreground color.
559        #[doc(alias = "GST_DEBUG_FG_BLACK")]
560        const FG_BLACK = ffi::GST_DEBUG_FG_BLACK as _;
561        /// Use red as foreground color.
562        #[doc(alias = "GST_DEBUG_FG_RED")]
563        const FG_RED = ffi::GST_DEBUG_FG_RED as _;
564        /// Use green as foreground color.
565        #[doc(alias = "GST_DEBUG_FG_GREEN")]
566        const FG_GREEN = ffi::GST_DEBUG_FG_GREEN as _;
567        /// Use yellow as foreground color.
568        #[doc(alias = "GST_DEBUG_FG_YELLOW")]
569        const FG_YELLOW = ffi::GST_DEBUG_FG_YELLOW as _;
570        /// Use blue as foreground color.
571        #[doc(alias = "GST_DEBUG_FG_BLUE")]
572        const FG_BLUE = ffi::GST_DEBUG_FG_BLUE as _;
573        /// Use magenta as foreground color.
574        #[doc(alias = "GST_DEBUG_FG_MAGENTA")]
575        const FG_MAGENTA = ffi::GST_DEBUG_FG_MAGENTA as _;
576        /// Use cyan as foreground color.
577        #[doc(alias = "GST_DEBUG_FG_CYAN")]
578        const FG_CYAN = ffi::GST_DEBUG_FG_CYAN as _;
579        /// Use white as foreground color.
580        #[doc(alias = "GST_DEBUG_FG_WHITE")]
581        const FG_WHITE = ffi::GST_DEBUG_FG_WHITE as _;
582        /// Use black as background color.
583        #[doc(alias = "GST_DEBUG_BG_BLACK")]
584        const BG_BLACK = ffi::GST_DEBUG_BG_BLACK as _;
585        /// Use red as background color.
586        #[doc(alias = "GST_DEBUG_BG_RED")]
587        const BG_RED = ffi::GST_DEBUG_BG_RED as _;
588        /// Use green as background color.
589        #[doc(alias = "GST_DEBUG_BG_GREEN")]
590        const BG_GREEN = ffi::GST_DEBUG_BG_GREEN as _;
591        /// Use yellow as background color.
592        #[doc(alias = "GST_DEBUG_BG_YELLOW")]
593        const BG_YELLOW = ffi::GST_DEBUG_BG_YELLOW as _;
594        /// Use blue as background color.
595        #[doc(alias = "GST_DEBUG_BG_BLUE")]
596        const BG_BLUE = ffi::GST_DEBUG_BG_BLUE as _;
597        /// Use magenta as background color.
598        #[doc(alias = "GST_DEBUG_BG_MAGENTA")]
599        const BG_MAGENTA = ffi::GST_DEBUG_BG_MAGENTA as _;
600        /// Use cyan as background color.
601        #[doc(alias = "GST_DEBUG_BG_CYAN")]
602        const BG_CYAN = ffi::GST_DEBUG_BG_CYAN as _;
603        /// Use white as background color.
604        #[doc(alias = "GST_DEBUG_BG_WHITE")]
605        const BG_WHITE = ffi::GST_DEBUG_BG_WHITE as _;
606        /// Make the output bold.
607        #[doc(alias = "GST_DEBUG_BOLD")]
608        const BOLD = ffi::GST_DEBUG_BOLD as _;
609        /// Underline the output.
610        #[doc(alias = "GST_DEBUG_UNDERLINE")]
611        const UNDERLINE = ffi::GST_DEBUG_UNDERLINE as _;
612    }
613}
614
615#[doc(hidden)]
616impl IntoGlib for DebugColorFlags {
617    type GlibType = ffi::GstDebugColorFlags;
618
619    #[inline]
620    fn into_glib(self) -> ffi::GstDebugColorFlags {
621        self.bits()
622    }
623}
624
625#[doc(hidden)]
626impl FromGlib<ffi::GstDebugColorFlags> for DebugColorFlags {
627    #[inline]
628    unsafe fn from_glib(value: ffi::GstDebugColorFlags) -> Self {
629        skip_assert_initialized!();
630        Self::from_bits_truncate(value)
631    }
632}
633
634impl StaticType for DebugColorFlags {
635    #[inline]
636    #[doc(alias = "gst_debug_color_flags_get_type")]
637    fn static_type() -> glib::Type {
638        unsafe { from_glib(ffi::gst_debug_color_flags_get_type()) }
639    }
640}
641
642impl glib::HasParamSpec for DebugColorFlags {
643    type ParamSpec = glib::ParamSpecFlags;
644    type SetValue = Self;
645    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
646
647    fn param_spec_builder() -> Self::BuilderFn {
648        Self::ParamSpec::builder
649    }
650}
651
652impl glib::value::ValueType for DebugColorFlags {
653    type Type = Self;
654}
655
656unsafe impl<'a> glib::value::FromValue<'a> for DebugColorFlags {
657    type Checker = glib::value::GenericValueTypeChecker<Self>;
658
659    #[inline]
660    unsafe fn from_value(value: &'a glib::Value) -> Self {
661        skip_assert_initialized!();
662        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
663    }
664}
665
666impl ToValue for DebugColorFlags {
667    #[inline]
668    fn to_value(&self) -> glib::Value {
669        let mut value = glib::Value::for_value_type::<Self>();
670        unsafe {
671            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
672        }
673        value
674    }
675
676    #[inline]
677    fn value_type(&self) -> glib::Type {
678        Self::static_type()
679    }
680}
681
682impl From<DebugColorFlags> for glib::Value {
683    #[inline]
684    fn from(v: DebugColorFlags) -> Self {
685        skip_assert_initialized!();
686        ToValue::to_value(&v)
687    }
688}
689
690bitflags! {
691    /// Available details for pipeline graphs produced by GST_DEBUG_BIN_TO_DOT_FILE()
692    /// and GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS().
693    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
694    #[doc(alias = "GstDebugGraphDetails")]
695    pub struct DebugGraphDetails: u32 {
696        /// show caps-name on edges
697        #[doc(alias = "GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE")]
698        const MEDIA_TYPE = ffi::GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE as _;
699        /// show caps-details on edges
700        #[doc(alias = "GST_DEBUG_GRAPH_SHOW_CAPS_DETAILS")]
701        const CAPS_DETAILS = ffi::GST_DEBUG_GRAPH_SHOW_CAPS_DETAILS as _;
702        /// show modified parameters on
703        ///  elements
704        #[doc(alias = "GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS")]
705        const NON_DEFAULT_PARAMS = ffi::GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS as _;
706        /// show element states
707        #[doc(alias = "GST_DEBUG_GRAPH_SHOW_STATES")]
708        const STATES = ffi::GST_DEBUG_GRAPH_SHOW_STATES as _;
709        /// show full element parameter values even
710        ///  if they are very long
711        #[doc(alias = "GST_DEBUG_GRAPH_SHOW_FULL_PARAMS")]
712        const FULL_PARAMS = ffi::GST_DEBUG_GRAPH_SHOW_FULL_PARAMS as _;
713        /// show all the typical details that one might want
714        #[doc(alias = "GST_DEBUG_GRAPH_SHOW_ALL")]
715        const ALL = ffi::GST_DEBUG_GRAPH_SHOW_ALL as _;
716        /// show all details regardless of how large or
717        ///  verbose they make the resulting output
718        #[doc(alias = "GST_DEBUG_GRAPH_SHOW_VERBOSE")]
719        const VERBOSE = ffi::GST_DEBUG_GRAPH_SHOW_VERBOSE as _;
720    }
721}
722
723#[doc(hidden)]
724impl IntoGlib for DebugGraphDetails {
725    type GlibType = ffi::GstDebugGraphDetails;
726
727    #[inline]
728    fn into_glib(self) -> ffi::GstDebugGraphDetails {
729        self.bits()
730    }
731}
732
733#[doc(hidden)]
734impl FromGlib<ffi::GstDebugGraphDetails> for DebugGraphDetails {
735    #[inline]
736    unsafe fn from_glib(value: ffi::GstDebugGraphDetails) -> Self {
737        skip_assert_initialized!();
738        Self::from_bits_truncate(value)
739    }
740}
741
742impl StaticType for DebugGraphDetails {
743    #[inline]
744    #[doc(alias = "gst_debug_graph_details_get_type")]
745    fn static_type() -> glib::Type {
746        unsafe { from_glib(ffi::gst_debug_graph_details_get_type()) }
747    }
748}
749
750impl glib::HasParamSpec for DebugGraphDetails {
751    type ParamSpec = glib::ParamSpecFlags;
752    type SetValue = Self;
753    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
754
755    fn param_spec_builder() -> Self::BuilderFn {
756        Self::ParamSpec::builder
757    }
758}
759
760impl glib::value::ValueType for DebugGraphDetails {
761    type Type = Self;
762}
763
764unsafe impl<'a> glib::value::FromValue<'a> for DebugGraphDetails {
765    type Checker = glib::value::GenericValueTypeChecker<Self>;
766
767    #[inline]
768    unsafe fn from_value(value: &'a glib::Value) -> Self {
769        skip_assert_initialized!();
770        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
771    }
772}
773
774impl ToValue for DebugGraphDetails {
775    #[inline]
776    fn to_value(&self) -> glib::Value {
777        let mut value = glib::Value::for_value_type::<Self>();
778        unsafe {
779            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
780        }
781        value
782    }
783
784    #[inline]
785    fn value_type(&self) -> glib::Type {
786        Self::static_type()
787    }
788}
789
790impl From<DebugGraphDetails> for glib::Value {
791    #[inline]
792    fn from(v: DebugGraphDetails) -> Self {
793        skip_assert_initialized!();
794        ToValue::to_value(&v)
795    }
796}
797
798bitflags! {
799    /// The standard flags that an element may have.
800    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
801    #[doc(alias = "GstElementFlags")]
802    pub struct ElementFlags: u32 {
803        /// ignore state changes from parent
804        #[doc(alias = "GST_ELEMENT_FLAG_LOCKED_STATE")]
805        const LOCKED_STATE = ffi::GST_ELEMENT_FLAG_LOCKED_STATE as _;
806        /// the element is a sink
807        #[doc(alias = "GST_ELEMENT_FLAG_SINK")]
808        const SINK = ffi::GST_ELEMENT_FLAG_SINK as _;
809        /// the element is a source.
810        #[doc(alias = "GST_ELEMENT_FLAG_SOURCE")]
811        const SOURCE = ffi::GST_ELEMENT_FLAG_SOURCE as _;
812        /// the element can provide a clock
813        #[doc(alias = "GST_ELEMENT_FLAG_PROVIDE_CLOCK")]
814        const PROVIDE_CLOCK = ffi::GST_ELEMENT_FLAG_PROVIDE_CLOCK as _;
815        /// the element requires a clock
816        #[doc(alias = "GST_ELEMENT_FLAG_REQUIRE_CLOCK")]
817        const REQUIRE_CLOCK = ffi::GST_ELEMENT_FLAG_REQUIRE_CLOCK as _;
818        /// the element can use an index
819        #[doc(alias = "GST_ELEMENT_FLAG_INDEXABLE")]
820        const INDEXABLE = ffi::GST_ELEMENT_FLAG_INDEXABLE as _;
821    }
822}
823
824#[doc(hidden)]
825impl IntoGlib for ElementFlags {
826    type GlibType = ffi::GstElementFlags;
827
828    #[inline]
829    fn into_glib(self) -> ffi::GstElementFlags {
830        self.bits()
831    }
832}
833
834#[doc(hidden)]
835impl FromGlib<ffi::GstElementFlags> for ElementFlags {
836    #[inline]
837    unsafe fn from_glib(value: ffi::GstElementFlags) -> Self {
838        skip_assert_initialized!();
839        Self::from_bits_truncate(value)
840    }
841}
842
843impl StaticType for ElementFlags {
844    #[inline]
845    #[doc(alias = "gst_element_flags_get_type")]
846    fn static_type() -> glib::Type {
847        unsafe { from_glib(ffi::gst_element_flags_get_type()) }
848    }
849}
850
851impl glib::HasParamSpec for ElementFlags {
852    type ParamSpec = glib::ParamSpecFlags;
853    type SetValue = Self;
854    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
855
856    fn param_spec_builder() -> Self::BuilderFn {
857        Self::ParamSpec::builder
858    }
859}
860
861impl glib::value::ValueType for ElementFlags {
862    type Type = Self;
863}
864
865unsafe impl<'a> glib::value::FromValue<'a> for ElementFlags {
866    type Checker = glib::value::GenericValueTypeChecker<Self>;
867
868    #[inline]
869    unsafe fn from_value(value: &'a glib::Value) -> Self {
870        skip_assert_initialized!();
871        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
872    }
873}
874
875impl ToValue for ElementFlags {
876    #[inline]
877    fn to_value(&self) -> glib::Value {
878        let mut value = glib::Value::for_value_type::<Self>();
879        unsafe {
880            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
881        }
882        value
883    }
884
885    #[inline]
886    fn value_type(&self) -> glib::Type {
887        Self::static_type()
888    }
889}
890
891impl From<ElementFlags> for glib::Value {
892    #[inline]
893    fn from(v: ElementFlags) -> Self {
894        skip_assert_initialized!();
895        ToValue::to_value(&v)
896    }
897}
898
899bitflags! {
900    /// [`EventTypeFlags`][crate::EventTypeFlags] indicate the aspects of the different [`EventType`][crate::EventType]
901    /// values. You can get the type flags of a [`EventType`][crate::EventType] with the
902    /// [`EventType::flags()`][crate::EventType::flags()] function.
903    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
904    #[doc(alias = "GstEventTypeFlags")]
905    pub struct EventTypeFlags: u32 {
906        /// Set if the event can travel upstream.
907        #[doc(alias = "GST_EVENT_TYPE_UPSTREAM")]
908        const UPSTREAM = ffi::GST_EVENT_TYPE_UPSTREAM as _;
909        /// Set if the event can travel downstream.
910        #[doc(alias = "GST_EVENT_TYPE_DOWNSTREAM")]
911        const DOWNSTREAM = ffi::GST_EVENT_TYPE_DOWNSTREAM as _;
912        /// Set if the event should be serialized with data
913        ///  flow.
914        #[doc(alias = "GST_EVENT_TYPE_SERIALIZED")]
915        const SERIALIZED = ffi::GST_EVENT_TYPE_SERIALIZED as _;
916        /// Set if the event is sticky on the pads.
917        #[doc(alias = "GST_EVENT_TYPE_STICKY")]
918        const STICKY = ffi::GST_EVENT_TYPE_STICKY as _;
919        /// Multiple sticky events can be on a pad, each
920        ///  identified by the event name.
921        #[doc(alias = "GST_EVENT_TYPE_STICKY_MULTI")]
922        const STICKY_MULTI = ffi::GST_EVENT_TYPE_STICKY_MULTI as _;
923    }
924}
925
926#[doc(hidden)]
927impl IntoGlib for EventTypeFlags {
928    type GlibType = ffi::GstEventTypeFlags;
929
930    #[inline]
931    fn into_glib(self) -> ffi::GstEventTypeFlags {
932        self.bits()
933    }
934}
935
936#[doc(hidden)]
937impl FromGlib<ffi::GstEventTypeFlags> for EventTypeFlags {
938    #[inline]
939    unsafe fn from_glib(value: ffi::GstEventTypeFlags) -> Self {
940        skip_assert_initialized!();
941        Self::from_bits_truncate(value)
942    }
943}
944
945impl StaticType for EventTypeFlags {
946    #[inline]
947    #[doc(alias = "gst_event_type_flags_get_type")]
948    fn static_type() -> glib::Type {
949        unsafe { from_glib(ffi::gst_event_type_flags_get_type()) }
950    }
951}
952
953impl glib::HasParamSpec for EventTypeFlags {
954    type ParamSpec = glib::ParamSpecFlags;
955    type SetValue = Self;
956    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
957
958    fn param_spec_builder() -> Self::BuilderFn {
959        Self::ParamSpec::builder
960    }
961}
962
963impl glib::value::ValueType for EventTypeFlags {
964    type Type = Self;
965}
966
967unsafe impl<'a> glib::value::FromValue<'a> for EventTypeFlags {
968    type Checker = glib::value::GenericValueTypeChecker<Self>;
969
970    #[inline]
971    unsafe fn from_value(value: &'a glib::Value) -> Self {
972        skip_assert_initialized!();
973        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
974    }
975}
976
977impl ToValue for EventTypeFlags {
978    #[inline]
979    fn to_value(&self) -> glib::Value {
980        let mut value = glib::Value::for_value_type::<Self>();
981        unsafe {
982            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
983        }
984        value
985    }
986
987    #[inline]
988    fn value_type(&self) -> glib::Type {
989        Self::static_type()
990    }
991}
992
993impl From<EventTypeFlags> for glib::Value {
994    #[inline]
995    fn from(v: EventTypeFlags) -> Self {
996        skip_assert_initialized!();
997        ToValue::to_value(&v)
998    }
999}
1000
1001#[cfg(feature = "v1_20")]
1002bitflags! {
1003    /// The different flags that can be set on [`EventType::Gap`][crate::EventType::Gap] events. See
1004    /// [`Event::set_gap_flags()`][crate::Event::set_gap_flags()] for details.
1005    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1006    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1007    #[doc(alias = "GstGapFlags")]
1008    pub struct GapFlags: u32 {
1009        /// The [`EventType::Gap`][crate::EventType::Gap] signals missing data,
1010        ///  for example because of packet loss.
1011        #[doc(alias = "GST_GAP_FLAG_MISSING_DATA")]
1012        const DATA = ffi::GST_GAP_FLAG_MISSING_DATA as _;
1013    }
1014}
1015
1016#[cfg(feature = "v1_20")]
1017#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1018#[doc(hidden)]
1019impl IntoGlib for GapFlags {
1020    type GlibType = ffi::GstGapFlags;
1021
1022    #[inline]
1023    fn into_glib(self) -> ffi::GstGapFlags {
1024        self.bits()
1025    }
1026}
1027
1028#[cfg(feature = "v1_20")]
1029#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1030#[doc(hidden)]
1031impl FromGlib<ffi::GstGapFlags> for GapFlags {
1032    #[inline]
1033    unsafe fn from_glib(value: ffi::GstGapFlags) -> Self {
1034        skip_assert_initialized!();
1035        Self::from_bits_truncate(value)
1036    }
1037}
1038
1039#[cfg(feature = "v1_20")]
1040#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1041impl StaticType for GapFlags {
1042    #[inline]
1043    #[doc(alias = "gst_gap_flags_get_type")]
1044    fn static_type() -> glib::Type {
1045        unsafe { from_glib(ffi::gst_gap_flags_get_type()) }
1046    }
1047}
1048
1049#[cfg(feature = "v1_20")]
1050#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1051impl glib::HasParamSpec for GapFlags {
1052    type ParamSpec = glib::ParamSpecFlags;
1053    type SetValue = Self;
1054    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1055
1056    fn param_spec_builder() -> Self::BuilderFn {
1057        Self::ParamSpec::builder
1058    }
1059}
1060
1061#[cfg(feature = "v1_20")]
1062#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1063impl glib::value::ValueType for GapFlags {
1064    type Type = Self;
1065}
1066
1067#[cfg(feature = "v1_20")]
1068#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1069unsafe impl<'a> glib::value::FromValue<'a> for GapFlags {
1070    type Checker = glib::value::GenericValueTypeChecker<Self>;
1071
1072    #[inline]
1073    unsafe fn from_value(value: &'a glib::Value) -> Self {
1074        skip_assert_initialized!();
1075        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1076    }
1077}
1078
1079#[cfg(feature = "v1_20")]
1080#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1081impl ToValue for GapFlags {
1082    #[inline]
1083    fn to_value(&self) -> glib::Value {
1084        let mut value = glib::Value::for_value_type::<Self>();
1085        unsafe {
1086            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1087        }
1088        value
1089    }
1090
1091    #[inline]
1092    fn value_type(&self) -> glib::Type {
1093        Self::static_type()
1094    }
1095}
1096
1097#[cfg(feature = "v1_20")]
1098#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1099impl From<GapFlags> for glib::Value {
1100    #[inline]
1101    fn from(v: GapFlags) -> Self {
1102        skip_assert_initialized!();
1103        ToValue::to_value(&v)
1104    }
1105}
1106
1107bitflags! {
1108    /// Flags for wrapped memory.
1109    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1110    #[doc(alias = "GstMemoryFlags")]
1111    pub struct MemoryFlags: u32 {
1112        /// memory is readonly. It is not allowed to map the
1113        /// memory with `GST_MAP_WRITE`.
1114        #[doc(alias = "GST_MEMORY_FLAG_READONLY")]
1115        const READONLY = ffi::GST_MEMORY_FLAG_READONLY as _;
1116        /// memory must not be shared. Copies will have to be
1117        /// made when this memory needs to be shared between buffers. (DEPRECATED:
1118        /// do not use in new code, instead you should create a custom GstAllocator for
1119        /// memory pooling instead of relying on the GstBuffer they were originally
1120        /// attached to.)
1121        #[doc(alias = "GST_MEMORY_FLAG_NO_SHARE")]
1122        const NO_SHARE = ffi::GST_MEMORY_FLAG_NO_SHARE as _;
1123        /// the memory prefix is filled with 0 bytes
1124        #[doc(alias = "GST_MEMORY_FLAG_ZERO_PREFIXED")]
1125        const ZERO_PREFIXED = ffi::GST_MEMORY_FLAG_ZERO_PREFIXED as _;
1126        /// the memory padding is filled with 0 bytes
1127        #[doc(alias = "GST_MEMORY_FLAG_ZERO_PADDED")]
1128        const ZERO_PADDED = ffi::GST_MEMORY_FLAG_ZERO_PADDED as _;
1129        /// the memory is physically
1130        /// contiguous. (Since: 1.2)
1131        #[doc(alias = "GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS")]
1132        const PHYSICALLY_CONTIGUOUS = ffi::GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS as _;
1133        /// the memory can't be mapped via
1134        /// [`Memory::into_mapped_memory_readable()`][crate::Memory::into_mapped_memory_readable()] without any preconditions. (Since: 1.2)
1135        #[doc(alias = "GST_MEMORY_FLAG_NOT_MAPPABLE")]
1136        const NOT_MAPPABLE = ffi::GST_MEMORY_FLAG_NOT_MAPPABLE as _;
1137    }
1138}
1139
1140#[doc(hidden)]
1141impl IntoGlib for MemoryFlags {
1142    type GlibType = ffi::GstMemoryFlags;
1143
1144    #[inline]
1145    fn into_glib(self) -> ffi::GstMemoryFlags {
1146        self.bits()
1147    }
1148}
1149
1150#[doc(hidden)]
1151impl FromGlib<ffi::GstMemoryFlags> for MemoryFlags {
1152    #[inline]
1153    unsafe fn from_glib(value: ffi::GstMemoryFlags) -> Self {
1154        skip_assert_initialized!();
1155        Self::from_bits_truncate(value)
1156    }
1157}
1158
1159impl StaticType for MemoryFlags {
1160    #[inline]
1161    #[doc(alias = "gst_memory_flags_get_type")]
1162    fn static_type() -> glib::Type {
1163        unsafe { from_glib(ffi::gst_memory_flags_get_type()) }
1164    }
1165}
1166
1167impl glib::HasParamSpec for MemoryFlags {
1168    type ParamSpec = glib::ParamSpecFlags;
1169    type SetValue = Self;
1170    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1171
1172    fn param_spec_builder() -> Self::BuilderFn {
1173        Self::ParamSpec::builder
1174    }
1175}
1176
1177impl glib::value::ValueType for MemoryFlags {
1178    type Type = Self;
1179}
1180
1181unsafe impl<'a> glib::value::FromValue<'a> for MemoryFlags {
1182    type Checker = glib::value::GenericValueTypeChecker<Self>;
1183
1184    #[inline]
1185    unsafe fn from_value(value: &'a glib::Value) -> Self {
1186        skip_assert_initialized!();
1187        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1188    }
1189}
1190
1191impl ToValue for MemoryFlags {
1192    #[inline]
1193    fn to_value(&self) -> glib::Value {
1194        let mut value = glib::Value::for_value_type::<Self>();
1195        unsafe {
1196            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1197        }
1198        value
1199    }
1200
1201    #[inline]
1202    fn value_type(&self) -> glib::Type {
1203        Self::static_type()
1204    }
1205}
1206
1207impl From<MemoryFlags> for glib::Value {
1208    #[inline]
1209    fn from(v: MemoryFlags) -> Self {
1210        skip_assert_initialized!();
1211        ToValue::to_value(&v)
1212    }
1213}
1214
1215bitflags! {
1216    /// Extra metadata flags.
1217    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1218    #[doc(alias = "GstMetaFlags")]
1219    pub struct MetaFlags: u32 {
1220        /// metadata should not be modified
1221        #[doc(alias = "GST_META_FLAG_READONLY")]
1222        const READONLY = ffi::GST_META_FLAG_READONLY as _;
1223        /// metadata is managed by a bufferpool
1224        #[doc(alias = "GST_META_FLAG_POOLED")]
1225        const POOLED = ffi::GST_META_FLAG_POOLED as _;
1226        /// metadata should not be removed
1227        #[doc(alias = "GST_META_FLAG_LOCKED")]
1228        const LOCKED = ffi::GST_META_FLAG_LOCKED as _;
1229    }
1230}
1231
1232#[doc(hidden)]
1233impl IntoGlib for MetaFlags {
1234    type GlibType = ffi::GstMetaFlags;
1235
1236    #[inline]
1237    fn into_glib(self) -> ffi::GstMetaFlags {
1238        self.bits()
1239    }
1240}
1241
1242#[doc(hidden)]
1243impl FromGlib<ffi::GstMetaFlags> for MetaFlags {
1244    #[inline]
1245    unsafe fn from_glib(value: ffi::GstMetaFlags) -> Self {
1246        skip_assert_initialized!();
1247        Self::from_bits_truncate(value)
1248    }
1249}
1250
1251impl StaticType for MetaFlags {
1252    #[inline]
1253    #[doc(alias = "gst_meta_flags_get_type")]
1254    fn static_type() -> glib::Type {
1255        unsafe { from_glib(ffi::gst_meta_flags_get_type()) }
1256    }
1257}
1258
1259impl glib::HasParamSpec for MetaFlags {
1260    type ParamSpec = glib::ParamSpecFlags;
1261    type SetValue = Self;
1262    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1263
1264    fn param_spec_builder() -> Self::BuilderFn {
1265        Self::ParamSpec::builder
1266    }
1267}
1268
1269impl glib::value::ValueType for MetaFlags {
1270    type Type = Self;
1271}
1272
1273unsafe impl<'a> glib::value::FromValue<'a> for MetaFlags {
1274    type Checker = glib::value::GenericValueTypeChecker<Self>;
1275
1276    #[inline]
1277    unsafe fn from_value(value: &'a glib::Value) -> Self {
1278        skip_assert_initialized!();
1279        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1280    }
1281}
1282
1283impl ToValue for MetaFlags {
1284    #[inline]
1285    fn to_value(&self) -> glib::Value {
1286        let mut value = glib::Value::for_value_type::<Self>();
1287        unsafe {
1288            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1289        }
1290        value
1291    }
1292
1293    #[inline]
1294    fn value_type(&self) -> glib::Type {
1295        Self::static_type()
1296    }
1297}
1298
1299impl From<MetaFlags> for glib::Value {
1300    #[inline]
1301    fn from(v: MetaFlags) -> Self {
1302        skip_assert_initialized!();
1303        ToValue::to_value(&v)
1304    }
1305}
1306
1307bitflags! {
1308    /// The standard flags that an gstobject may have.
1309    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1310    #[doc(alias = "GstObjectFlags")]
1311    pub struct ObjectFlags: u32 {
1312        /// the object is expected to stay alive even
1313        /// after `gst_deinit()` has been called and so should be ignored by leak
1314        /// detection tools. (Since: 1.10)
1315        #[doc(alias = "GST_OBJECT_FLAG_MAY_BE_LEAKED")]
1316        const MAY_BE_LEAKED = ffi::GST_OBJECT_FLAG_MAY_BE_LEAKED as _;
1317        /// Flag that's set when the object has been constructed. This can be used by
1318        /// API such as base class setters to differentiate between the case where
1319        /// they're called from a subclass's instance init function (and where the
1320        /// object isn't fully constructed yet, and so one shouldn't do anything but
1321        /// set values in the instance structure), and the case where the object is
1322        /// constructed.
1323        #[cfg(feature = "v1_24")]
1324        #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1325        #[doc(alias = "GST_OBJECT_FLAG_CONSTRUCTED")]
1326        const CONSTRUCTED = ffi::GST_OBJECT_FLAG_CONSTRUCTED as _;
1327    }
1328}
1329
1330#[doc(hidden)]
1331impl IntoGlib for ObjectFlags {
1332    type GlibType = ffi::GstObjectFlags;
1333
1334    #[inline]
1335    fn into_glib(self) -> ffi::GstObjectFlags {
1336        self.bits()
1337    }
1338}
1339
1340#[doc(hidden)]
1341impl FromGlib<ffi::GstObjectFlags> for ObjectFlags {
1342    #[inline]
1343    unsafe fn from_glib(value: ffi::GstObjectFlags) -> Self {
1344        skip_assert_initialized!();
1345        Self::from_bits_truncate(value)
1346    }
1347}
1348
1349impl StaticType for ObjectFlags {
1350    #[inline]
1351    #[doc(alias = "gst_object_flags_get_type")]
1352    fn static_type() -> glib::Type {
1353        unsafe { from_glib(ffi::gst_object_flags_get_type()) }
1354    }
1355}
1356
1357impl glib::HasParamSpec for ObjectFlags {
1358    type ParamSpec = glib::ParamSpecFlags;
1359    type SetValue = Self;
1360    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1361
1362    fn param_spec_builder() -> Self::BuilderFn {
1363        Self::ParamSpec::builder
1364    }
1365}
1366
1367impl glib::value::ValueType for ObjectFlags {
1368    type Type = Self;
1369}
1370
1371unsafe impl<'a> glib::value::FromValue<'a> for ObjectFlags {
1372    type Checker = glib::value::GenericValueTypeChecker<Self>;
1373
1374    #[inline]
1375    unsafe fn from_value(value: &'a glib::Value) -> Self {
1376        skip_assert_initialized!();
1377        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1378    }
1379}
1380
1381impl ToValue for ObjectFlags {
1382    #[inline]
1383    fn to_value(&self) -> glib::Value {
1384        let mut value = glib::Value::for_value_type::<Self>();
1385        unsafe {
1386            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1387        }
1388        value
1389    }
1390
1391    #[inline]
1392    fn value_type(&self) -> glib::Type {
1393        Self::static_type()
1394    }
1395}
1396
1397impl From<ObjectFlags> for glib::Value {
1398    #[inline]
1399    fn from(v: ObjectFlags) -> Self {
1400        skip_assert_initialized!();
1401        ToValue::to_value(&v)
1402    }
1403}
1404
1405bitflags! {
1406    /// Pad state flags
1407    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1408    #[doc(alias = "GstPadFlags")]
1409    pub struct PadFlags: u32 {
1410        /// is dataflow on a pad blocked
1411        #[doc(alias = "GST_PAD_FLAG_BLOCKED")]
1412        const BLOCKED = ffi::GST_PAD_FLAG_BLOCKED as _;
1413        /// is pad flushing
1414        #[doc(alias = "GST_PAD_FLAG_FLUSHING")]
1415        const FLUSHING = ffi::GST_PAD_FLAG_FLUSHING as _;
1416        /// is pad in EOS state
1417        #[doc(alias = "GST_PAD_FLAG_EOS")]
1418        const EOS = ffi::GST_PAD_FLAG_EOS as _;
1419        /// is pad currently blocking on a buffer or event
1420        #[doc(alias = "GST_PAD_FLAG_BLOCKING")]
1421        const BLOCKING = ffi::GST_PAD_FLAG_BLOCKING as _;
1422        /// ensure that there is a parent object before calling
1423        ///  into the pad callbacks.
1424        #[doc(alias = "GST_PAD_FLAG_NEED_PARENT")]
1425        const NEED_PARENT = ffi::GST_PAD_FLAG_NEED_PARENT as _;
1426        /// the pad should be reconfigured/renegotiated.
1427        ///  The flag has to be unset manually after
1428        ///  reconfiguration happened.
1429        #[doc(alias = "GST_PAD_FLAG_NEED_RECONFIGURE")]
1430        const NEED_RECONFIGURE = ffi::GST_PAD_FLAG_NEED_RECONFIGURE as _;
1431        /// the pad has pending events
1432        #[doc(alias = "GST_PAD_FLAG_PENDING_EVENTS")]
1433        const PENDING_EVENTS = ffi::GST_PAD_FLAG_PENDING_EVENTS as _;
1434        /// the pad is using fixed caps. This means that
1435        ///  once the caps are set on the pad, the default caps query function
1436        ///  will only return those caps.
1437        #[doc(alias = "GST_PAD_FLAG_FIXED_CAPS")]
1438        const FIXED_CAPS = ffi::GST_PAD_FLAG_FIXED_CAPS as _;
1439        /// the default event and query handler will forward
1440        ///  all events and queries to the internally linked pads
1441        ///  instead of discarding them.
1442        #[doc(alias = "GST_PAD_FLAG_PROXY_CAPS")]
1443        const PROXY_CAPS = ffi::GST_PAD_FLAG_PROXY_CAPS as _;
1444        /// the default query handler will forward
1445        ///  allocation queries to the internally linked pads
1446        ///  instead of discarding them.
1447        #[doc(alias = "GST_PAD_FLAG_PROXY_ALLOCATION")]
1448        const PROXY_ALLOCATION = ffi::GST_PAD_FLAG_PROXY_ALLOCATION as _;
1449        /// the default query handler will forward
1450        ///  scheduling queries to the internally linked pads
1451        ///  instead of discarding them.
1452        #[doc(alias = "GST_PAD_FLAG_PROXY_SCHEDULING")]
1453        const PROXY_SCHEDULING = ffi::GST_PAD_FLAG_PROXY_SCHEDULING as _;
1454        /// the default accept-caps handler will check
1455        ///  it the caps intersect the query-caps result instead
1456        ///  of checking for a subset. This is interesting for
1457        ///  parsers that can accept incompletely specified caps.
1458        #[doc(alias = "GST_PAD_FLAG_ACCEPT_INTERSECT")]
1459        const ACCEPT_INTERSECT = ffi::GST_PAD_FLAG_ACCEPT_INTERSECT as _;
1460        /// the default accept-caps handler will use
1461        ///  the template pad caps instead of query caps to
1462        ///  compare with the accept caps. Use this in combination
1463        ///  with [`ACCEPT_INTERSECT`][Self::ACCEPT_INTERSECT]. (Since: 1.6)
1464        #[doc(alias = "GST_PAD_FLAG_ACCEPT_TEMPLATE")]
1465        const ACCEPT_TEMPLATE = ffi::GST_PAD_FLAG_ACCEPT_TEMPLATE as _;
1466    }
1467}
1468
1469#[doc(hidden)]
1470impl IntoGlib for PadFlags {
1471    type GlibType = ffi::GstPadFlags;
1472
1473    #[inline]
1474    fn into_glib(self) -> ffi::GstPadFlags {
1475        self.bits()
1476    }
1477}
1478
1479#[doc(hidden)]
1480impl FromGlib<ffi::GstPadFlags> for PadFlags {
1481    #[inline]
1482    unsafe fn from_glib(value: ffi::GstPadFlags) -> Self {
1483        skip_assert_initialized!();
1484        Self::from_bits_truncate(value)
1485    }
1486}
1487
1488impl StaticType for PadFlags {
1489    #[inline]
1490    #[doc(alias = "gst_pad_flags_get_type")]
1491    fn static_type() -> glib::Type {
1492        unsafe { from_glib(ffi::gst_pad_flags_get_type()) }
1493    }
1494}
1495
1496impl glib::HasParamSpec for PadFlags {
1497    type ParamSpec = glib::ParamSpecFlags;
1498    type SetValue = Self;
1499    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1500
1501    fn param_spec_builder() -> Self::BuilderFn {
1502        Self::ParamSpec::builder
1503    }
1504}
1505
1506impl glib::value::ValueType for PadFlags {
1507    type Type = Self;
1508}
1509
1510unsafe impl<'a> glib::value::FromValue<'a> for PadFlags {
1511    type Checker = glib::value::GenericValueTypeChecker<Self>;
1512
1513    #[inline]
1514    unsafe fn from_value(value: &'a glib::Value) -> Self {
1515        skip_assert_initialized!();
1516        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1517    }
1518}
1519
1520impl ToValue for PadFlags {
1521    #[inline]
1522    fn to_value(&self) -> glib::Value {
1523        let mut value = glib::Value::for_value_type::<Self>();
1524        unsafe {
1525            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1526        }
1527        value
1528    }
1529
1530    #[inline]
1531    fn value_type(&self) -> glib::Type {
1532        Self::static_type()
1533    }
1534}
1535
1536impl From<PadFlags> for glib::Value {
1537    #[inline]
1538    fn from(v: PadFlags) -> Self {
1539        skip_assert_initialized!();
1540        ToValue::to_value(&v)
1541    }
1542}
1543
1544bitflags! {
1545    /// The amount of checking to be done when linking pads. [`CAPS`][Self::CAPS]
1546    /// and [`TEMPLATE_CAPS`][Self::TEMPLATE_CAPS] are mutually exclusive. If both are
1547    /// specified, expensive but safe [`CAPS`][Self::CAPS] are performed.
1548    ///
1549    /// > Only disable some of the checks if you are 100% certain you know the link
1550    /// > will not fail because of hierarchy/caps compatibility failures. If uncertain,
1551    /// > use the default checks ([`DEFAULT`][Self::DEFAULT]) or the regular methods
1552    /// > for linking the pads.
1553    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1554    #[doc(alias = "GstPadLinkCheck")]
1555    pub struct PadLinkCheck: u32 {
1556        /// Check the pads have same parents/grandparents.
1557        ///  Could be omitted if it is already known that the two elements that own the
1558        ///  pads are in the same bin.
1559        #[doc(alias = "GST_PAD_LINK_CHECK_HIERARCHY")]
1560        const HIERARCHY = ffi::GST_PAD_LINK_CHECK_HIERARCHY as _;
1561        /// Check if the pads are compatible by using
1562        ///  their template caps. This is much faster than [`CAPS`][Self::CAPS], but
1563        ///  would be unsafe e.g. if one pad has `GST_CAPS_ANY`.
1564        #[doc(alias = "GST_PAD_LINK_CHECK_TEMPLATE_CAPS")]
1565        const TEMPLATE_CAPS = ffi::GST_PAD_LINK_CHECK_TEMPLATE_CAPS as _;
1566        /// Check if the pads are compatible by comparing the
1567        ///  caps returned by [`PadExt::query_caps()`][crate::prelude::PadExt::query_caps()].
1568        #[doc(alias = "GST_PAD_LINK_CHECK_CAPS")]
1569        const CAPS = ffi::GST_PAD_LINK_CHECK_CAPS as _;
1570        /// Disables pushing a reconfigure event when pads are
1571        ///  linked.
1572        #[doc(alias = "GST_PAD_LINK_CHECK_NO_RECONFIGURE")]
1573        const NO_RECONFIGURE = ffi::GST_PAD_LINK_CHECK_NO_RECONFIGURE as _;
1574        /// The default checks done when linking
1575        ///  pads (i.e. the ones used by [`PadExt::link()`][crate::prelude::PadExt::link()]).
1576        #[doc(alias = "GST_PAD_LINK_CHECK_DEFAULT")]
1577        const DEFAULT = ffi::GST_PAD_LINK_CHECK_DEFAULT as _;
1578    }
1579}
1580
1581#[doc(hidden)]
1582impl IntoGlib for PadLinkCheck {
1583    type GlibType = ffi::GstPadLinkCheck;
1584
1585    #[inline]
1586    fn into_glib(self) -> ffi::GstPadLinkCheck {
1587        self.bits()
1588    }
1589}
1590
1591#[doc(hidden)]
1592impl FromGlib<ffi::GstPadLinkCheck> for PadLinkCheck {
1593    #[inline]
1594    unsafe fn from_glib(value: ffi::GstPadLinkCheck) -> Self {
1595        skip_assert_initialized!();
1596        Self::from_bits_truncate(value)
1597    }
1598}
1599
1600impl StaticType for PadLinkCheck {
1601    #[inline]
1602    #[doc(alias = "gst_pad_link_check_get_type")]
1603    fn static_type() -> glib::Type {
1604        unsafe { from_glib(ffi::gst_pad_link_check_get_type()) }
1605    }
1606}
1607
1608impl glib::HasParamSpec for PadLinkCheck {
1609    type ParamSpec = glib::ParamSpecFlags;
1610    type SetValue = Self;
1611    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1612
1613    fn param_spec_builder() -> Self::BuilderFn {
1614        Self::ParamSpec::builder
1615    }
1616}
1617
1618impl glib::value::ValueType for PadLinkCheck {
1619    type Type = Self;
1620}
1621
1622unsafe impl<'a> glib::value::FromValue<'a> for PadLinkCheck {
1623    type Checker = glib::value::GenericValueTypeChecker<Self>;
1624
1625    #[inline]
1626    unsafe fn from_value(value: &'a glib::Value) -> Self {
1627        skip_assert_initialized!();
1628        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1629    }
1630}
1631
1632impl ToValue for PadLinkCheck {
1633    #[inline]
1634    fn to_value(&self) -> glib::Value {
1635        let mut value = glib::Value::for_value_type::<Self>();
1636        unsafe {
1637            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1638        }
1639        value
1640    }
1641
1642    #[inline]
1643    fn value_type(&self) -> glib::Type {
1644        Self::static_type()
1645    }
1646}
1647
1648impl From<PadLinkCheck> for glib::Value {
1649    #[inline]
1650    fn from(v: PadLinkCheck) -> Self {
1651        skip_assert_initialized!();
1652        ToValue::to_value(&v)
1653    }
1654}
1655
1656bitflags! {
1657    /// The different probing types that can occur. When either one of
1658    /// [`IDLE`][Self::IDLE] or [`BLOCK`][Self::BLOCK] is used, the probe will be a
1659    /// blocking probe.
1660    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1661    #[doc(alias = "GstPadProbeType")]
1662    pub struct PadProbeType: u32 {
1663        /// probe idle pads and block while the callback is called
1664        #[doc(alias = "GST_PAD_PROBE_TYPE_IDLE")]
1665        const IDLE = ffi::GST_PAD_PROBE_TYPE_IDLE as _;
1666        /// probe and block pads
1667        #[doc(alias = "GST_PAD_PROBE_TYPE_BLOCK")]
1668        const BLOCK = ffi::GST_PAD_PROBE_TYPE_BLOCK as _;
1669        /// probe buffers
1670        #[doc(alias = "GST_PAD_PROBE_TYPE_BUFFER")]
1671        const BUFFER = ffi::GST_PAD_PROBE_TYPE_BUFFER as _;
1672        /// probe buffer lists
1673        #[doc(alias = "GST_PAD_PROBE_TYPE_BUFFER_LIST")]
1674        const BUFFER_LIST = ffi::GST_PAD_PROBE_TYPE_BUFFER_LIST as _;
1675        /// probe downstream events
1676        #[doc(alias = "GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM")]
1677        const EVENT_DOWNSTREAM = ffi::GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM as _;
1678        /// probe upstream events
1679        #[doc(alias = "GST_PAD_PROBE_TYPE_EVENT_UPSTREAM")]
1680        const EVENT_UPSTREAM = ffi::GST_PAD_PROBE_TYPE_EVENT_UPSTREAM as _;
1681        /// probe flush events. This probe has to be
1682        ///  explicitly enabled and is not included in the
1683        ///  @[`EVENT_DOWNSTREAM`][Self::EVENT_DOWNSTREAM] or
1684        ///  @[`EVENT_UPSTREAM`][Self::EVENT_UPSTREAM] probe types.
1685        #[doc(alias = "GST_PAD_PROBE_TYPE_EVENT_FLUSH")]
1686        const EVENT_FLUSH = ffi::GST_PAD_PROBE_TYPE_EVENT_FLUSH as _;
1687        /// probe downstream queries
1688        #[doc(alias = "GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM")]
1689        const QUERY_DOWNSTREAM = ffi::GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM as _;
1690        /// probe upstream queries
1691        #[doc(alias = "GST_PAD_PROBE_TYPE_QUERY_UPSTREAM")]
1692        const QUERY_UPSTREAM = ffi::GST_PAD_PROBE_TYPE_QUERY_UPSTREAM as _;
1693        /// probe push
1694        #[doc(alias = "GST_PAD_PROBE_TYPE_PUSH")]
1695        const PUSH = ffi::GST_PAD_PROBE_TYPE_PUSH as _;
1696        /// probe pull
1697        #[doc(alias = "GST_PAD_PROBE_TYPE_PULL")]
1698        const PULL = ffi::GST_PAD_PROBE_TYPE_PULL as _;
1699        /// probe and block at the next opportunity, at data flow or when idle
1700        #[doc(alias = "GST_PAD_PROBE_TYPE_BLOCKING")]
1701        const BLOCKING = ffi::GST_PAD_PROBE_TYPE_BLOCKING as _;
1702        /// probe downstream data (buffers, buffer lists, and events)
1703        #[doc(alias = "GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM")]
1704        const DATA_DOWNSTREAM = ffi::GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM as _;
1705        /// probe upstream data (events)
1706        #[doc(alias = "GST_PAD_PROBE_TYPE_DATA_UPSTREAM")]
1707        const DATA_UPSTREAM = ffi::GST_PAD_PROBE_TYPE_DATA_UPSTREAM as _;
1708        /// probe upstream and downstream data (buffers, buffer lists, and events)
1709        #[doc(alias = "GST_PAD_PROBE_TYPE_DATA_BOTH")]
1710        const DATA_BOTH = ffi::GST_PAD_PROBE_TYPE_DATA_BOTH as _;
1711        /// probe and block downstream data (buffers, buffer lists, and events)
1712        #[doc(alias = "GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM")]
1713        const BLOCK_DOWNSTREAM = ffi::GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM as _;
1714        /// probe and block upstream data (events)
1715        #[doc(alias = "GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM")]
1716        const BLOCK_UPSTREAM = ffi::GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM as _;
1717        /// probe upstream and downstream events
1718        #[doc(alias = "GST_PAD_PROBE_TYPE_EVENT_BOTH")]
1719        const EVENT_BOTH = ffi::GST_PAD_PROBE_TYPE_EVENT_BOTH as _;
1720        /// probe upstream and downstream queries
1721        #[doc(alias = "GST_PAD_PROBE_TYPE_QUERY_BOTH")]
1722        const QUERY_BOTH = ffi::GST_PAD_PROBE_TYPE_QUERY_BOTH as _;
1723        /// probe upstream events and queries and downstream buffers, buffer lists, events and queries
1724        #[doc(alias = "GST_PAD_PROBE_TYPE_ALL_BOTH")]
1725        const ALL_BOTH = ffi::GST_PAD_PROBE_TYPE_ALL_BOTH as _;
1726        /// probe push and pull
1727        #[doc(alias = "GST_PAD_PROBE_TYPE_SCHEDULING")]
1728        const SCHEDULING = ffi::GST_PAD_PROBE_TYPE_SCHEDULING as _;
1729    }
1730}
1731
1732#[doc(hidden)]
1733impl IntoGlib for PadProbeType {
1734    type GlibType = ffi::GstPadProbeType;
1735
1736    #[inline]
1737    fn into_glib(self) -> ffi::GstPadProbeType {
1738        self.bits()
1739    }
1740}
1741
1742#[doc(hidden)]
1743impl FromGlib<ffi::GstPadProbeType> for PadProbeType {
1744    #[inline]
1745    unsafe fn from_glib(value: ffi::GstPadProbeType) -> Self {
1746        skip_assert_initialized!();
1747        Self::from_bits_truncate(value)
1748    }
1749}
1750
1751impl StaticType for PadProbeType {
1752    #[inline]
1753    #[doc(alias = "gst_pad_probe_type_get_type")]
1754    fn static_type() -> glib::Type {
1755        unsafe { from_glib(ffi::gst_pad_probe_type_get_type()) }
1756    }
1757}
1758
1759impl glib::HasParamSpec for PadProbeType {
1760    type ParamSpec = glib::ParamSpecFlags;
1761    type SetValue = Self;
1762    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1763
1764    fn param_spec_builder() -> Self::BuilderFn {
1765        Self::ParamSpec::builder
1766    }
1767}
1768
1769impl glib::value::ValueType for PadProbeType {
1770    type Type = Self;
1771}
1772
1773unsafe impl<'a> glib::value::FromValue<'a> for PadProbeType {
1774    type Checker = glib::value::GenericValueTypeChecker<Self>;
1775
1776    #[inline]
1777    unsafe fn from_value(value: &'a glib::Value) -> Self {
1778        skip_assert_initialized!();
1779        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1780    }
1781}
1782
1783impl ToValue for PadProbeType {
1784    #[inline]
1785    fn to_value(&self) -> glib::Value {
1786        let mut value = glib::Value::for_value_type::<Self>();
1787        unsafe {
1788            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1789        }
1790        value
1791    }
1792
1793    #[inline]
1794    fn value_type(&self) -> glib::Type {
1795        Self::static_type()
1796    }
1797}
1798
1799impl From<PadProbeType> for glib::Value {
1800    #[inline]
1801    fn from(v: PadProbeType) -> Self {
1802        skip_assert_initialized!();
1803        ToValue::to_value(&v)
1804    }
1805}
1806
1807bitflags! {
1808    /// Parsing options.
1809    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1810    #[doc(alias = "GstParseFlags")]
1811    pub struct ParseFlags: u32 {
1812        /// Always return [`None`] when an error occurs
1813        ///  (default behaviour is to return partially constructed bins or elements
1814        ///  in some cases)
1815        #[doc(alias = "GST_PARSE_FLAG_FATAL_ERRORS")]
1816        const FATAL_ERRORS = ffi::GST_PARSE_FLAG_FATAL_ERRORS as _;
1817        /// If a bin only has a single element,
1818        ///  just return the element.
1819        #[doc(alias = "GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS")]
1820        const NO_SINGLE_ELEMENT_BINS = ffi::GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS as _;
1821        /// If more than one toplevel element is described
1822        ///  by the pipeline description string, put them in a [`Bin`][crate::Bin] instead of a
1823        ///  [`Pipeline`][crate::Pipeline]. (Since: 1.10)
1824        #[doc(alias = "GST_PARSE_FLAG_PLACE_IN_BIN")]
1825        const PLACE_IN_BIN = ffi::GST_PARSE_FLAG_PLACE_IN_BIN as _;
1826    }
1827}
1828
1829#[doc(hidden)]
1830impl IntoGlib for ParseFlags {
1831    type GlibType = ffi::GstParseFlags;
1832
1833    #[inline]
1834    fn into_glib(self) -> ffi::GstParseFlags {
1835        self.bits()
1836    }
1837}
1838
1839#[doc(hidden)]
1840impl FromGlib<ffi::GstParseFlags> for ParseFlags {
1841    #[inline]
1842    unsafe fn from_glib(value: ffi::GstParseFlags) -> Self {
1843        skip_assert_initialized!();
1844        Self::from_bits_truncate(value)
1845    }
1846}
1847
1848impl StaticType for ParseFlags {
1849    #[inline]
1850    #[doc(alias = "gst_parse_flags_get_type")]
1851    fn static_type() -> glib::Type {
1852        unsafe { from_glib(ffi::gst_parse_flags_get_type()) }
1853    }
1854}
1855
1856impl glib::HasParamSpec for ParseFlags {
1857    type ParamSpec = glib::ParamSpecFlags;
1858    type SetValue = Self;
1859    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1860
1861    fn param_spec_builder() -> Self::BuilderFn {
1862        Self::ParamSpec::builder
1863    }
1864}
1865
1866impl glib::value::ValueType for ParseFlags {
1867    type Type = Self;
1868}
1869
1870unsafe impl<'a> glib::value::FromValue<'a> for ParseFlags {
1871    type Checker = glib::value::GenericValueTypeChecker<Self>;
1872
1873    #[inline]
1874    unsafe fn from_value(value: &'a glib::Value) -> Self {
1875        skip_assert_initialized!();
1876        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1877    }
1878}
1879
1880impl ToValue for ParseFlags {
1881    #[inline]
1882    fn to_value(&self) -> glib::Value {
1883        let mut value = glib::Value::for_value_type::<Self>();
1884        unsafe {
1885            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1886        }
1887        value
1888    }
1889
1890    #[inline]
1891    fn value_type(&self) -> glib::Type {
1892        Self::static_type()
1893    }
1894}
1895
1896impl From<ParseFlags> for glib::Value {
1897    #[inline]
1898    fn from(v: ParseFlags) -> Self {
1899        skip_assert_initialized!();
1900        ToValue::to_value(&v)
1901    }
1902}
1903
1904bitflags! {
1905    /// Pipeline flags
1906    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1907    #[doc(alias = "GstPipelineFlags")]
1908    pub struct PipelineFlags: u32 {
1909        /// this pipeline works with a fixed clock
1910        #[doc(alias = "GST_PIPELINE_FLAG_FIXED_CLOCK")]
1911        const FIXED_CLOCK = ffi::GST_PIPELINE_FLAG_FIXED_CLOCK as _;
1912    }
1913}
1914
1915#[doc(hidden)]
1916impl IntoGlib for PipelineFlags {
1917    type GlibType = ffi::GstPipelineFlags;
1918
1919    #[inline]
1920    fn into_glib(self) -> ffi::GstPipelineFlags {
1921        self.bits()
1922    }
1923}
1924
1925#[doc(hidden)]
1926impl FromGlib<ffi::GstPipelineFlags> for PipelineFlags {
1927    #[inline]
1928    unsafe fn from_glib(value: ffi::GstPipelineFlags) -> Self {
1929        skip_assert_initialized!();
1930        Self::from_bits_truncate(value)
1931    }
1932}
1933
1934impl StaticType for PipelineFlags {
1935    #[inline]
1936    #[doc(alias = "gst_pipeline_flags_get_type")]
1937    fn static_type() -> glib::Type {
1938        unsafe { from_glib(ffi::gst_pipeline_flags_get_type()) }
1939    }
1940}
1941
1942impl glib::HasParamSpec for PipelineFlags {
1943    type ParamSpec = glib::ParamSpecFlags;
1944    type SetValue = Self;
1945    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1946
1947    fn param_spec_builder() -> Self::BuilderFn {
1948        Self::ParamSpec::builder
1949    }
1950}
1951
1952impl glib::value::ValueType for PipelineFlags {
1953    type Type = Self;
1954}
1955
1956unsafe impl<'a> glib::value::FromValue<'a> for PipelineFlags {
1957    type Checker = glib::value::GenericValueTypeChecker<Self>;
1958
1959    #[inline]
1960    unsafe fn from_value(value: &'a glib::Value) -> Self {
1961        skip_assert_initialized!();
1962        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1963    }
1964}
1965
1966impl ToValue for PipelineFlags {
1967    #[inline]
1968    fn to_value(&self) -> glib::Value {
1969        let mut value = glib::Value::for_value_type::<Self>();
1970        unsafe {
1971            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1972        }
1973        value
1974    }
1975
1976    #[inline]
1977    fn value_type(&self) -> glib::Type {
1978        Self::static_type()
1979    }
1980}
1981
1982impl From<PipelineFlags> for glib::Value {
1983    #[inline]
1984    fn from(v: PipelineFlags) -> Self {
1985        skip_assert_initialized!();
1986        ToValue::to_value(&v)
1987    }
1988}
1989
1990#[cfg(feature = "v1_18")]
1991bitflags! {
1992    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1993    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1994    #[doc(alias = "GstPluginAPIFlags")]
1995    pub struct PluginAPIFlags: u32 {
1996        /// Ignore enum members when generating
1997        ///  the plugins cache. This is useful if the members of the enum are generated
1998        ///  dynamically, in order not to expose incorrect documentation to the end user.
1999        #[doc(alias = "GST_PLUGIN_API_FLAG_IGNORE_ENUM_MEMBERS")]
2000        const MEMBERS = ffi::GST_PLUGIN_API_FLAG_IGNORE_ENUM_MEMBERS as _;
2001    }
2002}
2003
2004#[cfg(feature = "v1_18")]
2005#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2006#[doc(hidden)]
2007impl IntoGlib for PluginAPIFlags {
2008    type GlibType = ffi::GstPluginAPIFlags;
2009
2010    #[inline]
2011    fn into_glib(self) -> ffi::GstPluginAPIFlags {
2012        self.bits()
2013    }
2014}
2015
2016#[cfg(feature = "v1_18")]
2017#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2018#[doc(hidden)]
2019impl FromGlib<ffi::GstPluginAPIFlags> for PluginAPIFlags {
2020    #[inline]
2021    unsafe fn from_glib(value: ffi::GstPluginAPIFlags) -> Self {
2022        skip_assert_initialized!();
2023        Self::from_bits_truncate(value)
2024    }
2025}
2026
2027#[cfg(feature = "v1_18")]
2028#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2029impl StaticType for PluginAPIFlags {
2030    #[inline]
2031    #[doc(alias = "gst_plugin_api_flags_get_type")]
2032    fn static_type() -> glib::Type {
2033        unsafe { from_glib(ffi::gst_plugin_api_flags_get_type()) }
2034    }
2035}
2036
2037#[cfg(feature = "v1_18")]
2038#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2039impl glib::HasParamSpec for PluginAPIFlags {
2040    type ParamSpec = glib::ParamSpecFlags;
2041    type SetValue = Self;
2042    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2043
2044    fn param_spec_builder() -> Self::BuilderFn {
2045        Self::ParamSpec::builder
2046    }
2047}
2048
2049#[cfg(feature = "v1_18")]
2050#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2051impl glib::value::ValueType for PluginAPIFlags {
2052    type Type = Self;
2053}
2054
2055#[cfg(feature = "v1_18")]
2056#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2057unsafe impl<'a> glib::value::FromValue<'a> for PluginAPIFlags {
2058    type Checker = glib::value::GenericValueTypeChecker<Self>;
2059
2060    #[inline]
2061    unsafe fn from_value(value: &'a glib::Value) -> Self {
2062        skip_assert_initialized!();
2063        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2064    }
2065}
2066
2067#[cfg(feature = "v1_18")]
2068#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2069impl ToValue for PluginAPIFlags {
2070    #[inline]
2071    fn to_value(&self) -> glib::Value {
2072        let mut value = glib::Value::for_value_type::<Self>();
2073        unsafe {
2074            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2075        }
2076        value
2077    }
2078
2079    #[inline]
2080    fn value_type(&self) -> glib::Type {
2081        Self::static_type()
2082    }
2083}
2084
2085#[cfg(feature = "v1_18")]
2086#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2087impl From<PluginAPIFlags> for glib::Value {
2088    #[inline]
2089    fn from(v: PluginAPIFlags) -> Self {
2090        skip_assert_initialized!();
2091        ToValue::to_value(&v)
2092    }
2093}
2094
2095bitflags! {
2096    /// Flags used in connection with [`Plugin::add_dependency()`][crate::Plugin::add_dependency()].
2097    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2098    #[doc(alias = "GstPluginDependencyFlags")]
2099    pub struct PluginDependencyFlags: u32 {
2100        /// recurse into subdirectories
2101        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_RECURSE")]
2102        const RECURSE = ffi::GST_PLUGIN_DEPENDENCY_FLAG_RECURSE as _;
2103        /// use paths
2104        ///  argument only if none of the environment variables is set
2105        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY")]
2106        const PATHS_ARE_DEFAULT_ONLY = ffi::GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY as _;
2107        /// interpret
2108        ///  filename argument as filter suffix and check all matching files in
2109        ///  the directory
2110        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX")]
2111        const FILE_NAME_IS_SUFFIX = ffi::GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX as _;
2112        /// interpret
2113        ///  filename argument as filter prefix and check all matching files in
2114        ///  the directory. Since: 1.8.
2115        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX")]
2116        const FILE_NAME_IS_PREFIX = ffi::GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX as _;
2117        /// interpret
2118        ///  non-absolute paths as relative to the main executable directory. Since
2119        ///  1.14.
2120        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_RELATIVE_TO_EXE")]
2121        const PATHS_ARE_RELATIVE_TO_EXE = ffi::GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_RELATIVE_TO_EXE as _;
2122    }
2123}
2124
2125#[doc(hidden)]
2126impl IntoGlib for PluginDependencyFlags {
2127    type GlibType = ffi::GstPluginDependencyFlags;
2128
2129    #[inline]
2130    fn into_glib(self) -> ffi::GstPluginDependencyFlags {
2131        self.bits()
2132    }
2133}
2134
2135#[doc(hidden)]
2136impl FromGlib<ffi::GstPluginDependencyFlags> for PluginDependencyFlags {
2137    #[inline]
2138    unsafe fn from_glib(value: ffi::GstPluginDependencyFlags) -> Self {
2139        skip_assert_initialized!();
2140        Self::from_bits_truncate(value)
2141    }
2142}
2143
2144impl StaticType for PluginDependencyFlags {
2145    #[inline]
2146    #[doc(alias = "gst_plugin_dependency_flags_get_type")]
2147    fn static_type() -> glib::Type {
2148        unsafe { from_glib(ffi::gst_plugin_dependency_flags_get_type()) }
2149    }
2150}
2151
2152impl glib::HasParamSpec for PluginDependencyFlags {
2153    type ParamSpec = glib::ParamSpecFlags;
2154    type SetValue = Self;
2155    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2156
2157    fn param_spec_builder() -> Self::BuilderFn {
2158        Self::ParamSpec::builder
2159    }
2160}
2161
2162impl glib::value::ValueType for PluginDependencyFlags {
2163    type Type = Self;
2164}
2165
2166unsafe impl<'a> glib::value::FromValue<'a> for PluginDependencyFlags {
2167    type Checker = glib::value::GenericValueTypeChecker<Self>;
2168
2169    #[inline]
2170    unsafe fn from_value(value: &'a glib::Value) -> Self {
2171        skip_assert_initialized!();
2172        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2173    }
2174}
2175
2176impl ToValue for PluginDependencyFlags {
2177    #[inline]
2178    fn to_value(&self) -> glib::Value {
2179        let mut value = glib::Value::for_value_type::<Self>();
2180        unsafe {
2181            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2182        }
2183        value
2184    }
2185
2186    #[inline]
2187    fn value_type(&self) -> glib::Type {
2188        Self::static_type()
2189    }
2190}
2191
2192impl From<PluginDependencyFlags> for glib::Value {
2193    #[inline]
2194    fn from(v: PluginDependencyFlags) -> Self {
2195        skip_assert_initialized!();
2196        ToValue::to_value(&v)
2197    }
2198}
2199
2200bitflags! {
2201    /// The plugin loading state
2202    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2203    #[doc(alias = "GstPluginFlags")]
2204    pub struct PluginFlags: u32 {
2205        /// Temporarily loaded plugins
2206        #[doc(alias = "GST_PLUGIN_FLAG_CACHED")]
2207        const CACHED = ffi::GST_PLUGIN_FLAG_CACHED as _;
2208        /// The plugin won't be scanned (again)
2209        #[doc(alias = "GST_PLUGIN_FLAG_BLACKLISTED")]
2210        const BLACKLISTED = ffi::GST_PLUGIN_FLAG_BLACKLISTED as _;
2211    }
2212}
2213
2214#[doc(hidden)]
2215impl IntoGlib for PluginFlags {
2216    type GlibType = ffi::GstPluginFlags;
2217
2218    #[inline]
2219    fn into_glib(self) -> ffi::GstPluginFlags {
2220        self.bits()
2221    }
2222}
2223
2224#[doc(hidden)]
2225impl FromGlib<ffi::GstPluginFlags> for PluginFlags {
2226    #[inline]
2227    unsafe fn from_glib(value: ffi::GstPluginFlags) -> Self {
2228        skip_assert_initialized!();
2229        Self::from_bits_truncate(value)
2230    }
2231}
2232
2233impl StaticType for PluginFlags {
2234    #[inline]
2235    #[doc(alias = "gst_plugin_flags_get_type")]
2236    fn static_type() -> glib::Type {
2237        unsafe { from_glib(ffi::gst_plugin_flags_get_type()) }
2238    }
2239}
2240
2241impl glib::HasParamSpec for PluginFlags {
2242    type ParamSpec = glib::ParamSpecFlags;
2243    type SetValue = Self;
2244    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2245
2246    fn param_spec_builder() -> Self::BuilderFn {
2247        Self::ParamSpec::builder
2248    }
2249}
2250
2251impl glib::value::ValueType for PluginFlags {
2252    type Type = Self;
2253}
2254
2255unsafe impl<'a> glib::value::FromValue<'a> for PluginFlags {
2256    type Checker = glib::value::GenericValueTypeChecker<Self>;
2257
2258    #[inline]
2259    unsafe fn from_value(value: &'a glib::Value) -> Self {
2260        skip_assert_initialized!();
2261        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2262    }
2263}
2264
2265impl ToValue for PluginFlags {
2266    #[inline]
2267    fn to_value(&self) -> glib::Value {
2268        let mut value = glib::Value::for_value_type::<Self>();
2269        unsafe {
2270            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2271        }
2272        value
2273    }
2274
2275    #[inline]
2276    fn value_type(&self) -> glib::Type {
2277        Self::static_type()
2278    }
2279}
2280
2281impl From<PluginFlags> for glib::Value {
2282    #[inline]
2283    fn from(v: PluginFlags) -> Self {
2284        skip_assert_initialized!();
2285        ToValue::to_value(&v)
2286    }
2287}
2288
2289bitflags! {
2290    /// The different scheduling flags.
2291    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2292    #[doc(alias = "GstSchedulingFlags")]
2293    pub struct SchedulingFlags: u32 {
2294        /// if seeking is possible
2295        #[doc(alias = "GST_SCHEDULING_FLAG_SEEKABLE")]
2296        const SEEKABLE = ffi::GST_SCHEDULING_FLAG_SEEKABLE as _;
2297        /// if sequential access is recommended
2298        #[doc(alias = "GST_SCHEDULING_FLAG_SEQUENTIAL")]
2299        const SEQUENTIAL = ffi::GST_SCHEDULING_FLAG_SEQUENTIAL as _;
2300        /// if bandwidth is limited and buffering possible (since 1.2)
2301        #[doc(alias = "GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED")]
2302        const BANDWIDTH_LIMITED = ffi::GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED as _;
2303    }
2304}
2305
2306#[doc(hidden)]
2307impl IntoGlib for SchedulingFlags {
2308    type GlibType = ffi::GstSchedulingFlags;
2309
2310    #[inline]
2311    fn into_glib(self) -> ffi::GstSchedulingFlags {
2312        self.bits()
2313    }
2314}
2315
2316#[doc(hidden)]
2317impl FromGlib<ffi::GstSchedulingFlags> for SchedulingFlags {
2318    #[inline]
2319    unsafe fn from_glib(value: ffi::GstSchedulingFlags) -> Self {
2320        skip_assert_initialized!();
2321        Self::from_bits_truncate(value)
2322    }
2323}
2324
2325impl StaticType for SchedulingFlags {
2326    #[inline]
2327    #[doc(alias = "gst_scheduling_flags_get_type")]
2328    fn static_type() -> glib::Type {
2329        unsafe { from_glib(ffi::gst_scheduling_flags_get_type()) }
2330    }
2331}
2332
2333impl glib::HasParamSpec for SchedulingFlags {
2334    type ParamSpec = glib::ParamSpecFlags;
2335    type SetValue = Self;
2336    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2337
2338    fn param_spec_builder() -> Self::BuilderFn {
2339        Self::ParamSpec::builder
2340    }
2341}
2342
2343impl glib::value::ValueType for SchedulingFlags {
2344    type Type = Self;
2345}
2346
2347unsafe impl<'a> glib::value::FromValue<'a> for SchedulingFlags {
2348    type Checker = glib::value::GenericValueTypeChecker<Self>;
2349
2350    #[inline]
2351    unsafe fn from_value(value: &'a glib::Value) -> Self {
2352        skip_assert_initialized!();
2353        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2354    }
2355}
2356
2357impl ToValue for SchedulingFlags {
2358    #[inline]
2359    fn to_value(&self) -> glib::Value {
2360        let mut value = glib::Value::for_value_type::<Self>();
2361        unsafe {
2362            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2363        }
2364        value
2365    }
2366
2367    #[inline]
2368    fn value_type(&self) -> glib::Type {
2369        Self::static_type()
2370    }
2371}
2372
2373impl From<SchedulingFlags> for glib::Value {
2374    #[inline]
2375    fn from(v: SchedulingFlags) -> Self {
2376        skip_assert_initialized!();
2377        ToValue::to_value(&v)
2378    }
2379}
2380
2381bitflags! {
2382    /// Flags to be used with [`ElementExtManual::seek()`][crate::prelude::ElementExtManual::seek()] or `gst_event_new_seek()`. All flags
2383    /// can be used together.
2384    ///
2385    /// A non flushing seek might take some time to perform as the currently
2386    /// playing data in the pipeline will not be cleared.
2387    ///
2388    /// An accurate seek might be slower for formats that don't have any indexes
2389    /// or timestamp markers in the stream. Specifying this flag might require a
2390    /// complete scan of the file in those cases.
2391    ///
2392    /// When performing a segment seek: after the playback of the segment completes,
2393    /// no EOS will be emitted by the element that performed the seek, but a
2394    /// `GST_MESSAGE_SEGMENT_DONE` message will be posted on the bus by the element.
2395    /// When this message is posted, it is possible to send a new seek event to
2396    /// continue playback. With this seek method it is possible to perform seamless
2397    /// looping or simple linear editing.
2398    ///
2399    /// When only changing the playback rate and not the direction, the
2400    /// [`INSTANT_RATE_CHANGE`][Self::INSTANT_RATE_CHANGE] flag can be used for a non-flushing seek
2401    /// to signal that the rate change should be applied immediately. This requires
2402    /// special support in the seek handlers (e.g. demuxers) and any elements
2403    /// synchronizing to the clock, and in general can't work in all cases (for example
2404    /// UDP streaming where the delivery rate is controlled by a remote server). The
2405    /// instant-rate-change mode supports changing the trickmode-related GST_SEEK_ flags,
2406    /// but can't be used in conjunction with other seek flags that affect the new
2407    /// playback position - as the playback position will not be changing.
2408    ///
2409    /// When doing fast forward (rate > 1.0) or fast reverse (rate < -1.0) trickmode
2410    /// playback, the [`TRICKMODE`][Self::TRICKMODE] flag can be used to instruct decoders
2411    /// and demuxers to adjust the playback rate by skipping frames. This can improve
2412    /// performance and decrease CPU usage because not all frames need to be decoded.
2413    ///
2414    /// Beyond that, the [`TRICKMODE_KEY_UNITS`][Self::TRICKMODE_KEY_UNITS] flag can be used to
2415    /// request that decoders skip all frames except key units, and
2416    /// [`TRICKMODE_NO_AUDIO`][Self::TRICKMODE_NO_AUDIO] flags can be used to request that audio
2417    /// decoders do no decoding at all, and simple output silence.
2418    ///
2419    /// The [`SNAP_BEFORE`][Self::SNAP_BEFORE] flag can be used to snap to the previous
2420    /// relevant location, and the [`SNAP_AFTER`][Self::SNAP_AFTER] flag can be used to
2421    /// select the next relevant location. If [`KEY_UNIT`][Self::KEY_UNIT] is specified,
2422    /// the relevant location is a keyframe. If both flags are specified, the nearest
2423    /// of these locations will be selected. If none are specified, the implementation is
2424    /// free to select whichever it wants.
2425    ///
2426    /// The before and after here are in running time, so when playing backwards,
2427    /// the next location refers to the one that will played in next, and not the
2428    /// one that is located after in the actual source stream.
2429    ///
2430    /// Also see part-seeking.txt in the GStreamer design documentation for more
2431    /// details on the meaning of these flags and the behaviour expected of
2432    /// elements that handle them.
2433    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2434    #[doc(alias = "GstSeekFlags")]
2435    pub struct SeekFlags: u32 {
2436        /// flush pipeline
2437        #[doc(alias = "GST_SEEK_FLAG_FLUSH")]
2438        const FLUSH = ffi::GST_SEEK_FLAG_FLUSH as _;
2439        /// accurate position is requested, this might
2440        ///  be considerably slower for some formats.
2441        #[doc(alias = "GST_SEEK_FLAG_ACCURATE")]
2442        const ACCURATE = ffi::GST_SEEK_FLAG_ACCURATE as _;
2443        /// seek to the nearest keyframe. This might be
2444        ///  faster but less accurate.
2445        #[doc(alias = "GST_SEEK_FLAG_KEY_UNIT")]
2446        const KEY_UNIT = ffi::GST_SEEK_FLAG_KEY_UNIT as _;
2447        /// perform a segment seek.
2448        #[doc(alias = "GST_SEEK_FLAG_SEGMENT")]
2449        const SEGMENT = ffi::GST_SEEK_FLAG_SEGMENT as _;
2450        /// when doing fast forward or fast reverse playback, allow
2451        ///  elements to skip frames instead of generating all
2452        ///  frames. (Since: 1.6)
2453        #[doc(alias = "GST_SEEK_FLAG_TRICKMODE")]
2454        const TRICKMODE = ffi::GST_SEEK_FLAG_TRICKMODE as _;
2455        /// Deprecated backward compatibility flag, replaced
2456        ///  by [`TRICKMODE`][Self::TRICKMODE]
2457        #[doc(alias = "GST_SEEK_FLAG_SKIP")]
2458        const SKIP = ffi::GST_SEEK_FLAG_SKIP as _;
2459        /// go to a location before the requested position,
2460        ///  if [`KEY_UNIT`][Self::KEY_UNIT] this means the keyframe at or before
2461        ///  the requested position the one at or before the seek target.
2462        #[doc(alias = "GST_SEEK_FLAG_SNAP_BEFORE")]
2463        const SNAP_BEFORE = ffi::GST_SEEK_FLAG_SNAP_BEFORE as _;
2464        /// go to a location after the requested position,
2465        ///  if [`KEY_UNIT`][Self::KEY_UNIT] this means the keyframe at of after the
2466        ///  requested position.
2467        #[doc(alias = "GST_SEEK_FLAG_SNAP_AFTER")]
2468        const SNAP_AFTER = ffi::GST_SEEK_FLAG_SNAP_AFTER as _;
2469        /// go to a position near the requested position,
2470        ///  if [`KEY_UNIT`][Self::KEY_UNIT] this means the keyframe closest
2471        ///  to the requested position, if both keyframes are at an equal
2472        ///  distance, behaves like [`SNAP_BEFORE`][Self::SNAP_BEFORE].
2473        #[doc(alias = "GST_SEEK_FLAG_SNAP_NEAREST")]
2474        const SNAP_NEAREST = ffi::GST_SEEK_FLAG_SNAP_NEAREST as _;
2475        /// when doing fast forward or fast reverse
2476        ///  playback, request that elements only decode keyframes
2477        ///  and skip all other content, for formats that have
2478        ///  keyframes. (Since: 1.6)
2479        #[doc(alias = "GST_SEEK_FLAG_TRICKMODE_KEY_UNITS")]
2480        const TRICKMODE_KEY_UNITS = ffi::GST_SEEK_FLAG_TRICKMODE_KEY_UNITS as _;
2481        /// when doing fast forward or fast reverse
2482        ///  playback, request that audio decoder elements skip
2483        ///  decoding and output only gap events or silence. (Since: 1.6)
2484        #[doc(alias = "GST_SEEK_FLAG_TRICKMODE_NO_AUDIO")]
2485        const TRICKMODE_NO_AUDIO = ffi::GST_SEEK_FLAG_TRICKMODE_NO_AUDIO as _;
2486        /// When doing fast forward or fast reverse
2487        ///  playback, request that elements only decode keyframes and
2488        ///  forward predicted frames and skip all other content (for example
2489        ///  B-Frames), for formats that have keyframes and forward predicted
2490        ///  frames. (Since: 1.18)
2491        #[cfg(feature = "v1_18")]
2492        #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2493        #[doc(alias = "GST_SEEK_FLAG_TRICKMODE_FORWARD_PREDICTED")]
2494        const TRICKMODE_FORWARD_PREDICTED = ffi::GST_SEEK_FLAG_TRICKMODE_FORWARD_PREDICTED as _;
2495        /// Signals that a rate change should be
2496        ///  applied immediately. Only valid if start/stop position
2497        ///  are GST_CLOCK_TIME_NONE, the playback direction does not change
2498        ///  and the seek is not flushing. (Since: 1.18)
2499        #[cfg(feature = "v1_18")]
2500        #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2501        #[doc(alias = "GST_SEEK_FLAG_INSTANT_RATE_CHANGE")]
2502        const INSTANT_RATE_CHANGE = ffi::GST_SEEK_FLAG_INSTANT_RATE_CHANGE as _;
2503    }
2504}
2505
2506#[doc(hidden)]
2507impl IntoGlib for SeekFlags {
2508    type GlibType = ffi::GstSeekFlags;
2509
2510    #[inline]
2511    fn into_glib(self) -> ffi::GstSeekFlags {
2512        self.bits()
2513    }
2514}
2515
2516#[doc(hidden)]
2517impl FromGlib<ffi::GstSeekFlags> for SeekFlags {
2518    #[inline]
2519    unsafe fn from_glib(value: ffi::GstSeekFlags) -> Self {
2520        skip_assert_initialized!();
2521        Self::from_bits_truncate(value)
2522    }
2523}
2524
2525impl StaticType for SeekFlags {
2526    #[inline]
2527    #[doc(alias = "gst_seek_flags_get_type")]
2528    fn static_type() -> glib::Type {
2529        unsafe { from_glib(ffi::gst_seek_flags_get_type()) }
2530    }
2531}
2532
2533impl glib::HasParamSpec for SeekFlags {
2534    type ParamSpec = glib::ParamSpecFlags;
2535    type SetValue = Self;
2536    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2537
2538    fn param_spec_builder() -> Self::BuilderFn {
2539        Self::ParamSpec::builder
2540    }
2541}
2542
2543impl glib::value::ValueType for SeekFlags {
2544    type Type = Self;
2545}
2546
2547unsafe impl<'a> glib::value::FromValue<'a> for SeekFlags {
2548    type Checker = glib::value::GenericValueTypeChecker<Self>;
2549
2550    #[inline]
2551    unsafe fn from_value(value: &'a glib::Value) -> Self {
2552        skip_assert_initialized!();
2553        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2554    }
2555}
2556
2557impl ToValue for SeekFlags {
2558    #[inline]
2559    fn to_value(&self) -> glib::Value {
2560        let mut value = glib::Value::for_value_type::<Self>();
2561        unsafe {
2562            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2563        }
2564        value
2565    }
2566
2567    #[inline]
2568    fn value_type(&self) -> glib::Type {
2569        Self::static_type()
2570    }
2571}
2572
2573impl From<SeekFlags> for glib::Value {
2574    #[inline]
2575    fn from(v: SeekFlags) -> Self {
2576        skip_assert_initialized!();
2577        ToValue::to_value(&v)
2578    }
2579}
2580
2581bitflags! {
2582    /// Flags for the GstSegment structure. Currently mapped to the corresponding
2583    /// values of the seek flags.
2584    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2585    #[doc(alias = "GstSegmentFlags")]
2586    pub struct SegmentFlags: u32 {
2587        /// reset the pipeline running_time to the segment
2588        ///  running_time
2589        #[doc(alias = "GST_SEGMENT_FLAG_RESET")]
2590        const RESET = ffi::GST_SEGMENT_FLAG_RESET as _;
2591        /// perform skip playback (Since: 1.6)
2592        #[doc(alias = "GST_SEGMENT_FLAG_TRICKMODE")]
2593        const TRICKMODE = ffi::GST_SEGMENT_FLAG_TRICKMODE as _;
2594        /// Deprecated backward compatibility flag, replaced
2595        ///  by [`TRICKMODE`][Self::TRICKMODE]
2596        #[doc(alias = "GST_SEGMENT_FLAG_SKIP")]
2597        const SKIP = ffi::GST_SEGMENT_FLAG_SKIP as _;
2598        /// send SEGMENT_DONE instead of EOS
2599        #[doc(alias = "GST_SEGMENT_FLAG_SEGMENT")]
2600        const SEGMENT = ffi::GST_SEGMENT_FLAG_SEGMENT as _;
2601        /// Decode only keyframes, where
2602        ///  possible (Since: 1.6)
2603        #[doc(alias = "GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS")]
2604        const TRICKMODE_KEY_UNITS = ffi::GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS as _;
2605        /// Decode only keyframes or forward
2606        ///  predicted frames, where possible (Since: 1.18)
2607        #[cfg(feature = "v1_18")]
2608        #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2609        #[doc(alias = "GST_SEGMENT_FLAG_TRICKMODE_FORWARD_PREDICTED")]
2610        const TRICKMODE_FORWARD_PREDICTED = ffi::GST_SEGMENT_FLAG_TRICKMODE_FORWARD_PREDICTED as _;
2611        /// Do not decode any audio, where
2612        ///  possible (Since: 1.6)
2613        #[doc(alias = "GST_SEGMENT_FLAG_TRICKMODE_NO_AUDIO")]
2614        const TRICKMODE_NO_AUDIO = ffi::GST_SEGMENT_FLAG_TRICKMODE_NO_AUDIO as _;
2615    }
2616}
2617
2618#[doc(hidden)]
2619impl IntoGlib for SegmentFlags {
2620    type GlibType = ffi::GstSegmentFlags;
2621
2622    #[inline]
2623    fn into_glib(self) -> ffi::GstSegmentFlags {
2624        self.bits()
2625    }
2626}
2627
2628#[doc(hidden)]
2629impl FromGlib<ffi::GstSegmentFlags> for SegmentFlags {
2630    #[inline]
2631    unsafe fn from_glib(value: ffi::GstSegmentFlags) -> Self {
2632        skip_assert_initialized!();
2633        Self::from_bits_truncate(value)
2634    }
2635}
2636
2637impl StaticType for SegmentFlags {
2638    #[inline]
2639    #[doc(alias = "gst_segment_flags_get_type")]
2640    fn static_type() -> glib::Type {
2641        unsafe { from_glib(ffi::gst_segment_flags_get_type()) }
2642    }
2643}
2644
2645impl glib::HasParamSpec for SegmentFlags {
2646    type ParamSpec = glib::ParamSpecFlags;
2647    type SetValue = Self;
2648    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2649
2650    fn param_spec_builder() -> Self::BuilderFn {
2651        Self::ParamSpec::builder
2652    }
2653}
2654
2655impl glib::value::ValueType for SegmentFlags {
2656    type Type = Self;
2657}
2658
2659unsafe impl<'a> glib::value::FromValue<'a> for SegmentFlags {
2660    type Checker = glib::value::GenericValueTypeChecker<Self>;
2661
2662    #[inline]
2663    unsafe fn from_value(value: &'a glib::Value) -> Self {
2664        skip_assert_initialized!();
2665        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2666    }
2667}
2668
2669impl ToValue for SegmentFlags {
2670    #[inline]
2671    fn to_value(&self) -> glib::Value {
2672        let mut value = glib::Value::for_value_type::<Self>();
2673        unsafe {
2674            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2675        }
2676        value
2677    }
2678
2679    #[inline]
2680    fn value_type(&self) -> glib::Type {
2681        Self::static_type()
2682    }
2683}
2684
2685impl From<SegmentFlags> for glib::Value {
2686    #[inline]
2687    fn from(v: SegmentFlags) -> Self {
2688        skip_assert_initialized!();
2689        ToValue::to_value(&v)
2690    }
2691}
2692
2693#[cfg(feature = "v1_20")]
2694bitflags! {
2695    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2696    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2697    #[doc(alias = "GstSerializeFlags")]
2698    pub struct SerializeFlags: u32 {
2699        /// No special flags specified.
2700        #[doc(alias = "GST_SERIALIZE_FLAG_NONE")]
2701        const NONE = ffi::GST_SERIALIZE_FLAG_NONE as _;
2702        /// Serialize using the old format for
2703        ///  nested structures.
2704        #[doc(alias = "GST_SERIALIZE_FLAG_BACKWARD_COMPAT")]
2705        const BACKWARD_COMPAT = ffi::GST_SERIALIZE_FLAG_BACKWARD_COMPAT as _;
2706    }
2707}
2708
2709#[cfg(feature = "v1_20")]
2710#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2711#[doc(hidden)]
2712impl IntoGlib for SerializeFlags {
2713    type GlibType = ffi::GstSerializeFlags;
2714
2715    #[inline]
2716    fn into_glib(self) -> ffi::GstSerializeFlags {
2717        self.bits()
2718    }
2719}
2720
2721#[cfg(feature = "v1_20")]
2722#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2723#[doc(hidden)]
2724impl FromGlib<ffi::GstSerializeFlags> for SerializeFlags {
2725    #[inline]
2726    unsafe fn from_glib(value: ffi::GstSerializeFlags) -> Self {
2727        skip_assert_initialized!();
2728        Self::from_bits_truncate(value)
2729    }
2730}
2731
2732#[cfg(feature = "v1_20")]
2733#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2734impl StaticType for SerializeFlags {
2735    #[inline]
2736    #[doc(alias = "gst_serialize_flags_get_type")]
2737    fn static_type() -> glib::Type {
2738        unsafe { from_glib(ffi::gst_serialize_flags_get_type()) }
2739    }
2740}
2741
2742#[cfg(feature = "v1_20")]
2743#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2744impl glib::HasParamSpec for SerializeFlags {
2745    type ParamSpec = glib::ParamSpecFlags;
2746    type SetValue = Self;
2747    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2748
2749    fn param_spec_builder() -> Self::BuilderFn {
2750        Self::ParamSpec::builder
2751    }
2752}
2753
2754#[cfg(feature = "v1_20")]
2755#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2756impl glib::value::ValueType for SerializeFlags {
2757    type Type = Self;
2758}
2759
2760#[cfg(feature = "v1_20")]
2761#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2762unsafe impl<'a> glib::value::FromValue<'a> for SerializeFlags {
2763    type Checker = glib::value::GenericValueTypeChecker<Self>;
2764
2765    #[inline]
2766    unsafe fn from_value(value: &'a glib::Value) -> Self {
2767        skip_assert_initialized!();
2768        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2769    }
2770}
2771
2772#[cfg(feature = "v1_20")]
2773#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2774impl ToValue for SerializeFlags {
2775    #[inline]
2776    fn to_value(&self) -> glib::Value {
2777        let mut value = glib::Value::for_value_type::<Self>();
2778        unsafe {
2779            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2780        }
2781        value
2782    }
2783
2784    #[inline]
2785    fn value_type(&self) -> glib::Type {
2786        Self::static_type()
2787    }
2788}
2789
2790#[cfg(feature = "v1_20")]
2791#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2792impl From<SerializeFlags> for glib::Value {
2793    #[inline]
2794    fn from(v: SerializeFlags) -> Self {
2795        skip_assert_initialized!();
2796        ToValue::to_value(&v)
2797    }
2798}
2799
2800bitflags! {
2801    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2802    #[doc(alias = "GstStackTraceFlags")]
2803    pub struct StackTraceFlags: u32 {
2804        /// Try to retrieve as much information as possible,
2805        ///  including source information when getting the
2806        ///  stack trace
2807        #[doc(alias = "GST_STACK_TRACE_SHOW_FULL")]
2808        const FULL = ffi::GST_STACK_TRACE_SHOW_FULL as _;
2809    }
2810}
2811
2812#[doc(hidden)]
2813impl IntoGlib for StackTraceFlags {
2814    type GlibType = ffi::GstStackTraceFlags;
2815
2816    #[inline]
2817    fn into_glib(self) -> ffi::GstStackTraceFlags {
2818        self.bits()
2819    }
2820}
2821
2822#[doc(hidden)]
2823impl FromGlib<ffi::GstStackTraceFlags> for StackTraceFlags {
2824    #[inline]
2825    unsafe fn from_glib(value: ffi::GstStackTraceFlags) -> Self {
2826        skip_assert_initialized!();
2827        Self::from_bits_truncate(value)
2828    }
2829}
2830
2831impl StaticType for StackTraceFlags {
2832    #[inline]
2833    #[doc(alias = "gst_stack_trace_flags_get_type")]
2834    fn static_type() -> glib::Type {
2835        unsafe { from_glib(ffi::gst_stack_trace_flags_get_type()) }
2836    }
2837}
2838
2839impl glib::HasParamSpec for StackTraceFlags {
2840    type ParamSpec = glib::ParamSpecFlags;
2841    type SetValue = Self;
2842    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2843
2844    fn param_spec_builder() -> Self::BuilderFn {
2845        Self::ParamSpec::builder
2846    }
2847}
2848
2849impl glib::value::ValueType for StackTraceFlags {
2850    type Type = Self;
2851}
2852
2853unsafe impl<'a> glib::value::FromValue<'a> for StackTraceFlags {
2854    type Checker = glib::value::GenericValueTypeChecker<Self>;
2855
2856    #[inline]
2857    unsafe fn from_value(value: &'a glib::Value) -> Self {
2858        skip_assert_initialized!();
2859        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2860    }
2861}
2862
2863impl ToValue for StackTraceFlags {
2864    #[inline]
2865    fn to_value(&self) -> glib::Value {
2866        let mut value = glib::Value::for_value_type::<Self>();
2867        unsafe {
2868            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2869        }
2870        value
2871    }
2872
2873    #[inline]
2874    fn value_type(&self) -> glib::Type {
2875        Self::static_type()
2876    }
2877}
2878
2879impl From<StackTraceFlags> for glib::Value {
2880    #[inline]
2881    fn from(v: StackTraceFlags) -> Self {
2882        skip_assert_initialized!();
2883        ToValue::to_value(&v)
2884    }
2885}
2886
2887bitflags! {
2888    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2889    #[doc(alias = "GstStreamFlags")]
2890    pub struct StreamFlags: u32 {
2891        /// This stream is a sparse stream (e.g. a subtitle
2892        ///  stream), data may flow only in irregular intervals with large gaps in
2893        ///  between.
2894        #[doc(alias = "GST_STREAM_FLAG_SPARSE")]
2895        const SPARSE = ffi::GST_STREAM_FLAG_SPARSE as _;
2896        /// This stream should be selected by default. This
2897        ///  flag may be used by demuxers to signal that a stream should be selected
2898        ///  by default in a playback scenario.
2899        #[doc(alias = "GST_STREAM_FLAG_SELECT")]
2900        const SELECT = ffi::GST_STREAM_FLAG_SELECT as _;
2901        /// This stream should not be selected by default.
2902        ///  This flag may be used by demuxers to signal that a stream should not
2903        ///  be selected by default in a playback scenario, but only if explicitly
2904        ///  selected by the user (e.g. an audio track for the hard of hearing or
2905        ///  a director's commentary track).
2906        #[doc(alias = "GST_STREAM_FLAG_UNSELECT")]
2907        const UNSELECT = ffi::GST_STREAM_FLAG_UNSELECT as _;
2908    }
2909}
2910
2911#[doc(hidden)]
2912impl IntoGlib for StreamFlags {
2913    type GlibType = ffi::GstStreamFlags;
2914
2915    #[inline]
2916    fn into_glib(self) -> ffi::GstStreamFlags {
2917        self.bits()
2918    }
2919}
2920
2921#[doc(hidden)]
2922impl FromGlib<ffi::GstStreamFlags> for StreamFlags {
2923    #[inline]
2924    unsafe fn from_glib(value: ffi::GstStreamFlags) -> Self {
2925        skip_assert_initialized!();
2926        Self::from_bits_truncate(value)
2927    }
2928}
2929
2930impl StaticType for StreamFlags {
2931    #[inline]
2932    #[doc(alias = "gst_stream_flags_get_type")]
2933    fn static_type() -> glib::Type {
2934        unsafe { from_glib(ffi::gst_stream_flags_get_type()) }
2935    }
2936}
2937
2938impl glib::HasParamSpec for StreamFlags {
2939    type ParamSpec = glib::ParamSpecFlags;
2940    type SetValue = Self;
2941    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2942
2943    fn param_spec_builder() -> Self::BuilderFn {
2944        Self::ParamSpec::builder
2945    }
2946}
2947
2948impl glib::value::ValueType for StreamFlags {
2949    type Type = Self;
2950}
2951
2952unsafe impl<'a> glib::value::FromValue<'a> for StreamFlags {
2953    type Checker = glib::value::GenericValueTypeChecker<Self>;
2954
2955    #[inline]
2956    unsafe fn from_value(value: &'a glib::Value) -> Self {
2957        skip_assert_initialized!();
2958        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2959    }
2960}
2961
2962impl ToValue for StreamFlags {
2963    #[inline]
2964    fn to_value(&self) -> glib::Value {
2965        let mut value = glib::Value::for_value_type::<Self>();
2966        unsafe {
2967            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2968        }
2969        value
2970    }
2971
2972    #[inline]
2973    fn value_type(&self) -> glib::Type {
2974        Self::static_type()
2975    }
2976}
2977
2978impl From<StreamFlags> for glib::Value {
2979    #[inline]
2980    fn from(v: StreamFlags) -> Self {
2981        skip_assert_initialized!();
2982        ToValue::to_value(&v)
2983    }
2984}
2985
2986bitflags! {
2987    /// [`StreamType`][crate::StreamType] describes a high level classification set for
2988    /// flows of data in [`Stream`][crate::Stream] objects.
2989    ///
2990    /// Note that this is a flag, and therefore users should not assume it
2991    /// will be a single value. Do not use the equality operator for checking
2992    /// whether a stream is of a certain type.
2993    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2994    #[doc(alias = "GstStreamType")]
2995    pub struct StreamType: u32 {
2996        /// The stream is of unknown (unclassified) type.
2997        #[doc(alias = "GST_STREAM_TYPE_UNKNOWN")]
2998        const UNKNOWN = ffi::GST_STREAM_TYPE_UNKNOWN as _;
2999        /// The stream is of audio data
3000        #[doc(alias = "GST_STREAM_TYPE_AUDIO")]
3001        const AUDIO = ffi::GST_STREAM_TYPE_AUDIO as _;
3002        /// The stream carries video data
3003        #[doc(alias = "GST_STREAM_TYPE_VIDEO")]
3004        const VIDEO = ffi::GST_STREAM_TYPE_VIDEO as _;
3005        /// The stream is a muxed container type
3006        #[doc(alias = "GST_STREAM_TYPE_CONTAINER")]
3007        const CONTAINER = ffi::GST_STREAM_TYPE_CONTAINER as _;
3008        /// The stream contains subtitle / subpicture data.
3009        #[doc(alias = "GST_STREAM_TYPE_TEXT")]
3010        const TEXT = ffi::GST_STREAM_TYPE_TEXT as _;
3011    }
3012}
3013
3014impl StreamType {
3015    pub fn name<'a>(self) -> &'a GStr {
3016        unsafe {
3017            GStr::from_ptr(
3018                ffi::gst_stream_type_get_name(self.into_glib())
3019                    .as_ref()
3020                    .expect("gst_stream_type_get_name returned NULL"),
3021            )
3022        }
3023    }
3024}
3025
3026impl std::fmt::Display for StreamType {
3027    #[inline]
3028    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3029        f.write_str(&self.name())
3030    }
3031}
3032
3033#[doc(hidden)]
3034impl IntoGlib for StreamType {
3035    type GlibType = ffi::GstStreamType;
3036
3037    #[inline]
3038    fn into_glib(self) -> ffi::GstStreamType {
3039        self.bits()
3040    }
3041}
3042
3043#[doc(hidden)]
3044impl FromGlib<ffi::GstStreamType> for StreamType {
3045    #[inline]
3046    unsafe fn from_glib(value: ffi::GstStreamType) -> Self {
3047        skip_assert_initialized!();
3048        Self::from_bits_truncate(value)
3049    }
3050}
3051
3052impl StaticType for StreamType {
3053    #[inline]
3054    #[doc(alias = "gst_stream_type_get_type")]
3055    fn static_type() -> glib::Type {
3056        unsafe { from_glib(ffi::gst_stream_type_get_type()) }
3057    }
3058}
3059
3060impl glib::HasParamSpec for StreamType {
3061    type ParamSpec = glib::ParamSpecFlags;
3062    type SetValue = Self;
3063    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
3064
3065    fn param_spec_builder() -> Self::BuilderFn {
3066        Self::ParamSpec::builder
3067    }
3068}
3069
3070impl glib::value::ValueType for StreamType {
3071    type Type = Self;
3072}
3073
3074unsafe impl<'a> glib::value::FromValue<'a> for StreamType {
3075    type Checker = glib::value::GenericValueTypeChecker<Self>;
3076
3077    #[inline]
3078    unsafe fn from_value(value: &'a glib::Value) -> Self {
3079        skip_assert_initialized!();
3080        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
3081    }
3082}
3083
3084impl ToValue for StreamType {
3085    #[inline]
3086    fn to_value(&self) -> glib::Value {
3087        let mut value = glib::Value::for_value_type::<Self>();
3088        unsafe {
3089            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
3090        }
3091        value
3092    }
3093
3094    #[inline]
3095    fn value_type(&self) -> glib::Type {
3096        Self::static_type()
3097    }
3098}
3099
3100impl From<StreamType> for glib::Value {
3101    #[inline]
3102    fn from(v: StreamType) -> Self {
3103        skip_assert_initialized!();
3104        ToValue::to_value(&v)
3105    }
3106}