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
1107#[cfg(feature = "v1_28")]
1108bitflags! {
1109    /// Flags to control the behavior of a [`LogContext`][crate::LogContext].
1110    #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1111    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1112    #[doc(alias = "GstLogContextFlags")]
1113    pub struct LogContextFlags: u32 {
1114        /// Enable message throttling/deduplication. This
1115        ///  makes the context track which messages have been logged already based on
1116        ///  their message hash, and only log them once (or periodically if an
1117        ///  interval is set). Without this flag, all messages will be logged regardless
1118        ///  of whether they've been logged before.
1119        #[doc(alias = "GST_LOG_CONTEXT_FLAG_THROTTLE")]
1120        const THROTTLE = ffi::GST_LOG_CONTEXT_FLAG_THROTTLE as _;
1121    }
1122}
1123
1124#[cfg(feature = "v1_28")]
1125#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1126#[doc(hidden)]
1127impl IntoGlib for LogContextFlags {
1128    type GlibType = ffi::GstLogContextFlags;
1129
1130    #[inline]
1131    fn into_glib(self) -> ffi::GstLogContextFlags {
1132        self.bits()
1133    }
1134}
1135
1136#[cfg(feature = "v1_28")]
1137#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1138#[doc(hidden)]
1139impl FromGlib<ffi::GstLogContextFlags> for LogContextFlags {
1140    #[inline]
1141    unsafe fn from_glib(value: ffi::GstLogContextFlags) -> Self {
1142        skip_assert_initialized!();
1143        Self::from_bits_truncate(value)
1144    }
1145}
1146
1147#[cfg(feature = "v1_28")]
1148#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1149impl StaticType for LogContextFlags {
1150    #[inline]
1151    #[doc(alias = "gst_log_context_flags_get_type")]
1152    fn static_type() -> glib::Type {
1153        unsafe { from_glib(ffi::gst_log_context_flags_get_type()) }
1154    }
1155}
1156
1157#[cfg(feature = "v1_28")]
1158#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1159impl glib::HasParamSpec for LogContextFlags {
1160    type ParamSpec = glib::ParamSpecFlags;
1161    type SetValue = Self;
1162    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1163
1164    fn param_spec_builder() -> Self::BuilderFn {
1165        Self::ParamSpec::builder
1166    }
1167}
1168
1169#[cfg(feature = "v1_28")]
1170#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1171impl glib::value::ValueType for LogContextFlags {
1172    type Type = Self;
1173}
1174
1175#[cfg(feature = "v1_28")]
1176#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1177unsafe impl<'a> glib::value::FromValue<'a> for LogContextFlags {
1178    type Checker = glib::value::GenericValueTypeChecker<Self>;
1179
1180    #[inline]
1181    unsafe fn from_value(value: &'a glib::Value) -> Self {
1182        skip_assert_initialized!();
1183        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1184    }
1185}
1186
1187#[cfg(feature = "v1_28")]
1188#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1189impl ToValue for LogContextFlags {
1190    #[inline]
1191    fn to_value(&self) -> glib::Value {
1192        let mut value = glib::Value::for_value_type::<Self>();
1193        unsafe {
1194            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1195        }
1196        value
1197    }
1198
1199    #[inline]
1200    fn value_type(&self) -> glib::Type {
1201        Self::static_type()
1202    }
1203}
1204
1205#[cfg(feature = "v1_28")]
1206#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1207impl From<LogContextFlags> for glib::Value {
1208    #[inline]
1209    fn from(v: LogContextFlags) -> Self {
1210        skip_assert_initialized!();
1211        ToValue::to_value(&v)
1212    }
1213}
1214
1215#[cfg(feature = "v1_28")]
1216bitflags! {
1217    /// Flags to control how the message hash is calculated in a [`LogContext`][crate::LogContext].
1218    /// The message hash is used to determine if a message is a duplicate of a previously
1219    /// logged message.
1220    #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1221    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1222    #[doc(alias = "GstLogContextHashFlags")]
1223    pub struct LogContextHashFlags: u32 {
1224        /// Ignore object pointer or object ID when calculating message hash
1225        #[doc(alias = "GST_LOG_CONTEXT_IGNORE_OBJECT")]
1226        const IGNORE_OBJECT = ffi::GST_LOG_CONTEXT_IGNORE_OBJECT as _;
1227        /// Ignore the "format" part of the debug
1228        /// log message
1229        #[doc(alias = "GST_LOG_CONTEXT_IGNORE_FORMAT")]
1230        const IGNORE_FORMAT = ffi::GST_LOG_CONTEXT_IGNORE_FORMAT as _;
1231        /// Ignore file name when calculating message hash
1232        #[doc(alias = "GST_LOG_CONTEXT_IGNORE_FILE")]
1233        const IGNORE_FILE = ffi::GST_LOG_CONTEXT_IGNORE_FILE as _;
1234        /// Use line number when calculating message hash (not used by default)
1235        #[doc(alias = "GST_LOG_CONTEXT_USE_LINE_NUMBER")]
1236        const USE_LINE_NUMBER = ffi::GST_LOG_CONTEXT_USE_LINE_NUMBER as _;
1237        /// Use the arguments part of the string message (not used by default)
1238        #[doc(alias = "GST_LOG_CONTEXT_USE_STRING_ARGS")]
1239        const USE_STRING_ARGS = ffi::GST_LOG_CONTEXT_USE_STRING_ARGS as _;
1240    }
1241}
1242
1243#[cfg(feature = "v1_28")]
1244#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1245#[doc(hidden)]
1246impl IntoGlib for LogContextHashFlags {
1247    type GlibType = ffi::GstLogContextHashFlags;
1248
1249    #[inline]
1250    fn into_glib(self) -> ffi::GstLogContextHashFlags {
1251        self.bits()
1252    }
1253}
1254
1255#[cfg(feature = "v1_28")]
1256#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1257#[doc(hidden)]
1258impl FromGlib<ffi::GstLogContextHashFlags> for LogContextHashFlags {
1259    #[inline]
1260    unsafe fn from_glib(value: ffi::GstLogContextHashFlags) -> Self {
1261        skip_assert_initialized!();
1262        Self::from_bits_truncate(value)
1263    }
1264}
1265
1266#[cfg(feature = "v1_28")]
1267#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1268impl StaticType for LogContextHashFlags {
1269    #[inline]
1270    #[doc(alias = "gst_log_context_hash_flags_get_type")]
1271    fn static_type() -> glib::Type {
1272        unsafe { from_glib(ffi::gst_log_context_hash_flags_get_type()) }
1273    }
1274}
1275
1276#[cfg(feature = "v1_28")]
1277#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1278impl glib::HasParamSpec for LogContextHashFlags {
1279    type ParamSpec = glib::ParamSpecFlags;
1280    type SetValue = Self;
1281    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1282
1283    fn param_spec_builder() -> Self::BuilderFn {
1284        Self::ParamSpec::builder
1285    }
1286}
1287
1288#[cfg(feature = "v1_28")]
1289#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1290impl glib::value::ValueType for LogContextHashFlags {
1291    type Type = Self;
1292}
1293
1294#[cfg(feature = "v1_28")]
1295#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1296unsafe impl<'a> glib::value::FromValue<'a> for LogContextHashFlags {
1297    type Checker = glib::value::GenericValueTypeChecker<Self>;
1298
1299    #[inline]
1300    unsafe fn from_value(value: &'a glib::Value) -> Self {
1301        skip_assert_initialized!();
1302        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1303    }
1304}
1305
1306#[cfg(feature = "v1_28")]
1307#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1308impl ToValue for LogContextHashFlags {
1309    #[inline]
1310    fn to_value(&self) -> glib::Value {
1311        let mut value = glib::Value::for_value_type::<Self>();
1312        unsafe {
1313            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1314        }
1315        value
1316    }
1317
1318    #[inline]
1319    fn value_type(&self) -> glib::Type {
1320        Self::static_type()
1321    }
1322}
1323
1324#[cfg(feature = "v1_28")]
1325#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1326impl From<LogContextHashFlags> for glib::Value {
1327    #[inline]
1328    fn from(v: LogContextHashFlags) -> Self {
1329        skip_assert_initialized!();
1330        ToValue::to_value(&v)
1331    }
1332}
1333
1334bitflags! {
1335    /// Flags for wrapped memory.
1336    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1337    #[doc(alias = "GstMemoryFlags")]
1338    pub struct MemoryFlags: u32 {
1339        /// memory is readonly. It is not allowed to map the
1340        /// memory with `GST_MAP_WRITE`.
1341        #[doc(alias = "GST_MEMORY_FLAG_READONLY")]
1342        const READONLY = ffi::GST_MEMORY_FLAG_READONLY as _;
1343        /// memory must not be shared. Copies will have to be
1344        /// made when this memory needs to be shared between buffers. (DEPRECATED:
1345        /// do not use in new code, instead you should create a custom GstAllocator for
1346        /// memory pooling instead of relying on the GstBuffer they were originally
1347        /// attached to.)
1348        #[doc(alias = "GST_MEMORY_FLAG_NO_SHARE")]
1349        const NO_SHARE = ffi::GST_MEMORY_FLAG_NO_SHARE as _;
1350        /// the memory prefix is filled with 0 bytes
1351        #[doc(alias = "GST_MEMORY_FLAG_ZERO_PREFIXED")]
1352        const ZERO_PREFIXED = ffi::GST_MEMORY_FLAG_ZERO_PREFIXED as _;
1353        /// the memory padding is filled with 0 bytes
1354        #[doc(alias = "GST_MEMORY_FLAG_ZERO_PADDED")]
1355        const ZERO_PADDED = ffi::GST_MEMORY_FLAG_ZERO_PADDED as _;
1356        /// the memory is physically
1357        /// contiguous. (Since: 1.2)
1358        #[doc(alias = "GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS")]
1359        const PHYSICALLY_CONTIGUOUS = ffi::GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS as _;
1360        /// the memory can't be mapped via
1361        /// [`Memory::into_mapped_memory_readable()`][crate::Memory::into_mapped_memory_readable()] without any preconditions. (Since: 1.2)
1362        #[doc(alias = "GST_MEMORY_FLAG_NOT_MAPPABLE")]
1363        const NOT_MAPPABLE = ffi::GST_MEMORY_FLAG_NOT_MAPPABLE as _;
1364    }
1365}
1366
1367#[doc(hidden)]
1368impl IntoGlib for MemoryFlags {
1369    type GlibType = ffi::GstMemoryFlags;
1370
1371    #[inline]
1372    fn into_glib(self) -> ffi::GstMemoryFlags {
1373        self.bits()
1374    }
1375}
1376
1377#[doc(hidden)]
1378impl FromGlib<ffi::GstMemoryFlags> for MemoryFlags {
1379    #[inline]
1380    unsafe fn from_glib(value: ffi::GstMemoryFlags) -> Self {
1381        skip_assert_initialized!();
1382        Self::from_bits_truncate(value)
1383    }
1384}
1385
1386impl StaticType for MemoryFlags {
1387    #[inline]
1388    #[doc(alias = "gst_memory_flags_get_type")]
1389    fn static_type() -> glib::Type {
1390        unsafe { from_glib(ffi::gst_memory_flags_get_type()) }
1391    }
1392}
1393
1394impl glib::HasParamSpec for MemoryFlags {
1395    type ParamSpec = glib::ParamSpecFlags;
1396    type SetValue = Self;
1397    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1398
1399    fn param_spec_builder() -> Self::BuilderFn {
1400        Self::ParamSpec::builder
1401    }
1402}
1403
1404impl glib::value::ValueType for MemoryFlags {
1405    type Type = Self;
1406}
1407
1408unsafe impl<'a> glib::value::FromValue<'a> for MemoryFlags {
1409    type Checker = glib::value::GenericValueTypeChecker<Self>;
1410
1411    #[inline]
1412    unsafe fn from_value(value: &'a glib::Value) -> Self {
1413        skip_assert_initialized!();
1414        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1415    }
1416}
1417
1418impl ToValue for MemoryFlags {
1419    #[inline]
1420    fn to_value(&self) -> glib::Value {
1421        let mut value = glib::Value::for_value_type::<Self>();
1422        unsafe {
1423            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1424        }
1425        value
1426    }
1427
1428    #[inline]
1429    fn value_type(&self) -> glib::Type {
1430        Self::static_type()
1431    }
1432}
1433
1434impl From<MemoryFlags> for glib::Value {
1435    #[inline]
1436    fn from(v: MemoryFlags) -> Self {
1437        skip_assert_initialized!();
1438        ToValue::to_value(&v)
1439    }
1440}
1441
1442bitflags! {
1443    /// Extra metadata flags.
1444    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1445    #[doc(alias = "GstMetaFlags")]
1446    pub struct MetaFlags: u32 {
1447        /// metadata should not be modified
1448        #[doc(alias = "GST_META_FLAG_READONLY")]
1449        const READONLY = ffi::GST_META_FLAG_READONLY as _;
1450        /// metadata is managed by a bufferpool
1451        #[doc(alias = "GST_META_FLAG_POOLED")]
1452        const POOLED = ffi::GST_META_FLAG_POOLED as _;
1453        /// metadata should not be removed
1454        #[doc(alias = "GST_META_FLAG_LOCKED")]
1455        const LOCKED = ffi::GST_META_FLAG_LOCKED as _;
1456    }
1457}
1458
1459#[doc(hidden)]
1460impl IntoGlib for MetaFlags {
1461    type GlibType = ffi::GstMetaFlags;
1462
1463    #[inline]
1464    fn into_glib(self) -> ffi::GstMetaFlags {
1465        self.bits()
1466    }
1467}
1468
1469#[doc(hidden)]
1470impl FromGlib<ffi::GstMetaFlags> for MetaFlags {
1471    #[inline]
1472    unsafe fn from_glib(value: ffi::GstMetaFlags) -> Self {
1473        skip_assert_initialized!();
1474        Self::from_bits_truncate(value)
1475    }
1476}
1477
1478impl StaticType for MetaFlags {
1479    #[inline]
1480    #[doc(alias = "gst_meta_flags_get_type")]
1481    fn static_type() -> glib::Type {
1482        unsafe { from_glib(ffi::gst_meta_flags_get_type()) }
1483    }
1484}
1485
1486impl glib::HasParamSpec for MetaFlags {
1487    type ParamSpec = glib::ParamSpecFlags;
1488    type SetValue = Self;
1489    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1490
1491    fn param_spec_builder() -> Self::BuilderFn {
1492        Self::ParamSpec::builder
1493    }
1494}
1495
1496impl glib::value::ValueType for MetaFlags {
1497    type Type = Self;
1498}
1499
1500unsafe impl<'a> glib::value::FromValue<'a> for MetaFlags {
1501    type Checker = glib::value::GenericValueTypeChecker<Self>;
1502
1503    #[inline]
1504    unsafe fn from_value(value: &'a glib::Value) -> Self {
1505        skip_assert_initialized!();
1506        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1507    }
1508}
1509
1510impl ToValue for MetaFlags {
1511    #[inline]
1512    fn to_value(&self) -> glib::Value {
1513        let mut value = glib::Value::for_value_type::<Self>();
1514        unsafe {
1515            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1516        }
1517        value
1518    }
1519
1520    #[inline]
1521    fn value_type(&self) -> glib::Type {
1522        Self::static_type()
1523    }
1524}
1525
1526impl From<MetaFlags> for glib::Value {
1527    #[inline]
1528    fn from(v: MetaFlags) -> Self {
1529        skip_assert_initialized!();
1530        ToValue::to_value(&v)
1531    }
1532}
1533
1534bitflags! {
1535    /// The standard flags that an gstobject may have.
1536    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1537    #[doc(alias = "GstObjectFlags")]
1538    pub struct ObjectFlags: u32 {
1539        /// the object is expected to stay alive even
1540        /// after `gst_deinit()` has been called and so should be ignored by leak
1541        /// detection tools. (Since: 1.10)
1542        #[doc(alias = "GST_OBJECT_FLAG_MAY_BE_LEAKED")]
1543        const MAY_BE_LEAKED = ffi::GST_OBJECT_FLAG_MAY_BE_LEAKED as _;
1544        /// Flag that's set when the object has been constructed. This can be used by
1545        /// API such as base class setters to differentiate between the case where
1546        /// they're called from a subclass's instance init function (and where the
1547        /// object isn't fully constructed yet, and so one shouldn't do anything but
1548        /// set values in the instance structure), and the case where the object is
1549        /// constructed.
1550        #[cfg(feature = "v1_24")]
1551        #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1552        #[doc(alias = "GST_OBJECT_FLAG_CONSTRUCTED")]
1553        const CONSTRUCTED = ffi::GST_OBJECT_FLAG_CONSTRUCTED as _;
1554    }
1555}
1556
1557#[doc(hidden)]
1558impl IntoGlib for ObjectFlags {
1559    type GlibType = ffi::GstObjectFlags;
1560
1561    #[inline]
1562    fn into_glib(self) -> ffi::GstObjectFlags {
1563        self.bits()
1564    }
1565}
1566
1567#[doc(hidden)]
1568impl FromGlib<ffi::GstObjectFlags> for ObjectFlags {
1569    #[inline]
1570    unsafe fn from_glib(value: ffi::GstObjectFlags) -> Self {
1571        skip_assert_initialized!();
1572        Self::from_bits_truncate(value)
1573    }
1574}
1575
1576impl StaticType for ObjectFlags {
1577    #[inline]
1578    #[doc(alias = "gst_object_flags_get_type")]
1579    fn static_type() -> glib::Type {
1580        unsafe { from_glib(ffi::gst_object_flags_get_type()) }
1581    }
1582}
1583
1584impl glib::HasParamSpec for ObjectFlags {
1585    type ParamSpec = glib::ParamSpecFlags;
1586    type SetValue = Self;
1587    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1588
1589    fn param_spec_builder() -> Self::BuilderFn {
1590        Self::ParamSpec::builder
1591    }
1592}
1593
1594impl glib::value::ValueType for ObjectFlags {
1595    type Type = Self;
1596}
1597
1598unsafe impl<'a> glib::value::FromValue<'a> for ObjectFlags {
1599    type Checker = glib::value::GenericValueTypeChecker<Self>;
1600
1601    #[inline]
1602    unsafe fn from_value(value: &'a glib::Value) -> Self {
1603        skip_assert_initialized!();
1604        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1605    }
1606}
1607
1608impl ToValue for ObjectFlags {
1609    #[inline]
1610    fn to_value(&self) -> glib::Value {
1611        let mut value = glib::Value::for_value_type::<Self>();
1612        unsafe {
1613            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1614        }
1615        value
1616    }
1617
1618    #[inline]
1619    fn value_type(&self) -> glib::Type {
1620        Self::static_type()
1621    }
1622}
1623
1624impl From<ObjectFlags> for glib::Value {
1625    #[inline]
1626    fn from(v: ObjectFlags) -> Self {
1627        skip_assert_initialized!();
1628        ToValue::to_value(&v)
1629    }
1630}
1631
1632bitflags! {
1633    /// Pad state flags
1634    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1635    #[doc(alias = "GstPadFlags")]
1636    pub struct PadFlags: u32 {
1637        /// is dataflow on a pad blocked
1638        #[doc(alias = "GST_PAD_FLAG_BLOCKED")]
1639        const BLOCKED = ffi::GST_PAD_FLAG_BLOCKED as _;
1640        /// is pad flushing
1641        #[doc(alias = "GST_PAD_FLAG_FLUSHING")]
1642        const FLUSHING = ffi::GST_PAD_FLAG_FLUSHING as _;
1643        /// is pad in EOS state
1644        #[doc(alias = "GST_PAD_FLAG_EOS")]
1645        const EOS = ffi::GST_PAD_FLAG_EOS as _;
1646        /// is pad currently blocking on a buffer or event
1647        #[doc(alias = "GST_PAD_FLAG_BLOCKING")]
1648        const BLOCKING = ffi::GST_PAD_FLAG_BLOCKING as _;
1649        /// ensure that there is a parent object before calling
1650        ///  into the pad callbacks.
1651        #[doc(alias = "GST_PAD_FLAG_NEED_PARENT")]
1652        const NEED_PARENT = ffi::GST_PAD_FLAG_NEED_PARENT as _;
1653        /// the pad should be reconfigured/renegotiated.
1654        ///  The flag has to be unset manually after
1655        ///  reconfiguration happened.
1656        #[doc(alias = "GST_PAD_FLAG_NEED_RECONFIGURE")]
1657        const NEED_RECONFIGURE = ffi::GST_PAD_FLAG_NEED_RECONFIGURE as _;
1658        /// the pad has pending events
1659        #[doc(alias = "GST_PAD_FLAG_PENDING_EVENTS")]
1660        const PENDING_EVENTS = ffi::GST_PAD_FLAG_PENDING_EVENTS as _;
1661        /// the pad is using fixed caps. This means that
1662        ///  once the caps are set on the pad, the default caps query function
1663        ///  will only return those caps.
1664        #[doc(alias = "GST_PAD_FLAG_FIXED_CAPS")]
1665        const FIXED_CAPS = ffi::GST_PAD_FLAG_FIXED_CAPS as _;
1666        /// the default event and query handler will forward
1667        ///  all events and queries to the internally linked pads
1668        ///  instead of discarding them.
1669        #[doc(alias = "GST_PAD_FLAG_PROXY_CAPS")]
1670        const PROXY_CAPS = ffi::GST_PAD_FLAG_PROXY_CAPS as _;
1671        /// the default query handler will forward
1672        ///  allocation queries to the internally linked pads
1673        ///  instead of discarding them.
1674        #[doc(alias = "GST_PAD_FLAG_PROXY_ALLOCATION")]
1675        const PROXY_ALLOCATION = ffi::GST_PAD_FLAG_PROXY_ALLOCATION as _;
1676        /// the default query handler will forward
1677        ///  scheduling queries to the internally linked pads
1678        ///  instead of discarding them.
1679        #[doc(alias = "GST_PAD_FLAG_PROXY_SCHEDULING")]
1680        const PROXY_SCHEDULING = ffi::GST_PAD_FLAG_PROXY_SCHEDULING as _;
1681        /// the default accept-caps handler will check
1682        ///  it the caps intersect the query-caps result instead
1683        ///  of checking for a subset. This is interesting for
1684        ///  parsers that can accept incompletely specified caps.
1685        #[doc(alias = "GST_PAD_FLAG_ACCEPT_INTERSECT")]
1686        const ACCEPT_INTERSECT = ffi::GST_PAD_FLAG_ACCEPT_INTERSECT as _;
1687        /// the default accept-caps handler will use
1688        ///  the template pad caps instead of query caps to
1689        ///  compare with the accept caps. Use this in combination
1690        ///  with [`ACCEPT_INTERSECT`][Self::ACCEPT_INTERSECT]. (Since: 1.6)
1691        #[doc(alias = "GST_PAD_FLAG_ACCEPT_TEMPLATE")]
1692        const ACCEPT_TEMPLATE = ffi::GST_PAD_FLAG_ACCEPT_TEMPLATE as _;
1693    }
1694}
1695
1696#[doc(hidden)]
1697impl IntoGlib for PadFlags {
1698    type GlibType = ffi::GstPadFlags;
1699
1700    #[inline]
1701    fn into_glib(self) -> ffi::GstPadFlags {
1702        self.bits()
1703    }
1704}
1705
1706#[doc(hidden)]
1707impl FromGlib<ffi::GstPadFlags> for PadFlags {
1708    #[inline]
1709    unsafe fn from_glib(value: ffi::GstPadFlags) -> Self {
1710        skip_assert_initialized!();
1711        Self::from_bits_truncate(value)
1712    }
1713}
1714
1715impl StaticType for PadFlags {
1716    #[inline]
1717    #[doc(alias = "gst_pad_flags_get_type")]
1718    fn static_type() -> glib::Type {
1719        unsafe { from_glib(ffi::gst_pad_flags_get_type()) }
1720    }
1721}
1722
1723impl glib::HasParamSpec for PadFlags {
1724    type ParamSpec = glib::ParamSpecFlags;
1725    type SetValue = Self;
1726    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1727
1728    fn param_spec_builder() -> Self::BuilderFn {
1729        Self::ParamSpec::builder
1730    }
1731}
1732
1733impl glib::value::ValueType for PadFlags {
1734    type Type = Self;
1735}
1736
1737unsafe impl<'a> glib::value::FromValue<'a> for PadFlags {
1738    type Checker = glib::value::GenericValueTypeChecker<Self>;
1739
1740    #[inline]
1741    unsafe fn from_value(value: &'a glib::Value) -> Self {
1742        skip_assert_initialized!();
1743        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1744    }
1745}
1746
1747impl ToValue for PadFlags {
1748    #[inline]
1749    fn to_value(&self) -> glib::Value {
1750        let mut value = glib::Value::for_value_type::<Self>();
1751        unsafe {
1752            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1753        }
1754        value
1755    }
1756
1757    #[inline]
1758    fn value_type(&self) -> glib::Type {
1759        Self::static_type()
1760    }
1761}
1762
1763impl From<PadFlags> for glib::Value {
1764    #[inline]
1765    fn from(v: PadFlags) -> Self {
1766        skip_assert_initialized!();
1767        ToValue::to_value(&v)
1768    }
1769}
1770
1771bitflags! {
1772    /// The amount of checking to be done when linking pads. [`CAPS`][Self::CAPS]
1773    /// and [`TEMPLATE_CAPS`][Self::TEMPLATE_CAPS] are mutually exclusive. If both are
1774    /// specified, expensive but safe [`CAPS`][Self::CAPS] are performed.
1775    ///
1776    /// > Only disable some of the checks if you are 100% certain you know the link
1777    /// > will not fail because of hierarchy/caps compatibility failures. If uncertain,
1778    /// > use the default checks ([`DEFAULT`][Self::DEFAULT]) or the regular methods
1779    /// > for linking the pads.
1780    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1781    #[doc(alias = "GstPadLinkCheck")]
1782    pub struct PadLinkCheck: u32 {
1783        /// Check the pads have same parents/grandparents.
1784        ///  Could be omitted if it is already known that the two elements that own the
1785        ///  pads are in the same bin.
1786        #[doc(alias = "GST_PAD_LINK_CHECK_HIERARCHY")]
1787        const HIERARCHY = ffi::GST_PAD_LINK_CHECK_HIERARCHY as _;
1788        /// Check if the pads are compatible by using
1789        ///  their template caps. This is much faster than [`CAPS`][Self::CAPS], but
1790        ///  would be unsafe e.g. if one pad has `GST_CAPS_ANY`.
1791        #[doc(alias = "GST_PAD_LINK_CHECK_TEMPLATE_CAPS")]
1792        const TEMPLATE_CAPS = ffi::GST_PAD_LINK_CHECK_TEMPLATE_CAPS as _;
1793        /// Check if the pads are compatible by comparing the
1794        ///  caps returned by [`PadExt::query_caps()`][crate::prelude::PadExt::query_caps()].
1795        #[doc(alias = "GST_PAD_LINK_CHECK_CAPS")]
1796        const CAPS = ffi::GST_PAD_LINK_CHECK_CAPS as _;
1797        /// Disables pushing a reconfigure event when pads are
1798        ///  linked.
1799        #[doc(alias = "GST_PAD_LINK_CHECK_NO_RECONFIGURE")]
1800        const NO_RECONFIGURE = ffi::GST_PAD_LINK_CHECK_NO_RECONFIGURE as _;
1801        /// The default checks done when linking
1802        ///  pads (i.e. the ones used by [`PadExt::link()`][crate::prelude::PadExt::link()]).
1803        #[doc(alias = "GST_PAD_LINK_CHECK_DEFAULT")]
1804        const DEFAULT = ffi::GST_PAD_LINK_CHECK_DEFAULT as _;
1805    }
1806}
1807
1808#[doc(hidden)]
1809impl IntoGlib for PadLinkCheck {
1810    type GlibType = ffi::GstPadLinkCheck;
1811
1812    #[inline]
1813    fn into_glib(self) -> ffi::GstPadLinkCheck {
1814        self.bits()
1815    }
1816}
1817
1818#[doc(hidden)]
1819impl FromGlib<ffi::GstPadLinkCheck> for PadLinkCheck {
1820    #[inline]
1821    unsafe fn from_glib(value: ffi::GstPadLinkCheck) -> Self {
1822        skip_assert_initialized!();
1823        Self::from_bits_truncate(value)
1824    }
1825}
1826
1827impl StaticType for PadLinkCheck {
1828    #[inline]
1829    #[doc(alias = "gst_pad_link_check_get_type")]
1830    fn static_type() -> glib::Type {
1831        unsafe { from_glib(ffi::gst_pad_link_check_get_type()) }
1832    }
1833}
1834
1835impl glib::HasParamSpec for PadLinkCheck {
1836    type ParamSpec = glib::ParamSpecFlags;
1837    type SetValue = Self;
1838    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1839
1840    fn param_spec_builder() -> Self::BuilderFn {
1841        Self::ParamSpec::builder
1842    }
1843}
1844
1845impl glib::value::ValueType for PadLinkCheck {
1846    type Type = Self;
1847}
1848
1849unsafe impl<'a> glib::value::FromValue<'a> for PadLinkCheck {
1850    type Checker = glib::value::GenericValueTypeChecker<Self>;
1851
1852    #[inline]
1853    unsafe fn from_value(value: &'a glib::Value) -> Self {
1854        skip_assert_initialized!();
1855        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1856    }
1857}
1858
1859impl ToValue for PadLinkCheck {
1860    #[inline]
1861    fn to_value(&self) -> glib::Value {
1862        let mut value = glib::Value::for_value_type::<Self>();
1863        unsafe {
1864            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1865        }
1866        value
1867    }
1868
1869    #[inline]
1870    fn value_type(&self) -> glib::Type {
1871        Self::static_type()
1872    }
1873}
1874
1875impl From<PadLinkCheck> for glib::Value {
1876    #[inline]
1877    fn from(v: PadLinkCheck) -> Self {
1878        skip_assert_initialized!();
1879        ToValue::to_value(&v)
1880    }
1881}
1882
1883bitflags! {
1884    /// The different probing types that can occur. When either one of
1885    /// [`IDLE`][Self::IDLE] or [`BLOCK`][Self::BLOCK] is used, the probe will be a
1886    /// blocking probe.
1887    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1888    #[doc(alias = "GstPadProbeType")]
1889    pub struct PadProbeType: u32 {
1890        /// probe idle pads and block while the callback is called
1891        #[doc(alias = "GST_PAD_PROBE_TYPE_IDLE")]
1892        const IDLE = ffi::GST_PAD_PROBE_TYPE_IDLE as _;
1893        /// probe and block pads
1894        #[doc(alias = "GST_PAD_PROBE_TYPE_BLOCK")]
1895        const BLOCK = ffi::GST_PAD_PROBE_TYPE_BLOCK as _;
1896        /// probe buffers
1897        #[doc(alias = "GST_PAD_PROBE_TYPE_BUFFER")]
1898        const BUFFER = ffi::GST_PAD_PROBE_TYPE_BUFFER as _;
1899        /// probe buffer lists
1900        #[doc(alias = "GST_PAD_PROBE_TYPE_BUFFER_LIST")]
1901        const BUFFER_LIST = ffi::GST_PAD_PROBE_TYPE_BUFFER_LIST as _;
1902        /// probe downstream events
1903        #[doc(alias = "GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM")]
1904        const EVENT_DOWNSTREAM = ffi::GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM as _;
1905        /// probe upstream events
1906        #[doc(alias = "GST_PAD_PROBE_TYPE_EVENT_UPSTREAM")]
1907        const EVENT_UPSTREAM = ffi::GST_PAD_PROBE_TYPE_EVENT_UPSTREAM as _;
1908        /// probe flush events. This probe has to be
1909        ///  explicitly enabled and is not included in the
1910        ///  @[`EVENT_DOWNSTREAM`][Self::EVENT_DOWNSTREAM] or
1911        ///  @[`EVENT_UPSTREAM`][Self::EVENT_UPSTREAM] probe types.
1912        #[doc(alias = "GST_PAD_PROBE_TYPE_EVENT_FLUSH")]
1913        const EVENT_FLUSH = ffi::GST_PAD_PROBE_TYPE_EVENT_FLUSH as _;
1914        /// probe downstream queries
1915        #[doc(alias = "GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM")]
1916        const QUERY_DOWNSTREAM = ffi::GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM as _;
1917        /// probe upstream queries
1918        #[doc(alias = "GST_PAD_PROBE_TYPE_QUERY_UPSTREAM")]
1919        const QUERY_UPSTREAM = ffi::GST_PAD_PROBE_TYPE_QUERY_UPSTREAM as _;
1920        /// probe push
1921        #[doc(alias = "GST_PAD_PROBE_TYPE_PUSH")]
1922        const PUSH = ffi::GST_PAD_PROBE_TYPE_PUSH as _;
1923        /// probe pull
1924        #[doc(alias = "GST_PAD_PROBE_TYPE_PULL")]
1925        const PULL = ffi::GST_PAD_PROBE_TYPE_PULL as _;
1926        /// probe and block at the next opportunity, at data flow or when idle
1927        #[doc(alias = "GST_PAD_PROBE_TYPE_BLOCKING")]
1928        const BLOCKING = ffi::GST_PAD_PROBE_TYPE_BLOCKING as _;
1929        /// probe downstream data (buffers, buffer lists, and events)
1930        #[doc(alias = "GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM")]
1931        const DATA_DOWNSTREAM = ffi::GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM as _;
1932        /// probe upstream data (events)
1933        #[doc(alias = "GST_PAD_PROBE_TYPE_DATA_UPSTREAM")]
1934        const DATA_UPSTREAM = ffi::GST_PAD_PROBE_TYPE_DATA_UPSTREAM as _;
1935        /// probe upstream and downstream data (buffers, buffer lists, and events)
1936        #[doc(alias = "GST_PAD_PROBE_TYPE_DATA_BOTH")]
1937        const DATA_BOTH = ffi::GST_PAD_PROBE_TYPE_DATA_BOTH as _;
1938        /// probe and block downstream data (buffers, buffer lists, and events)
1939        #[doc(alias = "GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM")]
1940        const BLOCK_DOWNSTREAM = ffi::GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM as _;
1941        /// probe and block upstream data (events)
1942        #[doc(alias = "GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM")]
1943        const BLOCK_UPSTREAM = ffi::GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM as _;
1944        /// probe upstream and downstream events
1945        #[doc(alias = "GST_PAD_PROBE_TYPE_EVENT_BOTH")]
1946        const EVENT_BOTH = ffi::GST_PAD_PROBE_TYPE_EVENT_BOTH as _;
1947        /// probe upstream and downstream queries
1948        #[doc(alias = "GST_PAD_PROBE_TYPE_QUERY_BOTH")]
1949        const QUERY_BOTH = ffi::GST_PAD_PROBE_TYPE_QUERY_BOTH as _;
1950        /// probe upstream events and queries and downstream buffers, buffer lists, events and queries
1951        #[doc(alias = "GST_PAD_PROBE_TYPE_ALL_BOTH")]
1952        const ALL_BOTH = ffi::GST_PAD_PROBE_TYPE_ALL_BOTH as _;
1953        /// probe push and pull
1954        #[doc(alias = "GST_PAD_PROBE_TYPE_SCHEDULING")]
1955        const SCHEDULING = ffi::GST_PAD_PROBE_TYPE_SCHEDULING as _;
1956    }
1957}
1958
1959#[doc(hidden)]
1960impl IntoGlib for PadProbeType {
1961    type GlibType = ffi::GstPadProbeType;
1962
1963    #[inline]
1964    fn into_glib(self) -> ffi::GstPadProbeType {
1965        self.bits()
1966    }
1967}
1968
1969#[doc(hidden)]
1970impl FromGlib<ffi::GstPadProbeType> for PadProbeType {
1971    #[inline]
1972    unsafe fn from_glib(value: ffi::GstPadProbeType) -> Self {
1973        skip_assert_initialized!();
1974        Self::from_bits_truncate(value)
1975    }
1976}
1977
1978impl StaticType for PadProbeType {
1979    #[inline]
1980    #[doc(alias = "gst_pad_probe_type_get_type")]
1981    fn static_type() -> glib::Type {
1982        unsafe { from_glib(ffi::gst_pad_probe_type_get_type()) }
1983    }
1984}
1985
1986impl glib::HasParamSpec for PadProbeType {
1987    type ParamSpec = glib::ParamSpecFlags;
1988    type SetValue = Self;
1989    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1990
1991    fn param_spec_builder() -> Self::BuilderFn {
1992        Self::ParamSpec::builder
1993    }
1994}
1995
1996impl glib::value::ValueType for PadProbeType {
1997    type Type = Self;
1998}
1999
2000unsafe impl<'a> glib::value::FromValue<'a> for PadProbeType {
2001    type Checker = glib::value::GenericValueTypeChecker<Self>;
2002
2003    #[inline]
2004    unsafe fn from_value(value: &'a glib::Value) -> Self {
2005        skip_assert_initialized!();
2006        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2007    }
2008}
2009
2010impl ToValue for PadProbeType {
2011    #[inline]
2012    fn to_value(&self) -> glib::Value {
2013        let mut value = glib::Value::for_value_type::<Self>();
2014        unsafe {
2015            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2016        }
2017        value
2018    }
2019
2020    #[inline]
2021    fn value_type(&self) -> glib::Type {
2022        Self::static_type()
2023    }
2024}
2025
2026impl From<PadProbeType> for glib::Value {
2027    #[inline]
2028    fn from(v: PadProbeType) -> Self {
2029        skip_assert_initialized!();
2030        ToValue::to_value(&v)
2031    }
2032}
2033
2034bitflags! {
2035    /// Parsing options.
2036    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2037    #[doc(alias = "GstParseFlags")]
2038    pub struct ParseFlags: u32 {
2039        /// Always return [`None`] when an error occurs
2040        ///  (default behaviour is to return partially constructed bins or elements
2041        ///  in some cases)
2042        #[doc(alias = "GST_PARSE_FLAG_FATAL_ERRORS")]
2043        const FATAL_ERRORS = ffi::GST_PARSE_FLAG_FATAL_ERRORS as _;
2044        /// If a bin only has a single element,
2045        ///  just return the element.
2046        #[doc(alias = "GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS")]
2047        const NO_SINGLE_ELEMENT_BINS = ffi::GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS as _;
2048        /// If more than one toplevel element is described
2049        ///  by the pipeline description string, put them in a [`Bin`][crate::Bin] instead of a
2050        ///  [`Pipeline`][crate::Pipeline]. (Since: 1.10)
2051        #[doc(alias = "GST_PARSE_FLAG_PLACE_IN_BIN")]
2052        const PLACE_IN_BIN = ffi::GST_PARSE_FLAG_PLACE_IN_BIN as _;
2053    }
2054}
2055
2056#[doc(hidden)]
2057impl IntoGlib for ParseFlags {
2058    type GlibType = ffi::GstParseFlags;
2059
2060    #[inline]
2061    fn into_glib(self) -> ffi::GstParseFlags {
2062        self.bits()
2063    }
2064}
2065
2066#[doc(hidden)]
2067impl FromGlib<ffi::GstParseFlags> for ParseFlags {
2068    #[inline]
2069    unsafe fn from_glib(value: ffi::GstParseFlags) -> Self {
2070        skip_assert_initialized!();
2071        Self::from_bits_truncate(value)
2072    }
2073}
2074
2075impl StaticType for ParseFlags {
2076    #[inline]
2077    #[doc(alias = "gst_parse_flags_get_type")]
2078    fn static_type() -> glib::Type {
2079        unsafe { from_glib(ffi::gst_parse_flags_get_type()) }
2080    }
2081}
2082
2083impl glib::HasParamSpec for ParseFlags {
2084    type ParamSpec = glib::ParamSpecFlags;
2085    type SetValue = Self;
2086    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2087
2088    fn param_spec_builder() -> Self::BuilderFn {
2089        Self::ParamSpec::builder
2090    }
2091}
2092
2093impl glib::value::ValueType for ParseFlags {
2094    type Type = Self;
2095}
2096
2097unsafe impl<'a> glib::value::FromValue<'a> for ParseFlags {
2098    type Checker = glib::value::GenericValueTypeChecker<Self>;
2099
2100    #[inline]
2101    unsafe fn from_value(value: &'a glib::Value) -> Self {
2102        skip_assert_initialized!();
2103        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2104    }
2105}
2106
2107impl ToValue for ParseFlags {
2108    #[inline]
2109    fn to_value(&self) -> glib::Value {
2110        let mut value = glib::Value::for_value_type::<Self>();
2111        unsafe {
2112            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2113        }
2114        value
2115    }
2116
2117    #[inline]
2118    fn value_type(&self) -> glib::Type {
2119        Self::static_type()
2120    }
2121}
2122
2123impl From<ParseFlags> for glib::Value {
2124    #[inline]
2125    fn from(v: ParseFlags) -> Self {
2126        skip_assert_initialized!();
2127        ToValue::to_value(&v)
2128    }
2129}
2130
2131bitflags! {
2132    /// Pipeline flags
2133    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2134    #[doc(alias = "GstPipelineFlags")]
2135    pub struct PipelineFlags: u32 {
2136        /// this pipeline works with a fixed clock
2137        #[doc(alias = "GST_PIPELINE_FLAG_FIXED_CLOCK")]
2138        const FIXED_CLOCK = ffi::GST_PIPELINE_FLAG_FIXED_CLOCK as _;
2139    }
2140}
2141
2142#[doc(hidden)]
2143impl IntoGlib for PipelineFlags {
2144    type GlibType = ffi::GstPipelineFlags;
2145
2146    #[inline]
2147    fn into_glib(self) -> ffi::GstPipelineFlags {
2148        self.bits()
2149    }
2150}
2151
2152#[doc(hidden)]
2153impl FromGlib<ffi::GstPipelineFlags> for PipelineFlags {
2154    #[inline]
2155    unsafe fn from_glib(value: ffi::GstPipelineFlags) -> Self {
2156        skip_assert_initialized!();
2157        Self::from_bits_truncate(value)
2158    }
2159}
2160
2161impl StaticType for PipelineFlags {
2162    #[inline]
2163    #[doc(alias = "gst_pipeline_flags_get_type")]
2164    fn static_type() -> glib::Type {
2165        unsafe { from_glib(ffi::gst_pipeline_flags_get_type()) }
2166    }
2167}
2168
2169impl glib::HasParamSpec for PipelineFlags {
2170    type ParamSpec = glib::ParamSpecFlags;
2171    type SetValue = Self;
2172    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2173
2174    fn param_spec_builder() -> Self::BuilderFn {
2175        Self::ParamSpec::builder
2176    }
2177}
2178
2179impl glib::value::ValueType for PipelineFlags {
2180    type Type = Self;
2181}
2182
2183unsafe impl<'a> glib::value::FromValue<'a> for PipelineFlags {
2184    type Checker = glib::value::GenericValueTypeChecker<Self>;
2185
2186    #[inline]
2187    unsafe fn from_value(value: &'a glib::Value) -> Self {
2188        skip_assert_initialized!();
2189        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2190    }
2191}
2192
2193impl ToValue for PipelineFlags {
2194    #[inline]
2195    fn to_value(&self) -> glib::Value {
2196        let mut value = glib::Value::for_value_type::<Self>();
2197        unsafe {
2198            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2199        }
2200        value
2201    }
2202
2203    #[inline]
2204    fn value_type(&self) -> glib::Type {
2205        Self::static_type()
2206    }
2207}
2208
2209impl From<PipelineFlags> for glib::Value {
2210    #[inline]
2211    fn from(v: PipelineFlags) -> Self {
2212        skip_assert_initialized!();
2213        ToValue::to_value(&v)
2214    }
2215}
2216
2217#[cfg(feature = "v1_18")]
2218bitflags! {
2219    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2220    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2221    #[doc(alias = "GstPluginAPIFlags")]
2222    pub struct PluginAPIFlags: u32 {
2223        /// Ignore enum members when generating
2224        ///  the plugins cache. This is useful if the members of the enum are generated
2225        ///  dynamically, in order not to expose incorrect documentation to the end user.
2226        #[doc(alias = "GST_PLUGIN_API_FLAG_IGNORE_ENUM_MEMBERS")]
2227        const MEMBERS = ffi::GST_PLUGIN_API_FLAG_IGNORE_ENUM_MEMBERS as _;
2228    }
2229}
2230
2231#[cfg(feature = "v1_18")]
2232#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2233#[doc(hidden)]
2234impl IntoGlib for PluginAPIFlags {
2235    type GlibType = ffi::GstPluginAPIFlags;
2236
2237    #[inline]
2238    fn into_glib(self) -> ffi::GstPluginAPIFlags {
2239        self.bits()
2240    }
2241}
2242
2243#[cfg(feature = "v1_18")]
2244#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2245#[doc(hidden)]
2246impl FromGlib<ffi::GstPluginAPIFlags> for PluginAPIFlags {
2247    #[inline]
2248    unsafe fn from_glib(value: ffi::GstPluginAPIFlags) -> Self {
2249        skip_assert_initialized!();
2250        Self::from_bits_truncate(value)
2251    }
2252}
2253
2254#[cfg(feature = "v1_18")]
2255#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2256impl StaticType for PluginAPIFlags {
2257    #[inline]
2258    #[doc(alias = "gst_plugin_api_flags_get_type")]
2259    fn static_type() -> glib::Type {
2260        unsafe { from_glib(ffi::gst_plugin_api_flags_get_type()) }
2261    }
2262}
2263
2264#[cfg(feature = "v1_18")]
2265#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2266impl glib::HasParamSpec for PluginAPIFlags {
2267    type ParamSpec = glib::ParamSpecFlags;
2268    type SetValue = Self;
2269    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2270
2271    fn param_spec_builder() -> Self::BuilderFn {
2272        Self::ParamSpec::builder
2273    }
2274}
2275
2276#[cfg(feature = "v1_18")]
2277#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2278impl glib::value::ValueType for PluginAPIFlags {
2279    type Type = Self;
2280}
2281
2282#[cfg(feature = "v1_18")]
2283#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2284unsafe impl<'a> glib::value::FromValue<'a> for PluginAPIFlags {
2285    type Checker = glib::value::GenericValueTypeChecker<Self>;
2286
2287    #[inline]
2288    unsafe fn from_value(value: &'a glib::Value) -> Self {
2289        skip_assert_initialized!();
2290        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2291    }
2292}
2293
2294#[cfg(feature = "v1_18")]
2295#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2296impl ToValue for PluginAPIFlags {
2297    #[inline]
2298    fn to_value(&self) -> glib::Value {
2299        let mut value = glib::Value::for_value_type::<Self>();
2300        unsafe {
2301            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2302        }
2303        value
2304    }
2305
2306    #[inline]
2307    fn value_type(&self) -> glib::Type {
2308        Self::static_type()
2309    }
2310}
2311
2312#[cfg(feature = "v1_18")]
2313#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2314impl From<PluginAPIFlags> for glib::Value {
2315    #[inline]
2316    fn from(v: PluginAPIFlags) -> Self {
2317        skip_assert_initialized!();
2318        ToValue::to_value(&v)
2319    }
2320}
2321
2322bitflags! {
2323    /// Flags used in connection with [`Plugin::add_dependency()`][crate::Plugin::add_dependency()].
2324    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2325    #[doc(alias = "GstPluginDependencyFlags")]
2326    pub struct PluginDependencyFlags: u32 {
2327        /// recurse into subdirectories
2328        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_RECURSE")]
2329        const RECURSE = ffi::GST_PLUGIN_DEPENDENCY_FLAG_RECURSE as _;
2330        /// use paths
2331        ///  argument only if none of the environment variables is set
2332        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY")]
2333        const PATHS_ARE_DEFAULT_ONLY = ffi::GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY as _;
2334        /// interpret
2335        ///  filename argument as filter suffix and check all matching files in
2336        ///  the directory
2337        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX")]
2338        const FILE_NAME_IS_SUFFIX = ffi::GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX as _;
2339        /// interpret
2340        ///  filename argument as filter prefix and check all matching files in
2341        ///  the directory. Since: 1.8.
2342        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX")]
2343        const FILE_NAME_IS_PREFIX = ffi::GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX as _;
2344        /// interpret
2345        ///  non-absolute paths as relative to the main executable directory. Since
2346        ///  1.14.
2347        #[doc(alias = "GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_RELATIVE_TO_EXE")]
2348        const PATHS_ARE_RELATIVE_TO_EXE = ffi::GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_RELATIVE_TO_EXE as _;
2349    }
2350}
2351
2352#[doc(hidden)]
2353impl IntoGlib for PluginDependencyFlags {
2354    type GlibType = ffi::GstPluginDependencyFlags;
2355
2356    #[inline]
2357    fn into_glib(self) -> ffi::GstPluginDependencyFlags {
2358        self.bits()
2359    }
2360}
2361
2362#[doc(hidden)]
2363impl FromGlib<ffi::GstPluginDependencyFlags> for PluginDependencyFlags {
2364    #[inline]
2365    unsafe fn from_glib(value: ffi::GstPluginDependencyFlags) -> Self {
2366        skip_assert_initialized!();
2367        Self::from_bits_truncate(value)
2368    }
2369}
2370
2371impl StaticType for PluginDependencyFlags {
2372    #[inline]
2373    #[doc(alias = "gst_plugin_dependency_flags_get_type")]
2374    fn static_type() -> glib::Type {
2375        unsafe { from_glib(ffi::gst_plugin_dependency_flags_get_type()) }
2376    }
2377}
2378
2379impl glib::HasParamSpec for PluginDependencyFlags {
2380    type ParamSpec = glib::ParamSpecFlags;
2381    type SetValue = Self;
2382    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2383
2384    fn param_spec_builder() -> Self::BuilderFn {
2385        Self::ParamSpec::builder
2386    }
2387}
2388
2389impl glib::value::ValueType for PluginDependencyFlags {
2390    type Type = Self;
2391}
2392
2393unsafe impl<'a> glib::value::FromValue<'a> for PluginDependencyFlags {
2394    type Checker = glib::value::GenericValueTypeChecker<Self>;
2395
2396    #[inline]
2397    unsafe fn from_value(value: &'a glib::Value) -> Self {
2398        skip_assert_initialized!();
2399        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2400    }
2401}
2402
2403impl ToValue for PluginDependencyFlags {
2404    #[inline]
2405    fn to_value(&self) -> glib::Value {
2406        let mut value = glib::Value::for_value_type::<Self>();
2407        unsafe {
2408            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2409        }
2410        value
2411    }
2412
2413    #[inline]
2414    fn value_type(&self) -> glib::Type {
2415        Self::static_type()
2416    }
2417}
2418
2419impl From<PluginDependencyFlags> for glib::Value {
2420    #[inline]
2421    fn from(v: PluginDependencyFlags) -> Self {
2422        skip_assert_initialized!();
2423        ToValue::to_value(&v)
2424    }
2425}
2426
2427bitflags! {
2428    /// The plugin loading state
2429    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2430    #[doc(alias = "GstPluginFlags")]
2431    pub struct PluginFlags: u32 {
2432        /// Temporarily loaded plugins
2433        #[doc(alias = "GST_PLUGIN_FLAG_CACHED")]
2434        const CACHED = ffi::GST_PLUGIN_FLAG_CACHED as _;
2435        /// The plugin won't be scanned (again)
2436        #[doc(alias = "GST_PLUGIN_FLAG_BLACKLISTED")]
2437        const BLACKLISTED = ffi::GST_PLUGIN_FLAG_BLACKLISTED as _;
2438    }
2439}
2440
2441#[doc(hidden)]
2442impl IntoGlib for PluginFlags {
2443    type GlibType = ffi::GstPluginFlags;
2444
2445    #[inline]
2446    fn into_glib(self) -> ffi::GstPluginFlags {
2447        self.bits()
2448    }
2449}
2450
2451#[doc(hidden)]
2452impl FromGlib<ffi::GstPluginFlags> for PluginFlags {
2453    #[inline]
2454    unsafe fn from_glib(value: ffi::GstPluginFlags) -> Self {
2455        skip_assert_initialized!();
2456        Self::from_bits_truncate(value)
2457    }
2458}
2459
2460impl StaticType for PluginFlags {
2461    #[inline]
2462    #[doc(alias = "gst_plugin_flags_get_type")]
2463    fn static_type() -> glib::Type {
2464        unsafe { from_glib(ffi::gst_plugin_flags_get_type()) }
2465    }
2466}
2467
2468impl glib::HasParamSpec for PluginFlags {
2469    type ParamSpec = glib::ParamSpecFlags;
2470    type SetValue = Self;
2471    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2472
2473    fn param_spec_builder() -> Self::BuilderFn {
2474        Self::ParamSpec::builder
2475    }
2476}
2477
2478impl glib::value::ValueType for PluginFlags {
2479    type Type = Self;
2480}
2481
2482unsafe impl<'a> glib::value::FromValue<'a> for PluginFlags {
2483    type Checker = glib::value::GenericValueTypeChecker<Self>;
2484
2485    #[inline]
2486    unsafe fn from_value(value: &'a glib::Value) -> Self {
2487        skip_assert_initialized!();
2488        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2489    }
2490}
2491
2492impl ToValue for PluginFlags {
2493    #[inline]
2494    fn to_value(&self) -> glib::Value {
2495        let mut value = glib::Value::for_value_type::<Self>();
2496        unsafe {
2497            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2498        }
2499        value
2500    }
2501
2502    #[inline]
2503    fn value_type(&self) -> glib::Type {
2504        Self::static_type()
2505    }
2506}
2507
2508impl From<PluginFlags> for glib::Value {
2509    #[inline]
2510    fn from(v: PluginFlags) -> Self {
2511        skip_assert_initialized!();
2512        ToValue::to_value(&v)
2513    }
2514}
2515
2516bitflags! {
2517    /// The different scheduling flags.
2518    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2519    #[doc(alias = "GstSchedulingFlags")]
2520    pub struct SchedulingFlags: u32 {
2521        /// if seeking is possible
2522        #[doc(alias = "GST_SCHEDULING_FLAG_SEEKABLE")]
2523        const SEEKABLE = ffi::GST_SCHEDULING_FLAG_SEEKABLE as _;
2524        /// if sequential access is recommended
2525        #[doc(alias = "GST_SCHEDULING_FLAG_SEQUENTIAL")]
2526        const SEQUENTIAL = ffi::GST_SCHEDULING_FLAG_SEQUENTIAL as _;
2527        /// if bandwidth is limited and buffering possible (since 1.2)
2528        #[doc(alias = "GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED")]
2529        const BANDWIDTH_LIMITED = ffi::GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED as _;
2530    }
2531}
2532
2533#[doc(hidden)]
2534impl IntoGlib for SchedulingFlags {
2535    type GlibType = ffi::GstSchedulingFlags;
2536
2537    #[inline]
2538    fn into_glib(self) -> ffi::GstSchedulingFlags {
2539        self.bits()
2540    }
2541}
2542
2543#[doc(hidden)]
2544impl FromGlib<ffi::GstSchedulingFlags> for SchedulingFlags {
2545    #[inline]
2546    unsafe fn from_glib(value: ffi::GstSchedulingFlags) -> Self {
2547        skip_assert_initialized!();
2548        Self::from_bits_truncate(value)
2549    }
2550}
2551
2552impl StaticType for SchedulingFlags {
2553    #[inline]
2554    #[doc(alias = "gst_scheduling_flags_get_type")]
2555    fn static_type() -> glib::Type {
2556        unsafe { from_glib(ffi::gst_scheduling_flags_get_type()) }
2557    }
2558}
2559
2560impl glib::HasParamSpec for SchedulingFlags {
2561    type ParamSpec = glib::ParamSpecFlags;
2562    type SetValue = Self;
2563    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2564
2565    fn param_spec_builder() -> Self::BuilderFn {
2566        Self::ParamSpec::builder
2567    }
2568}
2569
2570impl glib::value::ValueType for SchedulingFlags {
2571    type Type = Self;
2572}
2573
2574unsafe impl<'a> glib::value::FromValue<'a> for SchedulingFlags {
2575    type Checker = glib::value::GenericValueTypeChecker<Self>;
2576
2577    #[inline]
2578    unsafe fn from_value(value: &'a glib::Value) -> Self {
2579        skip_assert_initialized!();
2580        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2581    }
2582}
2583
2584impl ToValue for SchedulingFlags {
2585    #[inline]
2586    fn to_value(&self) -> glib::Value {
2587        let mut value = glib::Value::for_value_type::<Self>();
2588        unsafe {
2589            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2590        }
2591        value
2592    }
2593
2594    #[inline]
2595    fn value_type(&self) -> glib::Type {
2596        Self::static_type()
2597    }
2598}
2599
2600impl From<SchedulingFlags> for glib::Value {
2601    #[inline]
2602    fn from(v: SchedulingFlags) -> Self {
2603        skip_assert_initialized!();
2604        ToValue::to_value(&v)
2605    }
2606}
2607
2608bitflags! {
2609    /// Flags to be used with [`ElementExtManual::seek()`][crate::prelude::ElementExtManual::seek()] or `gst_event_new_seek()`. All flags
2610    /// can be used together.
2611    ///
2612    /// A non flushing seek might take some time to perform as the currently
2613    /// playing data in the pipeline will not be cleared.
2614    ///
2615    /// An accurate seek might be slower for formats that don't have any indexes
2616    /// or timestamp markers in the stream. Specifying this flag might require a
2617    /// complete scan of the file in those cases.
2618    ///
2619    /// When performing a segment seek: after the playback of the segment completes,
2620    /// no EOS will be emitted by the element that performed the seek, but a
2621    /// `GST_MESSAGE_SEGMENT_DONE` message will be posted on the bus by the element.
2622    /// When this message is posted, it is possible to send a new seek event to
2623    /// continue playback. With this seek method it is possible to perform seamless
2624    /// looping or simple linear editing.
2625    ///
2626    /// When only changing the playback rate and not the direction, the
2627    /// [`INSTANT_RATE_CHANGE`][Self::INSTANT_RATE_CHANGE] flag can be used for a non-flushing seek
2628    /// to signal that the rate change should be applied immediately. This requires
2629    /// special support in the seek handlers (e.g. demuxers) and any elements
2630    /// synchronizing to the clock, and in general can't work in all cases (for example
2631    /// UDP streaming where the delivery rate is controlled by a remote server). The
2632    /// instant-rate-change mode supports changing the trickmode-related GST_SEEK_ flags,
2633    /// but can't be used in conjunction with other seek flags that affect the new
2634    /// playback position - as the playback position will not be changing.
2635    ///
2636    /// When doing fast forward (rate > 1.0) or fast reverse (rate < -1.0) trickmode
2637    /// playback, the [`TRICKMODE`][Self::TRICKMODE] flag can be used to instruct decoders
2638    /// and demuxers to adjust the playback rate by skipping frames. This can improve
2639    /// performance and decrease CPU usage because not all frames need to be decoded.
2640    ///
2641    /// Beyond that, the [`TRICKMODE_KEY_UNITS`][Self::TRICKMODE_KEY_UNITS] flag can be used to
2642    /// request that decoders skip all frames except key units, and
2643    /// [`TRICKMODE_NO_AUDIO`][Self::TRICKMODE_NO_AUDIO] flags can be used to request that audio
2644    /// decoders do no decoding at all, and simple output silence.
2645    ///
2646    /// The [`SNAP_BEFORE`][Self::SNAP_BEFORE] flag can be used to snap to the previous
2647    /// relevant location, and the [`SNAP_AFTER`][Self::SNAP_AFTER] flag can be used to
2648    /// select the next relevant location. If [`KEY_UNIT`][Self::KEY_UNIT] is specified,
2649    /// the relevant location is a keyframe. If both flags are specified, the nearest
2650    /// of these locations will be selected. If none are specified, the implementation is
2651    /// free to select whichever it wants.
2652    ///
2653    /// The before and after here are in running time, so when playing backwards,
2654    /// the next location refers to the one that will played in next, and not the
2655    /// one that is located after in the actual source stream.
2656    ///
2657    /// Also see part-seeking.txt in the GStreamer design documentation for more
2658    /// details on the meaning of these flags and the behaviour expected of
2659    /// elements that handle them.
2660    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2661    #[doc(alias = "GstSeekFlags")]
2662    pub struct SeekFlags: u32 {
2663        /// flush pipeline
2664        #[doc(alias = "GST_SEEK_FLAG_FLUSH")]
2665        const FLUSH = ffi::GST_SEEK_FLAG_FLUSH as _;
2666        /// accurate position is requested, this might
2667        ///  be considerably slower for some formats.
2668        #[doc(alias = "GST_SEEK_FLAG_ACCURATE")]
2669        const ACCURATE = ffi::GST_SEEK_FLAG_ACCURATE as _;
2670        /// seek to the nearest keyframe. This might be
2671        ///  faster but less accurate.
2672        #[doc(alias = "GST_SEEK_FLAG_KEY_UNIT")]
2673        const KEY_UNIT = ffi::GST_SEEK_FLAG_KEY_UNIT as _;
2674        /// perform a segment seek.
2675        #[doc(alias = "GST_SEEK_FLAG_SEGMENT")]
2676        const SEGMENT = ffi::GST_SEEK_FLAG_SEGMENT as _;
2677        /// when doing fast forward or fast reverse playback, allow
2678        ///  elements to skip frames instead of generating all
2679        ///  frames. (Since: 1.6)
2680        #[doc(alias = "GST_SEEK_FLAG_TRICKMODE")]
2681        const TRICKMODE = ffi::GST_SEEK_FLAG_TRICKMODE as _;
2682        /// Deprecated backward compatibility flag, replaced
2683        ///  by [`TRICKMODE`][Self::TRICKMODE]
2684        #[doc(alias = "GST_SEEK_FLAG_SKIP")]
2685        const SKIP = ffi::GST_SEEK_FLAG_SKIP as _;
2686        /// go to a location before the requested position,
2687        ///  if [`KEY_UNIT`][Self::KEY_UNIT] this means the keyframe at or before
2688        ///  the requested position the one at or before the seek target.
2689        #[doc(alias = "GST_SEEK_FLAG_SNAP_BEFORE")]
2690        const SNAP_BEFORE = ffi::GST_SEEK_FLAG_SNAP_BEFORE as _;
2691        /// go to a location after the requested position,
2692        ///  if [`KEY_UNIT`][Self::KEY_UNIT] this means the keyframe at of after the
2693        ///  requested position.
2694        #[doc(alias = "GST_SEEK_FLAG_SNAP_AFTER")]
2695        const SNAP_AFTER = ffi::GST_SEEK_FLAG_SNAP_AFTER as _;
2696        /// go to a position near the requested position,
2697        ///  if [`KEY_UNIT`][Self::KEY_UNIT] this means the keyframe closest
2698        ///  to the requested position, if both keyframes are at an equal
2699        ///  distance, behaves like [`SNAP_BEFORE`][Self::SNAP_BEFORE].
2700        #[doc(alias = "GST_SEEK_FLAG_SNAP_NEAREST")]
2701        const SNAP_NEAREST = ffi::GST_SEEK_FLAG_SNAP_NEAREST as _;
2702        /// when doing fast forward or fast reverse
2703        ///  playback, request that elements only decode keyframes
2704        ///  and skip all other content, for formats that have
2705        ///  keyframes. (Since: 1.6)
2706        #[doc(alias = "GST_SEEK_FLAG_TRICKMODE_KEY_UNITS")]
2707        const TRICKMODE_KEY_UNITS = ffi::GST_SEEK_FLAG_TRICKMODE_KEY_UNITS as _;
2708        /// when doing fast forward or fast reverse
2709        ///  playback, request that audio decoder elements skip
2710        ///  decoding and output only gap events or silence. (Since: 1.6)
2711        #[doc(alias = "GST_SEEK_FLAG_TRICKMODE_NO_AUDIO")]
2712        const TRICKMODE_NO_AUDIO = ffi::GST_SEEK_FLAG_TRICKMODE_NO_AUDIO as _;
2713        /// When doing fast forward or fast reverse
2714        ///  playback, request that elements only decode keyframes and
2715        ///  forward predicted frames and skip all other content (for example
2716        ///  B-Frames), for formats that have keyframes and forward predicted
2717        ///  frames. (Since: 1.18)
2718        #[cfg(feature = "v1_18")]
2719        #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2720        #[doc(alias = "GST_SEEK_FLAG_TRICKMODE_FORWARD_PREDICTED")]
2721        const TRICKMODE_FORWARD_PREDICTED = ffi::GST_SEEK_FLAG_TRICKMODE_FORWARD_PREDICTED as _;
2722        /// Signals that a rate change should be
2723        ///  applied immediately. Only valid if start/stop position
2724        ///  are GST_CLOCK_TIME_NONE, the playback direction does not change
2725        ///  and the seek is not flushing. (Since: 1.18)
2726        #[cfg(feature = "v1_18")]
2727        #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2728        #[doc(alias = "GST_SEEK_FLAG_INSTANT_RATE_CHANGE")]
2729        const INSTANT_RATE_CHANGE = ffi::GST_SEEK_FLAG_INSTANT_RATE_CHANGE as _;
2730    }
2731}
2732
2733#[doc(hidden)]
2734impl IntoGlib for SeekFlags {
2735    type GlibType = ffi::GstSeekFlags;
2736
2737    #[inline]
2738    fn into_glib(self) -> ffi::GstSeekFlags {
2739        self.bits()
2740    }
2741}
2742
2743#[doc(hidden)]
2744impl FromGlib<ffi::GstSeekFlags> for SeekFlags {
2745    #[inline]
2746    unsafe fn from_glib(value: ffi::GstSeekFlags) -> Self {
2747        skip_assert_initialized!();
2748        Self::from_bits_truncate(value)
2749    }
2750}
2751
2752impl StaticType for SeekFlags {
2753    #[inline]
2754    #[doc(alias = "gst_seek_flags_get_type")]
2755    fn static_type() -> glib::Type {
2756        unsafe { from_glib(ffi::gst_seek_flags_get_type()) }
2757    }
2758}
2759
2760impl glib::HasParamSpec for SeekFlags {
2761    type ParamSpec = glib::ParamSpecFlags;
2762    type SetValue = Self;
2763    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2764
2765    fn param_spec_builder() -> Self::BuilderFn {
2766        Self::ParamSpec::builder
2767    }
2768}
2769
2770impl glib::value::ValueType for SeekFlags {
2771    type Type = Self;
2772}
2773
2774unsafe impl<'a> glib::value::FromValue<'a> for SeekFlags {
2775    type Checker = glib::value::GenericValueTypeChecker<Self>;
2776
2777    #[inline]
2778    unsafe fn from_value(value: &'a glib::Value) -> Self {
2779        skip_assert_initialized!();
2780        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2781    }
2782}
2783
2784impl ToValue for SeekFlags {
2785    #[inline]
2786    fn to_value(&self) -> glib::Value {
2787        let mut value = glib::Value::for_value_type::<Self>();
2788        unsafe {
2789            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2790        }
2791        value
2792    }
2793
2794    #[inline]
2795    fn value_type(&self) -> glib::Type {
2796        Self::static_type()
2797    }
2798}
2799
2800impl From<SeekFlags> for glib::Value {
2801    #[inline]
2802    fn from(v: SeekFlags) -> Self {
2803        skip_assert_initialized!();
2804        ToValue::to_value(&v)
2805    }
2806}
2807
2808bitflags! {
2809    /// Flags for the GstSegment structure. Currently mapped to the corresponding
2810    /// values of the seek flags.
2811    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2812    #[doc(alias = "GstSegmentFlags")]
2813    pub struct SegmentFlags: u32 {
2814        /// reset the pipeline running_time to the segment
2815        ///  running_time
2816        #[doc(alias = "GST_SEGMENT_FLAG_RESET")]
2817        const RESET = ffi::GST_SEGMENT_FLAG_RESET as _;
2818        /// perform skip playback (Since: 1.6)
2819        #[doc(alias = "GST_SEGMENT_FLAG_TRICKMODE")]
2820        const TRICKMODE = ffi::GST_SEGMENT_FLAG_TRICKMODE as _;
2821        /// Deprecated backward compatibility flag, replaced
2822        ///  by [`TRICKMODE`][Self::TRICKMODE]
2823        #[doc(alias = "GST_SEGMENT_FLAG_SKIP")]
2824        const SKIP = ffi::GST_SEGMENT_FLAG_SKIP as _;
2825        /// send SEGMENT_DONE instead of EOS
2826        #[doc(alias = "GST_SEGMENT_FLAG_SEGMENT")]
2827        const SEGMENT = ffi::GST_SEGMENT_FLAG_SEGMENT as _;
2828        /// Decode only keyframes, where
2829        ///  possible (Since: 1.6)
2830        #[doc(alias = "GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS")]
2831        const TRICKMODE_KEY_UNITS = ffi::GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS as _;
2832        /// Decode only keyframes or forward
2833        ///  predicted frames, where possible (Since: 1.18)
2834        #[cfg(feature = "v1_18")]
2835        #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2836        #[doc(alias = "GST_SEGMENT_FLAG_TRICKMODE_FORWARD_PREDICTED")]
2837        const TRICKMODE_FORWARD_PREDICTED = ffi::GST_SEGMENT_FLAG_TRICKMODE_FORWARD_PREDICTED as _;
2838        /// Do not decode any audio, where
2839        ///  possible (Since: 1.6)
2840        #[doc(alias = "GST_SEGMENT_FLAG_TRICKMODE_NO_AUDIO")]
2841        const TRICKMODE_NO_AUDIO = ffi::GST_SEGMENT_FLAG_TRICKMODE_NO_AUDIO as _;
2842    }
2843}
2844
2845#[doc(hidden)]
2846impl IntoGlib for SegmentFlags {
2847    type GlibType = ffi::GstSegmentFlags;
2848
2849    #[inline]
2850    fn into_glib(self) -> ffi::GstSegmentFlags {
2851        self.bits()
2852    }
2853}
2854
2855#[doc(hidden)]
2856impl FromGlib<ffi::GstSegmentFlags> for SegmentFlags {
2857    #[inline]
2858    unsafe fn from_glib(value: ffi::GstSegmentFlags) -> Self {
2859        skip_assert_initialized!();
2860        Self::from_bits_truncate(value)
2861    }
2862}
2863
2864impl StaticType for SegmentFlags {
2865    #[inline]
2866    #[doc(alias = "gst_segment_flags_get_type")]
2867    fn static_type() -> glib::Type {
2868        unsafe { from_glib(ffi::gst_segment_flags_get_type()) }
2869    }
2870}
2871
2872impl glib::HasParamSpec for SegmentFlags {
2873    type ParamSpec = glib::ParamSpecFlags;
2874    type SetValue = Self;
2875    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2876
2877    fn param_spec_builder() -> Self::BuilderFn {
2878        Self::ParamSpec::builder
2879    }
2880}
2881
2882impl glib::value::ValueType for SegmentFlags {
2883    type Type = Self;
2884}
2885
2886unsafe impl<'a> glib::value::FromValue<'a> for SegmentFlags {
2887    type Checker = glib::value::GenericValueTypeChecker<Self>;
2888
2889    #[inline]
2890    unsafe fn from_value(value: &'a glib::Value) -> Self {
2891        skip_assert_initialized!();
2892        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2893    }
2894}
2895
2896impl ToValue for SegmentFlags {
2897    #[inline]
2898    fn to_value(&self) -> glib::Value {
2899        let mut value = glib::Value::for_value_type::<Self>();
2900        unsafe {
2901            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2902        }
2903        value
2904    }
2905
2906    #[inline]
2907    fn value_type(&self) -> glib::Type {
2908        Self::static_type()
2909    }
2910}
2911
2912impl From<SegmentFlags> for glib::Value {
2913    #[inline]
2914    fn from(v: SegmentFlags) -> Self {
2915        skip_assert_initialized!();
2916        ToValue::to_value(&v)
2917    }
2918}
2919
2920#[cfg(feature = "v1_20")]
2921bitflags! {
2922    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2923    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2924    #[doc(alias = "GstSerializeFlags")]
2925    pub struct SerializeFlags: u32 {
2926        /// No special flags specified.
2927        #[doc(alias = "GST_SERIALIZE_FLAG_NONE")]
2928        const NONE = ffi::GST_SERIALIZE_FLAG_NONE as _;
2929        /// Serialize using the old format for
2930        ///  nested structures.
2931        #[doc(alias = "GST_SERIALIZE_FLAG_BACKWARD_COMPAT")]
2932        const BACKWARD_COMPAT = ffi::GST_SERIALIZE_FLAG_BACKWARD_COMPAT as _;
2933    }
2934}
2935
2936#[cfg(feature = "v1_20")]
2937#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2938#[doc(hidden)]
2939impl IntoGlib for SerializeFlags {
2940    type GlibType = ffi::GstSerializeFlags;
2941
2942    #[inline]
2943    fn into_glib(self) -> ffi::GstSerializeFlags {
2944        self.bits()
2945    }
2946}
2947
2948#[cfg(feature = "v1_20")]
2949#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2950#[doc(hidden)]
2951impl FromGlib<ffi::GstSerializeFlags> for SerializeFlags {
2952    #[inline]
2953    unsafe fn from_glib(value: ffi::GstSerializeFlags) -> Self {
2954        skip_assert_initialized!();
2955        Self::from_bits_truncate(value)
2956    }
2957}
2958
2959#[cfg(feature = "v1_20")]
2960#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2961impl StaticType for SerializeFlags {
2962    #[inline]
2963    #[doc(alias = "gst_serialize_flags_get_type")]
2964    fn static_type() -> glib::Type {
2965        unsafe { from_glib(ffi::gst_serialize_flags_get_type()) }
2966    }
2967}
2968
2969#[cfg(feature = "v1_20")]
2970#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2971impl glib::HasParamSpec for SerializeFlags {
2972    type ParamSpec = glib::ParamSpecFlags;
2973    type SetValue = Self;
2974    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2975
2976    fn param_spec_builder() -> Self::BuilderFn {
2977        Self::ParamSpec::builder
2978    }
2979}
2980
2981#[cfg(feature = "v1_20")]
2982#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2983impl glib::value::ValueType for SerializeFlags {
2984    type Type = Self;
2985}
2986
2987#[cfg(feature = "v1_20")]
2988#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2989unsafe impl<'a> glib::value::FromValue<'a> for SerializeFlags {
2990    type Checker = glib::value::GenericValueTypeChecker<Self>;
2991
2992    #[inline]
2993    unsafe fn from_value(value: &'a glib::Value) -> Self {
2994        skip_assert_initialized!();
2995        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
2996    }
2997}
2998
2999#[cfg(feature = "v1_20")]
3000#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
3001impl ToValue for SerializeFlags {
3002    #[inline]
3003    fn to_value(&self) -> glib::Value {
3004        let mut value = glib::Value::for_value_type::<Self>();
3005        unsafe {
3006            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
3007        }
3008        value
3009    }
3010
3011    #[inline]
3012    fn value_type(&self) -> glib::Type {
3013        Self::static_type()
3014    }
3015}
3016
3017#[cfg(feature = "v1_20")]
3018#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
3019impl From<SerializeFlags> for glib::Value {
3020    #[inline]
3021    fn from(v: SerializeFlags) -> Self {
3022        skip_assert_initialized!();
3023        ToValue::to_value(&v)
3024    }
3025}
3026
3027bitflags! {
3028    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
3029    #[doc(alias = "GstStackTraceFlags")]
3030    pub struct StackTraceFlags: u32 {
3031        /// Try to retrieve as much information as possible,
3032        ///  including source information when getting the
3033        ///  stack trace
3034        #[doc(alias = "GST_STACK_TRACE_SHOW_FULL")]
3035        const FULL = ffi::GST_STACK_TRACE_SHOW_FULL as _;
3036    }
3037}
3038
3039#[doc(hidden)]
3040impl IntoGlib for StackTraceFlags {
3041    type GlibType = ffi::GstStackTraceFlags;
3042
3043    #[inline]
3044    fn into_glib(self) -> ffi::GstStackTraceFlags {
3045        self.bits()
3046    }
3047}
3048
3049#[doc(hidden)]
3050impl FromGlib<ffi::GstStackTraceFlags> for StackTraceFlags {
3051    #[inline]
3052    unsafe fn from_glib(value: ffi::GstStackTraceFlags) -> Self {
3053        skip_assert_initialized!();
3054        Self::from_bits_truncate(value)
3055    }
3056}
3057
3058impl StaticType for StackTraceFlags {
3059    #[inline]
3060    #[doc(alias = "gst_stack_trace_flags_get_type")]
3061    fn static_type() -> glib::Type {
3062        unsafe { from_glib(ffi::gst_stack_trace_flags_get_type()) }
3063    }
3064}
3065
3066impl glib::HasParamSpec for StackTraceFlags {
3067    type ParamSpec = glib::ParamSpecFlags;
3068    type SetValue = Self;
3069    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
3070
3071    fn param_spec_builder() -> Self::BuilderFn {
3072        Self::ParamSpec::builder
3073    }
3074}
3075
3076impl glib::value::ValueType for StackTraceFlags {
3077    type Type = Self;
3078}
3079
3080unsafe impl<'a> glib::value::FromValue<'a> for StackTraceFlags {
3081    type Checker = glib::value::GenericValueTypeChecker<Self>;
3082
3083    #[inline]
3084    unsafe fn from_value(value: &'a glib::Value) -> Self {
3085        skip_assert_initialized!();
3086        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
3087    }
3088}
3089
3090impl ToValue for StackTraceFlags {
3091    #[inline]
3092    fn to_value(&self) -> glib::Value {
3093        let mut value = glib::Value::for_value_type::<Self>();
3094        unsafe {
3095            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
3096        }
3097        value
3098    }
3099
3100    #[inline]
3101    fn value_type(&self) -> glib::Type {
3102        Self::static_type()
3103    }
3104}
3105
3106impl From<StackTraceFlags> for glib::Value {
3107    #[inline]
3108    fn from(v: StackTraceFlags) -> Self {
3109        skip_assert_initialized!();
3110        ToValue::to_value(&v)
3111    }
3112}
3113
3114bitflags! {
3115    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
3116    #[doc(alias = "GstStreamFlags")]
3117    pub struct StreamFlags: u32 {
3118        /// This stream is a sparse stream (e.g. a subtitle
3119        ///  stream), data may flow only in irregular intervals with large gaps in
3120        ///  between.
3121        #[doc(alias = "GST_STREAM_FLAG_SPARSE")]
3122        const SPARSE = ffi::GST_STREAM_FLAG_SPARSE as _;
3123        /// This stream should be selected by default. This
3124        ///  flag may be used by demuxers to signal that a stream should be selected
3125        ///  by default in a playback scenario.
3126        #[doc(alias = "GST_STREAM_FLAG_SELECT")]
3127        const SELECT = ffi::GST_STREAM_FLAG_SELECT as _;
3128        /// This stream should not be selected by default.
3129        ///  This flag may be used by demuxers to signal that a stream should not
3130        ///  be selected by default in a playback scenario, but only if explicitly
3131        ///  selected by the user (e.g. an audio track for the hard of hearing or
3132        ///  a director's commentary track).
3133        #[doc(alias = "GST_STREAM_FLAG_UNSELECT")]
3134        const UNSELECT = ffi::GST_STREAM_FLAG_UNSELECT as _;
3135    }
3136}
3137
3138#[doc(hidden)]
3139impl IntoGlib for StreamFlags {
3140    type GlibType = ffi::GstStreamFlags;
3141
3142    #[inline]
3143    fn into_glib(self) -> ffi::GstStreamFlags {
3144        self.bits()
3145    }
3146}
3147
3148#[doc(hidden)]
3149impl FromGlib<ffi::GstStreamFlags> for StreamFlags {
3150    #[inline]
3151    unsafe fn from_glib(value: ffi::GstStreamFlags) -> Self {
3152        skip_assert_initialized!();
3153        Self::from_bits_truncate(value)
3154    }
3155}
3156
3157impl StaticType for StreamFlags {
3158    #[inline]
3159    #[doc(alias = "gst_stream_flags_get_type")]
3160    fn static_type() -> glib::Type {
3161        unsafe { from_glib(ffi::gst_stream_flags_get_type()) }
3162    }
3163}
3164
3165impl glib::HasParamSpec for StreamFlags {
3166    type ParamSpec = glib::ParamSpecFlags;
3167    type SetValue = Self;
3168    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
3169
3170    fn param_spec_builder() -> Self::BuilderFn {
3171        Self::ParamSpec::builder
3172    }
3173}
3174
3175impl glib::value::ValueType for StreamFlags {
3176    type Type = Self;
3177}
3178
3179unsafe impl<'a> glib::value::FromValue<'a> for StreamFlags {
3180    type Checker = glib::value::GenericValueTypeChecker<Self>;
3181
3182    #[inline]
3183    unsafe fn from_value(value: &'a glib::Value) -> Self {
3184        skip_assert_initialized!();
3185        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
3186    }
3187}
3188
3189impl ToValue for StreamFlags {
3190    #[inline]
3191    fn to_value(&self) -> glib::Value {
3192        let mut value = glib::Value::for_value_type::<Self>();
3193        unsafe {
3194            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
3195        }
3196        value
3197    }
3198
3199    #[inline]
3200    fn value_type(&self) -> glib::Type {
3201        Self::static_type()
3202    }
3203}
3204
3205impl From<StreamFlags> for glib::Value {
3206    #[inline]
3207    fn from(v: StreamFlags) -> Self {
3208        skip_assert_initialized!();
3209        ToValue::to_value(&v)
3210    }
3211}
3212
3213bitflags! {
3214    /// [`StreamType`][crate::StreamType] describes a high level classification set for
3215    /// flows of data in [`Stream`][crate::Stream] objects.
3216    ///
3217    /// Note that this is a flag, and therefore users should not assume it
3218    /// will be a single value. Do not use the equality operator for checking
3219    /// whether a stream is of a certain type.
3220    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
3221    #[doc(alias = "GstStreamType")]
3222    pub struct StreamType: u32 {
3223        /// The stream is of unknown (unclassified) type.
3224        #[doc(alias = "GST_STREAM_TYPE_UNKNOWN")]
3225        const UNKNOWN = ffi::GST_STREAM_TYPE_UNKNOWN as _;
3226        /// The stream is of audio data
3227        #[doc(alias = "GST_STREAM_TYPE_AUDIO")]
3228        const AUDIO = ffi::GST_STREAM_TYPE_AUDIO as _;
3229        /// The stream carries video data
3230        #[doc(alias = "GST_STREAM_TYPE_VIDEO")]
3231        const VIDEO = ffi::GST_STREAM_TYPE_VIDEO as _;
3232        /// The stream is a muxed container type
3233        #[doc(alias = "GST_STREAM_TYPE_CONTAINER")]
3234        const CONTAINER = ffi::GST_STREAM_TYPE_CONTAINER as _;
3235        /// The stream contains subtitle / subpicture data.
3236        #[doc(alias = "GST_STREAM_TYPE_TEXT")]
3237        const TEXT = ffi::GST_STREAM_TYPE_TEXT as _;
3238    }
3239}
3240
3241impl StreamType {
3242    pub fn name<'a>(self) -> &'a GStr {
3243        unsafe {
3244            GStr::from_ptr(
3245                ffi::gst_stream_type_get_name(self.into_glib())
3246                    .as_ref()
3247                    .expect("gst_stream_type_get_name returned NULL"),
3248            )
3249        }
3250    }
3251}
3252
3253impl std::fmt::Display for StreamType {
3254    #[inline]
3255    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3256        f.write_str(&self.name())
3257    }
3258}
3259
3260#[doc(hidden)]
3261impl IntoGlib for StreamType {
3262    type GlibType = ffi::GstStreamType;
3263
3264    #[inline]
3265    fn into_glib(self) -> ffi::GstStreamType {
3266        self.bits()
3267    }
3268}
3269
3270#[doc(hidden)]
3271impl FromGlib<ffi::GstStreamType> for StreamType {
3272    #[inline]
3273    unsafe fn from_glib(value: ffi::GstStreamType) -> Self {
3274        skip_assert_initialized!();
3275        Self::from_bits_truncate(value)
3276    }
3277}
3278
3279impl StaticType for StreamType {
3280    #[inline]
3281    #[doc(alias = "gst_stream_type_get_type")]
3282    fn static_type() -> glib::Type {
3283        unsafe { from_glib(ffi::gst_stream_type_get_type()) }
3284    }
3285}
3286
3287impl glib::HasParamSpec for StreamType {
3288    type ParamSpec = glib::ParamSpecFlags;
3289    type SetValue = Self;
3290    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
3291
3292    fn param_spec_builder() -> Self::BuilderFn {
3293        Self::ParamSpec::builder
3294    }
3295}
3296
3297impl glib::value::ValueType for StreamType {
3298    type Type = Self;
3299}
3300
3301unsafe impl<'a> glib::value::FromValue<'a> for StreamType {
3302    type Checker = glib::value::GenericValueTypeChecker<Self>;
3303
3304    #[inline]
3305    unsafe fn from_value(value: &'a glib::Value) -> Self {
3306        skip_assert_initialized!();
3307        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
3308    }
3309}
3310
3311impl ToValue for StreamType {
3312    #[inline]
3313    fn to_value(&self) -> glib::Value {
3314        let mut value = glib::Value::for_value_type::<Self>();
3315        unsafe {
3316            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
3317        }
3318        value
3319    }
3320
3321    #[inline]
3322    fn value_type(&self) -> glib::Type {
3323        Self::static_type()
3324    }
3325}
3326
3327impl From<StreamType> for glib::Value {
3328    #[inline]
3329    fn from(v: StreamType) -> Self {
3330        skip_assert_initialized!();
3331        ToValue::to_value(&v)
3332    }
3333}