gstreamer_pbutils/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
9bitflags! {
10    /// You can use these flags to control what is serialized by
11    /// [`DiscovererInfo::to_variant()`][crate::DiscovererInfo::to_variant()]
12    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
13    #[doc(alias = "GstDiscovererSerializeFlags")]
14    pub struct DiscovererSerializeFlags: u32 {
15        /// Serialize the caps for each stream
16        #[doc(alias = "GST_DISCOVERER_SERIALIZE_CAPS")]
17        const CAPS = ffi::GST_DISCOVERER_SERIALIZE_CAPS as _;
18        /// Serialize the tags for each stream
19        #[doc(alias = "GST_DISCOVERER_SERIALIZE_TAGS")]
20        const TAGS = ffi::GST_DISCOVERER_SERIALIZE_TAGS as _;
21        /// Serialize miscellaneous information for each stream
22        #[doc(alias = "GST_DISCOVERER_SERIALIZE_MISC")]
23        const MISC = ffi::GST_DISCOVERER_SERIALIZE_MISC as _;
24    }
25}
26
27#[doc(hidden)]
28impl IntoGlib for DiscovererSerializeFlags {
29    type GlibType = ffi::GstDiscovererSerializeFlags;
30
31    #[inline]
32    fn into_glib(self) -> ffi::GstDiscovererSerializeFlags {
33        self.bits()
34    }
35}
36
37#[doc(hidden)]
38impl FromGlib<ffi::GstDiscovererSerializeFlags> for DiscovererSerializeFlags {
39    #[inline]
40    unsafe fn from_glib(value: ffi::GstDiscovererSerializeFlags) -> Self {
41        skip_assert_initialized!();
42        Self::from_bits_truncate(value)
43    }
44}
45
46impl StaticType for DiscovererSerializeFlags {
47    #[inline]
48    #[doc(alias = "gst_discoverer_serialize_flags_get_type")]
49    fn static_type() -> glib::Type {
50        unsafe { from_glib(ffi::gst_discoverer_serialize_flags_get_type()) }
51    }
52}
53
54impl glib::HasParamSpec for DiscovererSerializeFlags {
55    type ParamSpec = glib::ParamSpecFlags;
56    type SetValue = Self;
57    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
58
59    fn param_spec_builder() -> Self::BuilderFn {
60        Self::ParamSpec::builder
61    }
62}
63
64impl glib::value::ValueType for DiscovererSerializeFlags {
65    type Type = Self;
66}
67
68unsafe impl<'a> glib::value::FromValue<'a> for DiscovererSerializeFlags {
69    type Checker = glib::value::GenericValueTypeChecker<Self>;
70
71    #[inline]
72    unsafe fn from_value(value: &'a glib::Value) -> Self {
73        skip_assert_initialized!();
74        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
75    }
76}
77
78impl ToValue for DiscovererSerializeFlags {
79    #[inline]
80    fn to_value(&self) -> glib::Value {
81        let mut value = glib::Value::for_value_type::<Self>();
82        unsafe {
83            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
84        }
85        value
86    }
87
88    #[inline]
89    fn value_type(&self) -> glib::Type {
90        Self::static_type()
91    }
92}
93
94impl From<DiscovererSerializeFlags> for glib::Value {
95    #[inline]
96    fn from(v: DiscovererSerializeFlags) -> Self {
97        skip_assert_initialized!();
98        ToValue::to_value(&v)
99    }
100}
101
102#[cfg(feature = "v1_20")]
103bitflags! {
104    /// Flags that are returned by [`pb_utils_get_caps_description_flags()`][crate::pb_utils_get_caps_description_flags()] and
105    /// describe the format of the caps.
106    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
107    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
108    #[doc(alias = "GstPbUtilsCapsDescriptionFlags")]
109    pub struct PbUtilsCapsDescriptionFlags: u32 {
110        /// Caps describe a container format.
111        #[doc(alias = "GST_PBUTILS_CAPS_DESCRIPTION_FLAG_CONTAINER")]
112        const CONTAINER = ffi::GST_PBUTILS_CAPS_DESCRIPTION_FLAG_CONTAINER as _;
113        /// Caps describe an audio format, or a
114        ///  container format that can store audio.
115        #[doc(alias = "GST_PBUTILS_CAPS_DESCRIPTION_FLAG_AUDIO")]
116        const AUDIO = ffi::GST_PBUTILS_CAPS_DESCRIPTION_FLAG_AUDIO as _;
117        /// Caps describe an video format, or a
118        ///  container format that can store video.
119        #[doc(alias = "GST_PBUTILS_CAPS_DESCRIPTION_FLAG_VIDEO")]
120        const VIDEO = ffi::GST_PBUTILS_CAPS_DESCRIPTION_FLAG_VIDEO as _;
121        /// Caps describe an image format, or a
122        ///  container format that can store image.
123        #[doc(alias = "GST_PBUTILS_CAPS_DESCRIPTION_FLAG_IMAGE")]
124        const IMAGE = ffi::GST_PBUTILS_CAPS_DESCRIPTION_FLAG_IMAGE as _;
125        /// Caps describe an subtitle format, or a
126        ///  container format that can store subtitles.
127        #[doc(alias = "GST_PBUTILS_CAPS_DESCRIPTION_FLAG_SUBTITLE")]
128        const SUBTITLE = ffi::GST_PBUTILS_CAPS_DESCRIPTION_FLAG_SUBTITLE as _;
129        /// Container format is a tags container.
130        #[doc(alias = "GST_PBUTILS_CAPS_DESCRIPTION_FLAG_TAG")]
131        const TAG = ffi::GST_PBUTILS_CAPS_DESCRIPTION_FLAG_TAG as _;
132        /// Container format can store any kind of
133        ///  stream type.
134        #[doc(alias = "GST_PBUTILS_CAPS_DESCRIPTION_FLAG_GENERIC")]
135        const GENERIC = ffi::GST_PBUTILS_CAPS_DESCRIPTION_FLAG_GENERIC as _;
136        /// Caps describe a metadata format, or a container format that can store
137        /// metadata.
138        #[cfg(feature = "v1_22")]
139        #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
140        #[doc(alias = "GST_PBUTILS_CAPS_DESCRIPTION_FLAG_METADATA")]
141        const METADATA = ffi::GST_PBUTILS_CAPS_DESCRIPTION_FLAG_METADATA as _;
142    }
143}
144
145#[cfg(feature = "v1_20")]
146#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
147#[doc(hidden)]
148impl IntoGlib for PbUtilsCapsDescriptionFlags {
149    type GlibType = ffi::GstPbUtilsCapsDescriptionFlags;
150
151    #[inline]
152    fn into_glib(self) -> ffi::GstPbUtilsCapsDescriptionFlags {
153        self.bits()
154    }
155}
156
157#[cfg(feature = "v1_20")]
158#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
159#[doc(hidden)]
160impl FromGlib<ffi::GstPbUtilsCapsDescriptionFlags> for PbUtilsCapsDescriptionFlags {
161    #[inline]
162    unsafe fn from_glib(value: ffi::GstPbUtilsCapsDescriptionFlags) -> Self {
163        skip_assert_initialized!();
164        Self::from_bits_truncate(value)
165    }
166}
167
168#[cfg(feature = "v1_20")]
169#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
170impl StaticType for PbUtilsCapsDescriptionFlags {
171    #[inline]
172    #[doc(alias = "gst_pb_utils_caps_description_flags_get_type")]
173    fn static_type() -> glib::Type {
174        unsafe { from_glib(ffi::gst_pb_utils_caps_description_flags_get_type()) }
175    }
176}
177
178#[cfg(feature = "v1_20")]
179#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
180impl glib::HasParamSpec for PbUtilsCapsDescriptionFlags {
181    type ParamSpec = glib::ParamSpecFlags;
182    type SetValue = Self;
183    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
184
185    fn param_spec_builder() -> Self::BuilderFn {
186        Self::ParamSpec::builder
187    }
188}
189
190#[cfg(feature = "v1_20")]
191#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
192impl glib::value::ValueType for PbUtilsCapsDescriptionFlags {
193    type Type = Self;
194}
195
196#[cfg(feature = "v1_20")]
197#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
198unsafe impl<'a> glib::value::FromValue<'a> for PbUtilsCapsDescriptionFlags {
199    type Checker = glib::value::GenericValueTypeChecker<Self>;
200
201    #[inline]
202    unsafe fn from_value(value: &'a glib::Value) -> Self {
203        skip_assert_initialized!();
204        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
205    }
206}
207
208#[cfg(feature = "v1_20")]
209#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
210impl ToValue for PbUtilsCapsDescriptionFlags {
211    #[inline]
212    fn to_value(&self) -> glib::Value {
213        let mut value = glib::Value::for_value_type::<Self>();
214        unsafe {
215            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
216        }
217        value
218    }
219
220    #[inline]
221    fn value_type(&self) -> glib::Type {
222        Self::static_type()
223    }
224}
225
226#[cfg(feature = "v1_20")]
227#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
228impl From<PbUtilsCapsDescriptionFlags> for glib::Value {
229    #[inline]
230    fn from(v: PbUtilsCapsDescriptionFlags) -> Self {
231        skip_assert_initialized!();
232        ToValue::to_value(&v)
233    }
234}