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