Skip to main content

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