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