gstreamer_editing_services/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::*, GStr};
8
9#[cfg(feature = "v1_20")]
10bitflags! {
11    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
12    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
13    #[doc(alias = "GESMarkerFlags")]
14    pub struct MarkerFlags: u32 {
15        /// Marker does not serve any special purpose.
16        #[doc(alias = "GES_MARKER_FLAG_NONE")]
17        const NONE = ffi::GES_MARKER_FLAG_NONE as _;
18        /// Marker can be a snapping target.
19        #[doc(alias = "GES_MARKER_FLAG_SNAPPABLE")]
20        const SNAPPABLE = ffi::GES_MARKER_FLAG_SNAPPABLE as _;
21    }
22}
23
24#[cfg(feature = "v1_20")]
25#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
26#[doc(hidden)]
27impl IntoGlib for MarkerFlags {
28    type GlibType = ffi::GESMarkerFlags;
29
30    #[inline]
31    fn into_glib(self) -> ffi::GESMarkerFlags {
32        self.bits()
33    }
34}
35
36#[cfg(feature = "v1_20")]
37#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
38#[doc(hidden)]
39impl FromGlib<ffi::GESMarkerFlags> for MarkerFlags {
40    #[inline]
41    unsafe fn from_glib(value: ffi::GESMarkerFlags) -> Self {
42        skip_assert_initialized!();
43        Self::from_bits_truncate(value)
44    }
45}
46
47#[cfg(feature = "v1_20")]
48#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
49impl StaticType for MarkerFlags {
50    #[inline]
51    #[doc(alias = "ges_marker_flags_get_type")]
52    fn static_type() -> glib::Type {
53        unsafe { from_glib(ffi::ges_marker_flags_get_type()) }
54    }
55}
56
57#[cfg(feature = "v1_20")]
58#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
59impl glib::HasParamSpec for MarkerFlags {
60    type ParamSpec = glib::ParamSpecFlags;
61    type SetValue = Self;
62    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
63
64    fn param_spec_builder() -> Self::BuilderFn {
65        Self::ParamSpec::builder
66    }
67}
68
69#[cfg(feature = "v1_20")]
70#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
71impl glib::value::ValueType for MarkerFlags {
72    type Type = Self;
73}
74
75#[cfg(feature = "v1_20")]
76#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
77unsafe impl<'a> glib::value::FromValue<'a> for MarkerFlags {
78    type Checker = glib::value::GenericValueTypeChecker<Self>;
79
80    #[inline]
81    unsafe fn from_value(value: &'a glib::Value) -> Self {
82        skip_assert_initialized!();
83        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
84    }
85}
86
87#[cfg(feature = "v1_20")]
88#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
89impl ToValue for MarkerFlags {
90    #[inline]
91    fn to_value(&self) -> glib::Value {
92        let mut value = glib::Value::for_value_type::<Self>();
93        unsafe {
94            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
95        }
96        value
97    }
98
99    #[inline]
100    fn value_type(&self) -> glib::Type {
101        Self::static_type()
102    }
103}
104
105#[cfg(feature = "v1_20")]
106#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
107impl From<MarkerFlags> for glib::Value {
108    #[inline]
109    fn from(v: MarkerFlags) -> Self {
110        skip_assert_initialized!();
111        ToValue::to_value(&v)
112    }
113}
114
115bitflags! {
116    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
117    #[doc(alias = "GESMetaFlag")]
118    pub struct MetaFlag: u32 {
119        /// The metadata is readable
120        #[doc(alias = "GES_META_READABLE")]
121        const READABLE = ffi::GES_META_READABLE as _;
122        /// The metadata is writable
123        #[doc(alias = "GES_META_WRITABLE")]
124        const WRITABLE = ffi::GES_META_WRITABLE as _;
125        /// The metadata is readable and writable
126        #[doc(alias = "GES_META_READ_WRITE")]
127        const READWRITE = ffi::GES_META_READ_WRITE as _;
128    }
129}
130
131#[doc(hidden)]
132impl IntoGlib for MetaFlag {
133    type GlibType = ffi::GESMetaFlag;
134
135    #[inline]
136    fn into_glib(self) -> ffi::GESMetaFlag {
137        self.bits()
138    }
139}
140
141#[doc(hidden)]
142impl FromGlib<ffi::GESMetaFlag> for MetaFlag {
143    #[inline]
144    unsafe fn from_glib(value: ffi::GESMetaFlag) -> Self {
145        skip_assert_initialized!();
146        Self::from_bits_truncate(value)
147    }
148}
149
150impl StaticType for MetaFlag {
151    #[inline]
152    #[doc(alias = "ges_meta_flag_get_type")]
153    fn static_type() -> glib::Type {
154        unsafe { from_glib(ffi::ges_meta_flag_get_type()) }
155    }
156}
157
158impl glib::HasParamSpec for MetaFlag {
159    type ParamSpec = glib::ParamSpecFlags;
160    type SetValue = Self;
161    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
162
163    fn param_spec_builder() -> Self::BuilderFn {
164        Self::ParamSpec::builder
165    }
166}
167
168impl glib::value::ValueType for MetaFlag {
169    type Type = Self;
170}
171
172unsafe impl<'a> glib::value::FromValue<'a> for MetaFlag {
173    type Checker = glib::value::GenericValueTypeChecker<Self>;
174
175    #[inline]
176    unsafe fn from_value(value: &'a glib::Value) -> Self {
177        skip_assert_initialized!();
178        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
179    }
180}
181
182impl ToValue for MetaFlag {
183    #[inline]
184    fn to_value(&self) -> glib::Value {
185        let mut value = glib::Value::for_value_type::<Self>();
186        unsafe {
187            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
188        }
189        value
190    }
191
192    #[inline]
193    fn value_type(&self) -> glib::Type {
194        Self::static_type()
195    }
196}
197
198impl From<MetaFlag> for glib::Value {
199    #[inline]
200    fn from(v: MetaFlag) -> Self {
201        skip_assert_initialized!();
202        ToValue::to_value(&v)
203    }
204}
205
206bitflags! {
207    /// The various modes a [`Pipeline`][crate::Pipeline] can be configured to.
208    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
209    #[doc(alias = "GESPipelineFlags")]
210    pub struct PipelineFlags: u32 {
211        /// Output the [`timeline`][struct@crate::Pipeline#timeline]'s
212        /// audio to the soundcard
213        #[doc(alias = "GES_PIPELINE_MODE_PREVIEW_AUDIO")]
214        const AUDIO_PREVIEW = ffi::GES_PIPELINE_MODE_PREVIEW_AUDIO as _;
215        /// Output the [`timeline`][struct@crate::Pipeline#timeline]'s
216        /// video to the screen
217        #[doc(alias = "GES_PIPELINE_MODE_PREVIEW_VIDEO")]
218        const VIDEO_PREVIEW = ffi::GES_PIPELINE_MODE_PREVIEW_VIDEO as _;
219        /// Output both the [`timeline`][struct@crate::Pipeline#timeline]'s
220        /// audio and video to the soundcard and screen (default)
221        #[doc(alias = "GES_PIPELINE_MODE_PREVIEW")]
222        const FULL_PREVIEW = ffi::GES_PIPELINE_MODE_PREVIEW as _;
223        /// Render the [`timeline`][struct@crate::Pipeline#timeline] with
224        /// forced decoding (the underlying `encodebin` has its
225        /// `encodebin:avoid-reencoding` property set to [`false`])
226        #[doc(alias = "GES_PIPELINE_MODE_RENDER")]
227        const RENDER = ffi::GES_PIPELINE_MODE_RENDER as _;
228        /// Render the [`timeline`][struct@crate::Pipeline#timeline],
229        /// avoiding decoding/reencoding (the underlying `encodebin` has its
230        /// `encodebin:avoid-reencoding` property set to [`true`]).
231        /// > NOTE: Smart rendering can not work in tracks where [`mixing`][struct@crate::Track#mixing]
232        /// > is enabled.
233        #[doc(alias = "GES_PIPELINE_MODE_SMART_RENDER")]
234        const SMART_RENDER = ffi::GES_PIPELINE_MODE_SMART_RENDER as _;
235    }
236}
237
238#[doc(hidden)]
239impl IntoGlib for PipelineFlags {
240    type GlibType = ffi::GESPipelineFlags;
241
242    #[inline]
243    fn into_glib(self) -> ffi::GESPipelineFlags {
244        self.bits()
245    }
246}
247
248#[doc(hidden)]
249impl FromGlib<ffi::GESPipelineFlags> for PipelineFlags {
250    #[inline]
251    unsafe fn from_glib(value: ffi::GESPipelineFlags) -> Self {
252        skip_assert_initialized!();
253        Self::from_bits_truncate(value)
254    }
255}
256
257impl StaticType for PipelineFlags {
258    #[inline]
259    #[doc(alias = "ges_pipeline_flags_get_type")]
260    fn static_type() -> glib::Type {
261        unsafe { from_glib(ffi::ges_pipeline_flags_get_type()) }
262    }
263}
264
265impl glib::HasParamSpec for PipelineFlags {
266    type ParamSpec = glib::ParamSpecFlags;
267    type SetValue = Self;
268    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
269
270    fn param_spec_builder() -> Self::BuilderFn {
271        Self::ParamSpec::builder
272    }
273}
274
275impl glib::value::ValueType for PipelineFlags {
276    type Type = Self;
277}
278
279unsafe impl<'a> glib::value::FromValue<'a> for PipelineFlags {
280    type Checker = glib::value::GenericValueTypeChecker<Self>;
281
282    #[inline]
283    unsafe fn from_value(value: &'a glib::Value) -> Self {
284        skip_assert_initialized!();
285        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
286    }
287}
288
289impl ToValue for PipelineFlags {
290    #[inline]
291    fn to_value(&self) -> glib::Value {
292        let mut value = glib::Value::for_value_type::<Self>();
293        unsafe {
294            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
295        }
296        value
297    }
298
299    #[inline]
300    fn value_type(&self) -> glib::Type {
301        Self::static_type()
302    }
303}
304
305impl From<PipelineFlags> for glib::Value {
306    #[inline]
307    fn from(v: PipelineFlags) -> Self {
308        skip_assert_initialized!();
309        ToValue::to_value(&v)
310    }
311}
312
313bitflags! {
314    /// Types of content handled by a track. If the content is not one of
315    /// [`AUDIO`][Self::AUDIO], [`VIDEO`][Self::VIDEO] or [`TEXT`][Self::TEXT],
316    /// the user of the [`Track`][crate::Track] must set the type to [`CUSTOM`][Self::CUSTOM].
317    ///
318    /// [`UNKNOWN`][Self::UNKNOWN] is for internal purposes and should not be used
319    /// by users
320    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
321    #[doc(alias = "GESTrackType")]
322    pub struct TrackType: u32 {
323        /// A track of unknown type (i.e. invalid)
324        #[doc(alias = "GES_TRACK_TYPE_UNKNOWN")]
325        const UNKNOWN = ffi::GES_TRACK_TYPE_UNKNOWN as _;
326        /// An audio track
327        #[doc(alias = "GES_TRACK_TYPE_AUDIO")]
328        const AUDIO = ffi::GES_TRACK_TYPE_AUDIO as _;
329        /// A video track
330        #[doc(alias = "GES_TRACK_TYPE_VIDEO")]
331        const VIDEO = ffi::GES_TRACK_TYPE_VIDEO as _;
332        /// A text (subtitle) track
333        #[doc(alias = "GES_TRACK_TYPE_TEXT")]
334        const TEXT = ffi::GES_TRACK_TYPE_TEXT as _;
335        /// A custom-content track
336        #[doc(alias = "GES_TRACK_TYPE_CUSTOM")]
337        const CUSTOM = ffi::GES_TRACK_TYPE_CUSTOM as _;
338    }
339}
340
341impl TrackType {
342    pub fn name<'a>(self) -> &'a GStr {
343        unsafe {
344            GStr::from_ptr(
345                ffi::ges_track_type_name(self.into_glib())
346                    .as_ref()
347                    .expect("ges_track_type_name returned NULL"),
348            )
349        }
350    }
351}
352
353impl std::fmt::Display for TrackType {
354    #[inline]
355    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
356        f.write_str(&self.name())
357    }
358}
359
360#[doc(hidden)]
361impl IntoGlib for TrackType {
362    type GlibType = ffi::GESTrackType;
363
364    #[inline]
365    fn into_glib(self) -> ffi::GESTrackType {
366        self.bits()
367    }
368}
369
370#[doc(hidden)]
371impl FromGlib<ffi::GESTrackType> for TrackType {
372    #[inline]
373    unsafe fn from_glib(value: ffi::GESTrackType) -> Self {
374        skip_assert_initialized!();
375        Self::from_bits_truncate(value)
376    }
377}
378
379impl StaticType for TrackType {
380    #[inline]
381    #[doc(alias = "ges_track_type_get_type")]
382    fn static_type() -> glib::Type {
383        unsafe { from_glib(ffi::ges_track_type_get_type()) }
384    }
385}
386
387impl glib::HasParamSpec for TrackType {
388    type ParamSpec = glib::ParamSpecFlags;
389    type SetValue = Self;
390    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
391
392    fn param_spec_builder() -> Self::BuilderFn {
393        Self::ParamSpec::builder
394    }
395}
396
397impl glib::value::ValueType for TrackType {
398    type Type = Self;
399}
400
401unsafe impl<'a> glib::value::FromValue<'a> for TrackType {
402    type Checker = glib::value::GenericValueTypeChecker<Self>;
403
404    #[inline]
405    unsafe fn from_value(value: &'a glib::Value) -> Self {
406        skip_assert_initialized!();
407        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
408    }
409}
410
411impl ToValue for TrackType {
412    #[inline]
413    fn to_value(&self) -> glib::Value {
414        let mut value = glib::Value::for_value_type::<Self>();
415        unsafe {
416            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
417        }
418        value
419    }
420
421    #[inline]
422    fn value_type(&self) -> glib::Type {
423        Self::static_type()
424    }
425}
426
427impl From<TrackType> for glib::Value {
428    #[inline]
429    fn from(v: TrackType) -> Self {
430        skip_assert_initialized!();
431        ToValue::to_value(&v)
432    }
433}