gstreamer_video/auto/
flags.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::{bitflags::bitflags, prelude::*, translate::*};
8
9#[cfg(feature = "v1_22")]
10bitflags! {
11    /// Flags to indicate the state of modifier keys and mouse buttons
12    /// in events.
13    ///
14    /// Typical modifier keys are Shift, Control, Meta, Super, Hyper, Alt, Compose,
15    /// Apple, CapsLock or ShiftLock.
16    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
17    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
18    #[doc(alias = "GstNavigationModifierType")]
19    pub struct NavigationModifierType: u32 {
20        /// the Shift key.
21        #[doc(alias = "GST_NAVIGATION_MODIFIER_SHIFT_MASK")]
22        const SHIFT_MASK = ffi::GST_NAVIGATION_MODIFIER_SHIFT_MASK as _;
23        #[doc(alias = "GST_NAVIGATION_MODIFIER_LOCK_MASK")]
24        const LOCK_MASK = ffi::GST_NAVIGATION_MODIFIER_LOCK_MASK as _;
25        /// the Control key.
26        #[doc(alias = "GST_NAVIGATION_MODIFIER_CONTROL_MASK")]
27        const CONTROL_MASK = ffi::GST_NAVIGATION_MODIFIER_CONTROL_MASK as _;
28        /// the third modifier key
29        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD1_MASK")]
30        const MOD1_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD1_MASK as _;
31        /// the fourth modifier key
32        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD2_MASK")]
33        const MOD2_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD2_MASK as _;
34        /// the fifth modifier key
35        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD3_MASK")]
36        const MOD3_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD3_MASK as _;
37        /// the sixth modifier key
38        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD4_MASK")]
39        const MOD4_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD4_MASK as _;
40        /// the seventh modifier key
41        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD5_MASK")]
42        const MOD5_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD5_MASK as _;
43        /// the first mouse button (usually the left button).
44        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON1_MASK")]
45        const BUTTON1_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON1_MASK as _;
46        /// the second mouse button (usually the right button).
47        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON2_MASK")]
48        const BUTTON2_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON2_MASK as _;
49        /// the third mouse button (usually the mouse wheel button or middle button).
50        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON3_MASK")]
51        const BUTTON3_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON3_MASK as _;
52        /// the fourth mouse button (typically the "Back" button).
53        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON4_MASK")]
54        const BUTTON4_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON4_MASK as _;
55        /// the fifth mouse button (typically the "forward" button).
56        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON5_MASK")]
57        const BUTTON5_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON5_MASK as _;
58        /// the Super modifier
59        #[doc(alias = "GST_NAVIGATION_MODIFIER_SUPER_MASK")]
60        const SUPER_MASK = ffi::GST_NAVIGATION_MODIFIER_SUPER_MASK as _;
61        /// the Hyper modifier
62        #[doc(alias = "GST_NAVIGATION_MODIFIER_HYPER_MASK")]
63        const HYPER_MASK = ffi::GST_NAVIGATION_MODIFIER_HYPER_MASK as _;
64        /// the Meta modifier
65        #[doc(alias = "GST_NAVIGATION_MODIFIER_META_MASK")]
66        const META_MASK = ffi::GST_NAVIGATION_MODIFIER_META_MASK as _;
67    }
68}
69
70#[cfg(feature = "v1_22")]
71#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
72#[doc(hidden)]
73impl IntoGlib for NavigationModifierType {
74    type GlibType = ffi::GstNavigationModifierType;
75
76    #[inline]
77    fn into_glib(self) -> ffi::GstNavigationModifierType {
78        self.bits()
79    }
80}
81
82#[cfg(feature = "v1_22")]
83#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
84#[doc(hidden)]
85impl FromGlib<ffi::GstNavigationModifierType> for NavigationModifierType {
86    #[inline]
87    unsafe fn from_glib(value: ffi::GstNavigationModifierType) -> Self {
88        skip_assert_initialized!();
89        Self::from_bits_truncate(value)
90    }
91}
92
93#[cfg(feature = "v1_22")]
94#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
95impl StaticType for NavigationModifierType {
96    #[inline]
97    #[doc(alias = "gst_navigation_modifier_type_get_type")]
98    fn static_type() -> glib::Type {
99        unsafe { from_glib(ffi::gst_navigation_modifier_type_get_type()) }
100    }
101}
102
103#[cfg(feature = "v1_22")]
104#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
105impl glib::HasParamSpec for NavigationModifierType {
106    type ParamSpec = glib::ParamSpecFlags;
107    type SetValue = Self;
108    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
109
110    fn param_spec_builder() -> Self::BuilderFn {
111        Self::ParamSpec::builder
112    }
113}
114
115#[cfg(feature = "v1_22")]
116#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
117impl glib::value::ValueType for NavigationModifierType {
118    type Type = Self;
119}
120
121#[cfg(feature = "v1_22")]
122#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
123unsafe impl<'a> glib::value::FromValue<'a> for NavigationModifierType {
124    type Checker = glib::value::GenericValueTypeChecker<Self>;
125
126    #[inline]
127    unsafe fn from_value(value: &'a glib::Value) -> Self {
128        skip_assert_initialized!();
129        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
130    }
131}
132
133#[cfg(feature = "v1_22")]
134#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
135impl ToValue for NavigationModifierType {
136    #[inline]
137    fn to_value(&self) -> glib::Value {
138        let mut value = glib::Value::for_value_type::<Self>();
139        unsafe {
140            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
141        }
142        value
143    }
144
145    #[inline]
146    fn value_type(&self) -> glib::Type {
147        Self::static_type()
148    }
149}
150
151#[cfg(feature = "v1_22")]
152#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
153impl From<NavigationModifierType> for glib::Value {
154    #[inline]
155    fn from(v: NavigationModifierType) -> Self {
156        skip_assert_initialized!();
157        ToValue::to_value(&v)
158    }
159}
160
161bitflags! {
162    /// Additional video buffer flags. These flags can potentially be used on any
163    /// buffers carrying closed caption data, or video data - even encoded data.
164    ///
165    /// Note that these are only valid for [`gst::Caps`][crate::gst::Caps] of type: video/... and caption/...
166    /// They can conflict with other extended buffer flags.
167    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
168    #[doc(alias = "GstVideoBufferFlags")]
169    pub struct VideoBufferFlags: u32 {
170        /// If the [`gst::Buffer`][crate::gst::Buffer] is interlaced. In mixed
171        ///  interlace-mode, this flags specifies if the frame is
172        ///  interlaced or progressive.
173        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_INTERLACED")]
174        const INTERLACED = ffi::GST_VIDEO_BUFFER_FLAG_INTERLACED as _;
175        /// If the [`gst::Buffer`][crate::gst::Buffer] is interlaced, then the first field
176        ///  in the video frame is the top field. If unset, the
177        ///  bottom field is first.
178        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_TFF")]
179        const TFF = ffi::GST_VIDEO_BUFFER_FLAG_TFF as _;
180        /// If the [`gst::Buffer`][crate::gst::Buffer] is interlaced, then the first field
181        ///  (as defined by the [`TFF`][Self::TFF] flag setting)
182        ///  is repeated.
183        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_RFF")]
184        const RFF = ffi::GST_VIDEO_BUFFER_FLAG_RFF as _;
185        /// If the [`gst::Buffer`][crate::gst::Buffer] is interlaced, then only the
186        ///  first field (as defined by the [`TFF`][Self::TFF]
187        ///  flag setting) is to be displayed (Since: 1.16).
188        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_ONEFIELD")]
189        const ONEFIELD = ffi::GST_VIDEO_BUFFER_FLAG_ONEFIELD as _;
190        /// The [`gst::Buffer`][crate::gst::Buffer] contains one or more specific views,
191        ///  such as left or right eye view. This flags is set on
192        ///  any buffer that contains non-mono content - even for
193        ///  streams that contain only a single viewpoint. In mixed
194        ///  mono / non-mono streams, the absence of the flag marks
195        ///  mono buffers.
196        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_MULTIPLE_VIEW")]
197        const MULTIPLE_VIEW = ffi::GST_VIDEO_BUFFER_FLAG_MULTIPLE_VIEW as _;
198        /// When conveying stereo/multiview content with
199        ///  frame-by-frame methods, this flag marks the first buffer
200        ///  in a bundle of frames that belong together.
201        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE")]
202        const FIRST_IN_BUNDLE = ffi::GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE as _;
203        /// The video frame has the top field only. This is the
204        ///  same as GST_VIDEO_BUFFER_FLAG_TFF |
205        ///  GST_VIDEO_BUFFER_FLAG_ONEFIELD (Since: 1.16).
206        ///  Use GST_VIDEO_BUFFER_IS_TOP_FIELD() to check for this flag.
207        #[cfg(feature = "v1_16")]
208        #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
209        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_TOP_FIELD")]
210        const TOP_FIELD = ffi::GST_VIDEO_BUFFER_FLAG_TOP_FIELD as _;
211        /// The video frame has the bottom field only. This is
212        ///  the same as GST_VIDEO_BUFFER_FLAG_ONEFIELD
213        ///  (GST_VIDEO_BUFFER_FLAG_TFF flag unset) (Since: 1.16).
214        ///  Use GST_VIDEO_BUFFER_IS_BOTTOM_FIELD() to check for this flag.
215        #[cfg(feature = "v1_16")]
216        #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
217        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_BOTTOM_FIELD")]
218        const BOTTOM_FIELD = ffi::GST_VIDEO_BUFFER_FLAG_BOTTOM_FIELD as _;
219        /// The [`gst::Buffer`][crate::gst::Buffer] contains the end of a video field or frame
220        ///  boundary such as the last subframe or packet (Since: 1.18).
221        #[cfg(feature = "v1_18")]
222        #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
223        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_MARKER")]
224        const MARKER = ffi::GST_VIDEO_BUFFER_FLAG_MARKER as _;
225    }
226}
227
228#[doc(hidden)]
229impl IntoGlib for VideoBufferFlags {
230    type GlibType = ffi::GstVideoBufferFlags;
231
232    #[inline]
233    fn into_glib(self) -> ffi::GstVideoBufferFlags {
234        self.bits()
235    }
236}
237
238#[doc(hidden)]
239impl FromGlib<ffi::GstVideoBufferFlags> for VideoBufferFlags {
240    #[inline]
241    unsafe fn from_glib(value: ffi::GstVideoBufferFlags) -> Self {
242        skip_assert_initialized!();
243        Self::from_bits_truncate(value)
244    }
245}
246
247impl StaticType for VideoBufferFlags {
248    #[inline]
249    #[doc(alias = "gst_video_buffer_flags_get_type")]
250    fn static_type() -> glib::Type {
251        unsafe { from_glib(ffi::gst_video_buffer_flags_get_type()) }
252    }
253}
254
255impl glib::HasParamSpec for VideoBufferFlags {
256    type ParamSpec = glib::ParamSpecFlags;
257    type SetValue = Self;
258    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
259
260    fn param_spec_builder() -> Self::BuilderFn {
261        Self::ParamSpec::builder
262    }
263}
264
265impl glib::value::ValueType for VideoBufferFlags {
266    type Type = Self;
267}
268
269unsafe impl<'a> glib::value::FromValue<'a> for VideoBufferFlags {
270    type Checker = glib::value::GenericValueTypeChecker<Self>;
271
272    #[inline]
273    unsafe fn from_value(value: &'a glib::Value) -> Self {
274        skip_assert_initialized!();
275        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
276    }
277}
278
279impl ToValue for VideoBufferFlags {
280    #[inline]
281    fn to_value(&self) -> glib::Value {
282        let mut value = glib::Value::for_value_type::<Self>();
283        unsafe {
284            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
285        }
286        value
287    }
288
289    #[inline]
290    fn value_type(&self) -> glib::Type {
291        Self::static_type()
292    }
293}
294
295impl From<VideoBufferFlags> for glib::Value {
296    #[inline]
297    fn from(v: VideoBufferFlags) -> Self {
298        skip_assert_initialized!();
299        ToValue::to_value(&v)
300    }
301}
302
303bitflags! {
304    /// Various Chroma sitings.
305    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
306    #[doc(alias = "GstVideoChromaSite")]
307    pub struct VideoChromaSite: u32 {
308        /// no cositing
309        #[doc(alias = "GST_VIDEO_CHROMA_SITE_NONE")]
310        const NONE = ffi::GST_VIDEO_CHROMA_SITE_NONE as _;
311        /// chroma is horizontally cosited
312        #[doc(alias = "GST_VIDEO_CHROMA_SITE_H_COSITED")]
313        const H_COSITED = ffi::GST_VIDEO_CHROMA_SITE_H_COSITED as _;
314        /// chroma is vertically cosited
315        #[doc(alias = "GST_VIDEO_CHROMA_SITE_V_COSITED")]
316        const V_COSITED = ffi::GST_VIDEO_CHROMA_SITE_V_COSITED as _;
317        /// chroma samples are sited on alternate lines
318        #[doc(alias = "GST_VIDEO_CHROMA_SITE_ALT_LINE")]
319        const ALT_LINE = ffi::GST_VIDEO_CHROMA_SITE_ALT_LINE as _;
320        /// chroma samples cosited with luma samples
321        #[doc(alias = "GST_VIDEO_CHROMA_SITE_COSITED")]
322        const COSITED = ffi::GST_VIDEO_CHROMA_SITE_COSITED as _;
323        /// jpeg style cositing, also for mpeg1 and mjpeg
324        #[doc(alias = "GST_VIDEO_CHROMA_SITE_JPEG")]
325        const JPEG = ffi::GST_VIDEO_CHROMA_SITE_JPEG as _;
326        /// mpeg2 style cositing
327        #[doc(alias = "GST_VIDEO_CHROMA_SITE_MPEG2")]
328        const MPEG2 = ffi::GST_VIDEO_CHROMA_SITE_MPEG2 as _;
329        /// DV style cositing
330        #[doc(alias = "GST_VIDEO_CHROMA_SITE_DV")]
331        const DV = ffi::GST_VIDEO_CHROMA_SITE_DV as _;
332    }
333}
334
335impl VideoChromaSite {
336    #[cfg(feature = "v1_20")]
337    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
338    #[doc(alias = "gst_video_chroma_site_from_string")]
339    pub fn from_string(s: &str) -> VideoChromaSite {
340        assert_initialized_main_thread!();
341        unsafe { from_glib(ffi::gst_video_chroma_site_from_string(s.to_glib_none().0)) }
342    }
343}
344
345impl std::fmt::Display for VideoChromaSite {
346    #[inline]
347    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
348        f.write_str(&self.to_str())
349    }
350}
351
352#[doc(hidden)]
353impl IntoGlib for VideoChromaSite {
354    type GlibType = ffi::GstVideoChromaSite;
355
356    #[inline]
357    fn into_glib(self) -> ffi::GstVideoChromaSite {
358        self.bits()
359    }
360}
361
362#[doc(hidden)]
363impl FromGlib<ffi::GstVideoChromaSite> for VideoChromaSite {
364    #[inline]
365    unsafe fn from_glib(value: ffi::GstVideoChromaSite) -> Self {
366        skip_assert_initialized!();
367        Self::from_bits_truncate(value)
368    }
369}
370
371impl StaticType for VideoChromaSite {
372    #[inline]
373    #[doc(alias = "gst_video_chroma_site_get_type")]
374    fn static_type() -> glib::Type {
375        unsafe { from_glib(ffi::gst_video_chroma_site_get_type()) }
376    }
377}
378
379impl glib::HasParamSpec for VideoChromaSite {
380    type ParamSpec = glib::ParamSpecFlags;
381    type SetValue = Self;
382    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
383
384    fn param_spec_builder() -> Self::BuilderFn {
385        Self::ParamSpec::builder
386    }
387}
388
389impl glib::value::ValueType for VideoChromaSite {
390    type Type = Self;
391}
392
393unsafe impl<'a> glib::value::FromValue<'a> for VideoChromaSite {
394    type Checker = glib::value::GenericValueTypeChecker<Self>;
395
396    #[inline]
397    unsafe fn from_value(value: &'a glib::Value) -> Self {
398        skip_assert_initialized!();
399        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
400    }
401}
402
403impl ToValue for VideoChromaSite {
404    #[inline]
405    fn to_value(&self) -> glib::Value {
406        let mut value = glib::Value::for_value_type::<Self>();
407        unsafe {
408            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
409        }
410        value
411    }
412
413    #[inline]
414    fn value_type(&self) -> glib::Type {
415        Self::static_type()
416    }
417}
418
419impl From<VideoChromaSite> for glib::Value {
420    #[inline]
421    fn from(v: VideoChromaSite) -> Self {
422        skip_assert_initialized!();
423        ToValue::to_value(&v)
424    }
425}
426
427bitflags! {
428    /// Flags for [`VideoCodecFrame`][crate::VideoCodecFrame]
429    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
430    #[doc(alias = "GstVideoCodecFrameFlags")]
431    pub struct VideoCodecFrameFlags: u32 {
432        /// is the frame only meant to be decoded
433        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_DECODE_ONLY")]
434        const DECODE_ONLY = ffi::GST_VIDEO_CODEC_FRAME_FLAG_DECODE_ONLY as _;
435        /// is the frame a synchronization point (keyframe)
436        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_SYNC_POINT")]
437        const SYNC_POINT = ffi::GST_VIDEO_CODEC_FRAME_FLAG_SYNC_POINT as _;
438        /// should the output frame be made a keyframe
439        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME")]
440        const FORCE_KEYFRAME = ffi::GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME as _;
441        /// should the encoder output stream headers
442        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME_HEADERS")]
443        const FORCE_KEYFRAME_HEADERS = ffi::GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME_HEADERS as _;
444        /// The buffer data is corrupted.
445        #[cfg(feature = "v1_20")]
446        #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
447        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_CORRUPTED")]
448        const CORRUPTED = ffi::GST_VIDEO_CODEC_FRAME_FLAG_CORRUPTED as _;
449    }
450}
451
452#[doc(hidden)]
453impl IntoGlib for VideoCodecFrameFlags {
454    type GlibType = ffi::GstVideoCodecFrameFlags;
455
456    #[inline]
457    fn into_glib(self) -> ffi::GstVideoCodecFrameFlags {
458        self.bits()
459    }
460}
461
462#[doc(hidden)]
463impl FromGlib<ffi::GstVideoCodecFrameFlags> for VideoCodecFrameFlags {
464    #[inline]
465    unsafe fn from_glib(value: ffi::GstVideoCodecFrameFlags) -> Self {
466        skip_assert_initialized!();
467        Self::from_bits_truncate(value)
468    }
469}
470
471#[cfg(feature = "v1_20")]
472#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
473impl StaticType for VideoCodecFrameFlags {
474    #[inline]
475    #[doc(alias = "gst_video_codec_frame_flags_get_type")]
476    fn static_type() -> glib::Type {
477        unsafe { from_glib(ffi::gst_video_codec_frame_flags_get_type()) }
478    }
479}
480
481#[cfg(feature = "v1_20")]
482#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
483impl glib::HasParamSpec for VideoCodecFrameFlags {
484    type ParamSpec = glib::ParamSpecFlags;
485    type SetValue = Self;
486    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
487
488    fn param_spec_builder() -> Self::BuilderFn {
489        Self::ParamSpec::builder
490    }
491}
492
493#[cfg(feature = "v1_20")]
494#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
495impl glib::value::ValueType for VideoCodecFrameFlags {
496    type Type = Self;
497}
498
499#[cfg(feature = "v1_20")]
500#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
501unsafe impl<'a> glib::value::FromValue<'a> for VideoCodecFrameFlags {
502    type Checker = glib::value::GenericValueTypeChecker<Self>;
503
504    #[inline]
505    unsafe fn from_value(value: &'a glib::Value) -> Self {
506        skip_assert_initialized!();
507        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
508    }
509}
510
511#[cfg(feature = "v1_20")]
512#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
513impl ToValue for VideoCodecFrameFlags {
514    #[inline]
515    fn to_value(&self) -> glib::Value {
516        let mut value = glib::Value::for_value_type::<Self>();
517        unsafe {
518            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
519        }
520        value
521    }
522
523    #[inline]
524    fn value_type(&self) -> glib::Type {
525        Self::static_type()
526    }
527}
528
529#[cfg(feature = "v1_20")]
530#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
531impl From<VideoCodecFrameFlags> for glib::Value {
532    #[inline]
533    fn from(v: VideoCodecFrameFlags) -> Self {
534        skip_assert_initialized!();
535        ToValue::to_value(&v)
536    }
537}
538
539#[cfg(feature = "v1_20")]
540bitflags! {
541    /// Flags to be used in combination with [`VideoDecoderExt::request_sync_point()`][crate::prelude::VideoDecoderExt::request_sync_point()].
542    /// See the function documentation for more details.
543    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
544    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
545    #[doc(alias = "GstVideoDecoderRequestSyncPointFlags")]
546    pub struct VideoDecoderRequestSyncPointFlags: u32 {
547        /// discard all following
548        ///  input until the next sync point.
549        #[doc(alias = "GST_VIDEO_DECODER_REQUEST_SYNC_POINT_DISCARD_INPUT")]
550        const DISCARD_INPUT = ffi::GST_VIDEO_DECODER_REQUEST_SYNC_POINT_DISCARD_INPUT as _;
551        /// discard all following
552        ///  output until the next sync point.
553        #[doc(alias = "GST_VIDEO_DECODER_REQUEST_SYNC_POINT_CORRUPT_OUTPUT")]
554        const CORRUPT_OUTPUT = ffi::GST_VIDEO_DECODER_REQUEST_SYNC_POINT_CORRUPT_OUTPUT as _;
555    }
556}
557
558#[cfg(feature = "v1_20")]
559#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
560#[doc(hidden)]
561impl IntoGlib for VideoDecoderRequestSyncPointFlags {
562    type GlibType = ffi::GstVideoDecoderRequestSyncPointFlags;
563
564    #[inline]
565    fn into_glib(self) -> ffi::GstVideoDecoderRequestSyncPointFlags {
566        self.bits()
567    }
568}
569
570#[cfg(feature = "v1_20")]
571#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
572#[doc(hidden)]
573impl FromGlib<ffi::GstVideoDecoderRequestSyncPointFlags> for VideoDecoderRequestSyncPointFlags {
574    #[inline]
575    unsafe fn from_glib(value: ffi::GstVideoDecoderRequestSyncPointFlags) -> Self {
576        skip_assert_initialized!();
577        Self::from_bits_truncate(value)
578    }
579}
580
581#[cfg(feature = "v1_20")]
582#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
583impl StaticType for VideoDecoderRequestSyncPointFlags {
584    #[inline]
585    #[doc(alias = "gst_video_decoder_request_sync_point_flags_get_type")]
586    fn static_type() -> glib::Type {
587        unsafe { from_glib(ffi::gst_video_decoder_request_sync_point_flags_get_type()) }
588    }
589}
590
591#[cfg(feature = "v1_20")]
592#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
593impl glib::HasParamSpec for VideoDecoderRequestSyncPointFlags {
594    type ParamSpec = glib::ParamSpecFlags;
595    type SetValue = Self;
596    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
597
598    fn param_spec_builder() -> Self::BuilderFn {
599        Self::ParamSpec::builder
600    }
601}
602
603#[cfg(feature = "v1_20")]
604#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
605impl glib::value::ValueType for VideoDecoderRequestSyncPointFlags {
606    type Type = Self;
607}
608
609#[cfg(feature = "v1_20")]
610#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
611unsafe impl<'a> glib::value::FromValue<'a> for VideoDecoderRequestSyncPointFlags {
612    type Checker = glib::value::GenericValueTypeChecker<Self>;
613
614    #[inline]
615    unsafe fn from_value(value: &'a glib::Value) -> Self {
616        skip_assert_initialized!();
617        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
618    }
619}
620
621#[cfg(feature = "v1_20")]
622#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
623impl ToValue for VideoDecoderRequestSyncPointFlags {
624    #[inline]
625    fn to_value(&self) -> glib::Value {
626        let mut value = glib::Value::for_value_type::<Self>();
627        unsafe {
628            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
629        }
630        value
631    }
632
633    #[inline]
634    fn value_type(&self) -> glib::Type {
635        Self::static_type()
636    }
637}
638
639#[cfg(feature = "v1_20")]
640#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
641impl From<VideoDecoderRequestSyncPointFlags> for glib::Value {
642    #[inline]
643    fn from(v: VideoDecoderRequestSyncPointFlags) -> Self {
644        skip_assert_initialized!();
645        ToValue::to_value(&v)
646    }
647}
648
649bitflags! {
650    /// Extra video flags
651    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
652    #[doc(alias = "GstVideoFlags")]
653    pub struct VideoFlags: u32 {
654        /// a variable fps is selected, fps_n and fps_d
655        ///  denote the maximum fps of the video
656        #[doc(alias = "GST_VIDEO_FLAG_VARIABLE_FPS")]
657        const VARIABLE_FPS = ffi::GST_VIDEO_FLAG_VARIABLE_FPS as _;
658        /// Each color has been scaled by the alpha
659        ///  value.
660        #[doc(alias = "GST_VIDEO_FLAG_PREMULTIPLIED_ALPHA")]
661        const PREMULTIPLIED_ALPHA = ffi::GST_VIDEO_FLAG_PREMULTIPLIED_ALPHA as _;
662    }
663}
664
665#[doc(hidden)]
666impl IntoGlib for VideoFlags {
667    type GlibType = ffi::GstVideoFlags;
668
669    #[inline]
670    fn into_glib(self) -> ffi::GstVideoFlags {
671        self.bits()
672    }
673}
674
675#[doc(hidden)]
676impl FromGlib<ffi::GstVideoFlags> for VideoFlags {
677    #[inline]
678    unsafe fn from_glib(value: ffi::GstVideoFlags) -> Self {
679        skip_assert_initialized!();
680        Self::from_bits_truncate(value)
681    }
682}
683
684impl StaticType for VideoFlags {
685    #[inline]
686    #[doc(alias = "gst_video_flags_get_type")]
687    fn static_type() -> glib::Type {
688        unsafe { from_glib(ffi::gst_video_flags_get_type()) }
689    }
690}
691
692impl glib::HasParamSpec for VideoFlags {
693    type ParamSpec = glib::ParamSpecFlags;
694    type SetValue = Self;
695    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
696
697    fn param_spec_builder() -> Self::BuilderFn {
698        Self::ParamSpec::builder
699    }
700}
701
702impl glib::value::ValueType for VideoFlags {
703    type Type = Self;
704}
705
706unsafe impl<'a> glib::value::FromValue<'a> for VideoFlags {
707    type Checker = glib::value::GenericValueTypeChecker<Self>;
708
709    #[inline]
710    unsafe fn from_value(value: &'a glib::Value) -> Self {
711        skip_assert_initialized!();
712        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
713    }
714}
715
716impl ToValue for VideoFlags {
717    #[inline]
718    fn to_value(&self) -> glib::Value {
719        let mut value = glib::Value::for_value_type::<Self>();
720        unsafe {
721            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
722        }
723        value
724    }
725
726    #[inline]
727    fn value_type(&self) -> glib::Type {
728        Self::static_type()
729    }
730}
731
732impl From<VideoFlags> for glib::Value {
733    #[inline]
734    fn from(v: VideoFlags) -> Self {
735        skip_assert_initialized!();
736        ToValue::to_value(&v)
737    }
738}
739
740bitflags! {
741    /// The different video flags that a format info can have.
742    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
743    #[doc(alias = "GstVideoFormatFlags")]
744    pub struct VideoFormatFlags: u32 {
745        /// The video format is YUV, components are numbered
746        ///  0=Y, 1=U, 2=V.
747        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_YUV")]
748        const YUV = ffi::GST_VIDEO_FORMAT_FLAG_YUV as _;
749        /// The video format is RGB, components are numbered
750        ///  0=R, 1=G, 2=B.
751        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_RGB")]
752        const RGB = ffi::GST_VIDEO_FORMAT_FLAG_RGB as _;
753        /// The video is gray, there is one gray component
754        ///  with index 0.
755        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_GRAY")]
756        const GRAY = ffi::GST_VIDEO_FORMAT_FLAG_GRAY as _;
757        /// The video format has an alpha components with
758        ///  the number 3.
759        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_ALPHA")]
760        const ALPHA = ffi::GST_VIDEO_FORMAT_FLAG_ALPHA as _;
761        /// The video format has data stored in little
762        ///  endianness.
763        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_LE")]
764        const LE = ffi::GST_VIDEO_FORMAT_FLAG_LE as _;
765        /// The video format has a palette. The palette
766        ///  is stored in the second plane and indexes are stored in the first plane.
767        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_PALETTE")]
768        const PALETTE = ffi::GST_VIDEO_FORMAT_FLAG_PALETTE as _;
769        /// The video format has a complex layout that
770        ///  can't be described with the usual information in the [`VideoFormatInfo`][crate::VideoFormatInfo].
771        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_COMPLEX")]
772        const COMPLEX = ffi::GST_VIDEO_FORMAT_FLAG_COMPLEX as _;
773        /// This format can be used in a
774        ///  `GstVideoFormatUnpack` and `GstVideoFormatPack` function.
775        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_UNPACK")]
776        const UNPACK = ffi::GST_VIDEO_FORMAT_FLAG_UNPACK as _;
777        /// The format is tiled, there is tiling information
778        ///  in the last plane.
779        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_TILED")]
780        const TILED = ffi::GST_VIDEO_FORMAT_FLAG_TILED as _;
781        /// The tile size varies per plane according to the subsampling.
782        #[cfg(feature = "v1_22")]
783        #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
784        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_SUBTILES")]
785        const SUBTILES = ffi::GST_VIDEO_FORMAT_FLAG_SUBTILES as _;
786    }
787}
788
789#[doc(hidden)]
790impl IntoGlib for VideoFormatFlags {
791    type GlibType = ffi::GstVideoFormatFlags;
792
793    #[inline]
794    fn into_glib(self) -> ffi::GstVideoFormatFlags {
795        self.bits()
796    }
797}
798
799#[doc(hidden)]
800impl FromGlib<ffi::GstVideoFormatFlags> for VideoFormatFlags {
801    #[inline]
802    unsafe fn from_glib(value: ffi::GstVideoFormatFlags) -> Self {
803        skip_assert_initialized!();
804        Self::from_bits_truncate(value)
805    }
806}
807
808impl StaticType for VideoFormatFlags {
809    #[inline]
810    #[doc(alias = "gst_video_format_flags_get_type")]
811    fn static_type() -> glib::Type {
812        unsafe { from_glib(ffi::gst_video_format_flags_get_type()) }
813    }
814}
815
816impl glib::HasParamSpec for VideoFormatFlags {
817    type ParamSpec = glib::ParamSpecFlags;
818    type SetValue = Self;
819    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
820
821    fn param_spec_builder() -> Self::BuilderFn {
822        Self::ParamSpec::builder
823    }
824}
825
826impl glib::value::ValueType for VideoFormatFlags {
827    type Type = Self;
828}
829
830unsafe impl<'a> glib::value::FromValue<'a> for VideoFormatFlags {
831    type Checker = glib::value::GenericValueTypeChecker<Self>;
832
833    #[inline]
834    unsafe fn from_value(value: &'a glib::Value) -> Self {
835        skip_assert_initialized!();
836        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
837    }
838}
839
840impl ToValue for VideoFormatFlags {
841    #[inline]
842    fn to_value(&self) -> glib::Value {
843        let mut value = glib::Value::for_value_type::<Self>();
844        unsafe {
845            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
846        }
847        value
848    }
849
850    #[inline]
851    fn value_type(&self) -> glib::Type {
852        Self::static_type()
853    }
854}
855
856impl From<VideoFormatFlags> for glib::Value {
857    #[inline]
858    fn from(v: VideoFormatFlags) -> Self {
859        skip_assert_initialized!();
860        ToValue::to_value(&v)
861    }
862}
863
864bitflags! {
865    /// Extra video frame flags
866    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
867    #[doc(alias = "GstVideoFrameFlags")]
868    pub struct VideoFrameFlags: u32 {
869        /// The video frame is interlaced. In mixed
870        ///  interlace-mode, this flag specifies if the frame is interlaced or
871        ///  progressive.
872        #[doc(alias = "GST_VIDEO_FRAME_FLAG_INTERLACED")]
873        const INTERLACED = ffi::GST_VIDEO_FRAME_FLAG_INTERLACED as _;
874        /// The video frame has the top field first
875        #[doc(alias = "GST_VIDEO_FRAME_FLAG_TFF")]
876        const TFF = ffi::GST_VIDEO_FRAME_FLAG_TFF as _;
877        /// The video frame has the repeat flag
878        #[doc(alias = "GST_VIDEO_FRAME_FLAG_RFF")]
879        const RFF = ffi::GST_VIDEO_FRAME_FLAG_RFF as _;
880        /// The video frame has one field
881        #[doc(alias = "GST_VIDEO_FRAME_FLAG_ONEFIELD")]
882        const ONEFIELD = ffi::GST_VIDEO_FRAME_FLAG_ONEFIELD as _;
883        /// The video contains one or
884        ///  more non-mono views
885        #[doc(alias = "GST_VIDEO_FRAME_FLAG_MULTIPLE_VIEW")]
886        const MULTIPLE_VIEW = ffi::GST_VIDEO_FRAME_FLAG_MULTIPLE_VIEW as _;
887        /// The video frame is the first
888        ///  in a set of corresponding views provided as sequential frames.
889        #[doc(alias = "GST_VIDEO_FRAME_FLAG_FIRST_IN_BUNDLE")]
890        const FIRST_IN_BUNDLE = ffi::GST_VIDEO_FRAME_FLAG_FIRST_IN_BUNDLE as _;
891        /// The video frame has the top field only. This
892        ///  is the same as GST_VIDEO_FRAME_FLAG_TFF | GST_VIDEO_FRAME_FLAG_ONEFIELD
893        ///  (Since: 1.16).
894        #[cfg(feature = "v1_16")]
895        #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
896        #[doc(alias = "GST_VIDEO_FRAME_FLAG_TOP_FIELD")]
897        const TOP_FIELD = ffi::GST_VIDEO_FRAME_FLAG_TOP_FIELD as _;
898        /// The video frame has the bottom field
899        ///  only. This is the same as GST_VIDEO_FRAME_FLAG_ONEFIELD
900        ///  (GST_VIDEO_FRAME_FLAG_TFF flag unset) (Since: 1.16).
901        #[cfg(feature = "v1_16")]
902        #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
903        #[doc(alias = "GST_VIDEO_FRAME_FLAG_BOTTOM_FIELD")]
904        const BOTTOM_FIELD = ffi::GST_VIDEO_FRAME_FLAG_BOTTOM_FIELD as _;
905    }
906}
907
908#[doc(hidden)]
909impl IntoGlib for VideoFrameFlags {
910    type GlibType = ffi::GstVideoFrameFlags;
911
912    #[inline]
913    fn into_glib(self) -> ffi::GstVideoFrameFlags {
914        self.bits()
915    }
916}
917
918#[doc(hidden)]
919impl FromGlib<ffi::GstVideoFrameFlags> for VideoFrameFlags {
920    #[inline]
921    unsafe fn from_glib(value: ffi::GstVideoFrameFlags) -> Self {
922        skip_assert_initialized!();
923        Self::from_bits_truncate(value)
924    }
925}
926
927impl StaticType for VideoFrameFlags {
928    #[inline]
929    #[doc(alias = "gst_video_frame_flags_get_type")]
930    fn static_type() -> glib::Type {
931        unsafe { from_glib(ffi::gst_video_frame_flags_get_type()) }
932    }
933}
934
935impl glib::HasParamSpec for VideoFrameFlags {
936    type ParamSpec = glib::ParamSpecFlags;
937    type SetValue = Self;
938    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
939
940    fn param_spec_builder() -> Self::BuilderFn {
941        Self::ParamSpec::builder
942    }
943}
944
945impl glib::value::ValueType for VideoFrameFlags {
946    type Type = Self;
947}
948
949unsafe impl<'a> glib::value::FromValue<'a> for VideoFrameFlags {
950    type Checker = glib::value::GenericValueTypeChecker<Self>;
951
952    #[inline]
953    unsafe fn from_value(value: &'a glib::Value) -> Self {
954        skip_assert_initialized!();
955        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
956    }
957}
958
959impl ToValue for VideoFrameFlags {
960    #[inline]
961    fn to_value(&self) -> glib::Value {
962        let mut value = glib::Value::for_value_type::<Self>();
963        unsafe {
964            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
965        }
966        value
967    }
968
969    #[inline]
970    fn value_type(&self) -> glib::Type {
971        Self::static_type()
972    }
973}
974
975impl From<VideoFrameFlags> for glib::Value {
976    #[inline]
977    fn from(v: VideoFrameFlags) -> Self {
978        skip_assert_initialized!();
979        ToValue::to_value(&v)
980    }
981}
982
983bitflags! {
984    /// GstVideoMultiviewFlags are used to indicate extra properties of a
985    /// stereo/multiview stream beyond the frame layout and buffer mapping
986    /// that is conveyed in the [`VideoMultiviewMode`][crate::VideoMultiviewMode].
987    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
988    #[doc(alias = "GstVideoMultiviewFlags")]
989    pub struct VideoMultiviewFlags: u32 {
990        /// For stereo streams, the
991        ///  normal arrangement of left and right views is reversed.
992        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST")]
993        const RIGHT_VIEW_FIRST = ffi::GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST as _;
994        /// The left view is vertically
995        ///  mirrored.
996        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLIPPED")]
997        const LEFT_FLIPPED = ffi::GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLIPPED as _;
998        /// The left view is horizontally
999        ///  mirrored.
1000        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLOPPED")]
1001        const LEFT_FLOPPED = ffi::GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLOPPED as _;
1002        /// The right view is
1003        ///  vertically mirrored.
1004        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLIPPED")]
1005        const RIGHT_FLIPPED = ffi::GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLIPPED as _;
1006        /// The right view is
1007        ///  horizontally mirrored.
1008        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLOPPED")]
1009        const RIGHT_FLOPPED = ffi::GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLOPPED as _;
1010        /// For frame-packed
1011        ///  multiview modes, indicates that the individual
1012        ///  views have been encoded with half the true width or height
1013        ///  and should be scaled back up for display. This flag
1014        ///  is used for overriding input layout interpretation
1015        ///  by adjusting pixel-aspect-ratio.
1016        ///  For side-by-side, column interleaved or checkerboard packings, the
1017        ///  pixel width will be doubled. For row interleaved and top-bottom
1018        ///  encodings, pixel height will be doubled.
1019        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT")]
1020        const HALF_ASPECT = ffi::GST_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT as _;
1021        /// The video stream contains both
1022        ///  mono and multiview portions, signalled on each buffer by the
1023        ///  absence or presence of the [`VideoBufferFlags::MULTIPLE_VIEW`][crate::VideoBufferFlags::MULTIPLE_VIEW]
1024        ///  buffer flag.
1025        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_MIXED_MONO")]
1026        const MIXED_MONO = ffi::GST_VIDEO_MULTIVIEW_FLAGS_MIXED_MONO as _;
1027    }
1028}
1029
1030#[doc(hidden)]
1031impl IntoGlib for VideoMultiviewFlags {
1032    type GlibType = ffi::GstVideoMultiviewFlags;
1033
1034    #[inline]
1035    fn into_glib(self) -> ffi::GstVideoMultiviewFlags {
1036        self.bits()
1037    }
1038}
1039
1040#[doc(hidden)]
1041impl FromGlib<ffi::GstVideoMultiviewFlags> for VideoMultiviewFlags {
1042    #[inline]
1043    unsafe fn from_glib(value: ffi::GstVideoMultiviewFlags) -> Self {
1044        skip_assert_initialized!();
1045        Self::from_bits_truncate(value)
1046    }
1047}
1048
1049impl StaticType for VideoMultiviewFlags {
1050    #[inline]
1051    #[doc(alias = "gst_video_multiview_flags_get_type")]
1052    fn static_type() -> glib::Type {
1053        unsafe { from_glib(ffi::gst_video_multiview_flags_get_type()) }
1054    }
1055}
1056
1057impl glib::HasParamSpec for VideoMultiviewFlags {
1058    type ParamSpec = glib::ParamSpecFlags;
1059    type SetValue = Self;
1060    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1061
1062    fn param_spec_builder() -> Self::BuilderFn {
1063        Self::ParamSpec::builder
1064    }
1065}
1066
1067impl glib::value::ValueType for VideoMultiviewFlags {
1068    type Type = Self;
1069}
1070
1071unsafe impl<'a> glib::value::FromValue<'a> for VideoMultiviewFlags {
1072    type Checker = glib::value::GenericValueTypeChecker<Self>;
1073
1074    #[inline]
1075    unsafe fn from_value(value: &'a glib::Value) -> Self {
1076        skip_assert_initialized!();
1077        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1078    }
1079}
1080
1081impl ToValue for VideoMultiviewFlags {
1082    #[inline]
1083    fn to_value(&self) -> glib::Value {
1084        let mut value = glib::Value::for_value_type::<Self>();
1085        unsafe {
1086            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1087        }
1088        value
1089    }
1090
1091    #[inline]
1092    fn value_type(&self) -> glib::Type {
1093        Self::static_type()
1094    }
1095}
1096
1097impl From<VideoMultiviewFlags> for glib::Value {
1098    #[inline]
1099    fn from(v: VideoMultiviewFlags) -> Self {
1100        skip_assert_initialized!();
1101        ToValue::to_value(&v)
1102    }
1103}
1104
1105bitflags! {
1106    /// Overlay format flags.
1107    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1108    #[doc(alias = "GstVideoOverlayFormatFlags")]
1109    pub struct VideoOverlayFormatFlags: u32 {
1110        /// RGB are premultiplied by A/255.
1111        #[doc(alias = "GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA")]
1112        const PREMULTIPLIED_ALPHA = ffi::GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA as _;
1113        /// a global-alpha value != 1 is set.
1114        #[doc(alias = "GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA")]
1115        const GLOBAL_ALPHA = ffi::GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA as _;
1116    }
1117}
1118
1119#[doc(hidden)]
1120impl IntoGlib for VideoOverlayFormatFlags {
1121    type GlibType = ffi::GstVideoOverlayFormatFlags;
1122
1123    #[inline]
1124    fn into_glib(self) -> ffi::GstVideoOverlayFormatFlags {
1125        self.bits()
1126    }
1127}
1128
1129#[doc(hidden)]
1130impl FromGlib<ffi::GstVideoOverlayFormatFlags> for VideoOverlayFormatFlags {
1131    #[inline]
1132    unsafe fn from_glib(value: ffi::GstVideoOverlayFormatFlags) -> Self {
1133        skip_assert_initialized!();
1134        Self::from_bits_truncate(value)
1135    }
1136}
1137
1138#[cfg(feature = "v1_16")]
1139#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1140impl StaticType for VideoOverlayFormatFlags {
1141    #[inline]
1142    #[doc(alias = "gst_video_overlay_format_flags_get_type")]
1143    fn static_type() -> glib::Type {
1144        unsafe { from_glib(ffi::gst_video_overlay_format_flags_get_type()) }
1145    }
1146}
1147
1148#[cfg(feature = "v1_16")]
1149#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1150impl glib::HasParamSpec for VideoOverlayFormatFlags {
1151    type ParamSpec = glib::ParamSpecFlags;
1152    type SetValue = Self;
1153    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1154
1155    fn param_spec_builder() -> Self::BuilderFn {
1156        Self::ParamSpec::builder
1157    }
1158}
1159
1160#[cfg(feature = "v1_16")]
1161#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1162impl glib::value::ValueType for VideoOverlayFormatFlags {
1163    type Type = Self;
1164}
1165
1166#[cfg(feature = "v1_16")]
1167#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1168unsafe impl<'a> glib::value::FromValue<'a> for VideoOverlayFormatFlags {
1169    type Checker = glib::value::GenericValueTypeChecker<Self>;
1170
1171    #[inline]
1172    unsafe fn from_value(value: &'a glib::Value) -> Self {
1173        skip_assert_initialized!();
1174        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1175    }
1176}
1177
1178#[cfg(feature = "v1_16")]
1179#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1180impl ToValue for VideoOverlayFormatFlags {
1181    #[inline]
1182    fn to_value(&self) -> glib::Value {
1183        let mut value = glib::Value::for_value_type::<Self>();
1184        unsafe {
1185            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1186        }
1187        value
1188    }
1189
1190    #[inline]
1191    fn value_type(&self) -> glib::Type {
1192        Self::static_type()
1193    }
1194}
1195
1196#[cfg(feature = "v1_16")]
1197#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1198impl From<VideoOverlayFormatFlags> for glib::Value {
1199    #[inline]
1200    fn from(v: VideoOverlayFormatFlags) -> Self {
1201        skip_assert_initialized!();
1202        ToValue::to_value(&v)
1203    }
1204}
1205
1206bitflags! {
1207    /// The different flags that can be used when packing and unpacking.
1208    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1209    #[doc(alias = "GstVideoPackFlags")]
1210    pub struct VideoPackFlags: u32 {
1211        /// When the source has a smaller depth
1212        ///  than the target format, set the least significant bits of the target
1213        ///  to 0. This is likely slightly faster but less accurate. When this flag
1214        ///  is not specified, the most significant bits of the source are duplicated
1215        ///  in the least significant bits of the destination.
1216        #[doc(alias = "GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE")]
1217        const TRUNCATE_RANGE = ffi::GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE as _;
1218        /// The source is interlaced. The unpacked
1219        ///  format will be interlaced as well with each line containing
1220        ///  information from alternating fields. (Since: 1.2)
1221        #[doc(alias = "GST_VIDEO_PACK_FLAG_INTERLACED")]
1222        const INTERLACED = ffi::GST_VIDEO_PACK_FLAG_INTERLACED as _;
1223    }
1224}
1225
1226#[doc(hidden)]
1227impl IntoGlib for VideoPackFlags {
1228    type GlibType = ffi::GstVideoPackFlags;
1229
1230    #[inline]
1231    fn into_glib(self) -> ffi::GstVideoPackFlags {
1232        self.bits()
1233    }
1234}
1235
1236#[doc(hidden)]
1237impl FromGlib<ffi::GstVideoPackFlags> for VideoPackFlags {
1238    #[inline]
1239    unsafe fn from_glib(value: ffi::GstVideoPackFlags) -> Self {
1240        skip_assert_initialized!();
1241        Self::from_bits_truncate(value)
1242    }
1243}
1244
1245impl StaticType for VideoPackFlags {
1246    #[inline]
1247    #[doc(alias = "gst_video_pack_flags_get_type")]
1248    fn static_type() -> glib::Type {
1249        unsafe { from_glib(ffi::gst_video_pack_flags_get_type()) }
1250    }
1251}
1252
1253impl glib::HasParamSpec for VideoPackFlags {
1254    type ParamSpec = glib::ParamSpecFlags;
1255    type SetValue = Self;
1256    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1257
1258    fn param_spec_builder() -> Self::BuilderFn {
1259        Self::ParamSpec::builder
1260    }
1261}
1262
1263impl glib::value::ValueType for VideoPackFlags {
1264    type Type = Self;
1265}
1266
1267unsafe impl<'a> glib::value::FromValue<'a> for VideoPackFlags {
1268    type Checker = glib::value::GenericValueTypeChecker<Self>;
1269
1270    #[inline]
1271    unsafe fn from_value(value: &'a glib::Value) -> Self {
1272        skip_assert_initialized!();
1273        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1274    }
1275}
1276
1277impl ToValue for VideoPackFlags {
1278    #[inline]
1279    fn to_value(&self) -> glib::Value {
1280        let mut value = glib::Value::for_value_type::<Self>();
1281        unsafe {
1282            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1283        }
1284        value
1285    }
1286
1287    #[inline]
1288    fn value_type(&self) -> glib::Type {
1289        Self::static_type()
1290    }
1291}
1292
1293impl From<VideoPackFlags> for glib::Value {
1294    #[inline]
1295    fn from(v: VideoPackFlags) -> Self {
1296        skip_assert_initialized!();
1297        ToValue::to_value(&v)
1298    }
1299}
1300
1301bitflags! {
1302    /// Flags related to the time code information.
1303    /// For drop frame, only 30000/1001 and 60000/1001 frame rates are supported.
1304    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1305    #[doc(alias = "GstVideoTimeCodeFlags")]
1306    pub struct VideoTimeCodeFlags: u32 {
1307        /// Whether we have drop frame rate
1308        #[doc(alias = "GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME")]
1309        const DROP_FRAME = ffi::GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME as _;
1310        /// Whether we have interlaced video
1311        #[doc(alias = "GST_VIDEO_TIME_CODE_FLAGS_INTERLACED")]
1312        const INTERLACED = ffi::GST_VIDEO_TIME_CODE_FLAGS_INTERLACED as _;
1313    }
1314}
1315
1316#[doc(hidden)]
1317impl IntoGlib for VideoTimeCodeFlags {
1318    type GlibType = ffi::GstVideoTimeCodeFlags;
1319
1320    #[inline]
1321    fn into_glib(self) -> ffi::GstVideoTimeCodeFlags {
1322        self.bits()
1323    }
1324}
1325
1326#[doc(hidden)]
1327impl FromGlib<ffi::GstVideoTimeCodeFlags> for VideoTimeCodeFlags {
1328    #[inline]
1329    unsafe fn from_glib(value: ffi::GstVideoTimeCodeFlags) -> Self {
1330        skip_assert_initialized!();
1331        Self::from_bits_truncate(value)
1332    }
1333}
1334
1335#[cfg(feature = "v1_18")]
1336#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1337impl StaticType for VideoTimeCodeFlags {
1338    #[inline]
1339    #[doc(alias = "gst_video_time_code_flags_get_type")]
1340    fn static_type() -> glib::Type {
1341        unsafe { from_glib(ffi::gst_video_time_code_flags_get_type()) }
1342    }
1343}
1344
1345#[cfg(feature = "v1_18")]
1346#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1347impl glib::HasParamSpec for VideoTimeCodeFlags {
1348    type ParamSpec = glib::ParamSpecFlags;
1349    type SetValue = Self;
1350    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1351
1352    fn param_spec_builder() -> Self::BuilderFn {
1353        Self::ParamSpec::builder
1354    }
1355}
1356
1357#[cfg(feature = "v1_18")]
1358#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1359impl glib::value::ValueType for VideoTimeCodeFlags {
1360    type Type = Self;
1361}
1362
1363#[cfg(feature = "v1_18")]
1364#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1365unsafe impl<'a> glib::value::FromValue<'a> for VideoTimeCodeFlags {
1366    type Checker = glib::value::GenericValueTypeChecker<Self>;
1367
1368    #[inline]
1369    unsafe fn from_value(value: &'a glib::Value) -> Self {
1370        skip_assert_initialized!();
1371        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
1372    }
1373}
1374
1375#[cfg(feature = "v1_18")]
1376#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1377impl ToValue for VideoTimeCodeFlags {
1378    #[inline]
1379    fn to_value(&self) -> glib::Value {
1380        let mut value = glib::Value::for_value_type::<Self>();
1381        unsafe {
1382            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1383        }
1384        value
1385    }
1386
1387    #[inline]
1388    fn value_type(&self) -> glib::Type {
1389        Self::static_type()
1390    }
1391}
1392
1393#[cfg(feature = "v1_18")]
1394#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1395impl From<VideoTimeCodeFlags> for glib::Value {
1396    #[inline]
1397    fn from(v: VideoTimeCodeFlags) -> Self {
1398        skip_assert_initialized!();
1399        ToValue::to_value(&v)
1400    }
1401}