1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::{bitflags::bitflags, translate::*};
4
5bitflags! {
6 #[doc(alias = "GstElementFactoryListType")]
7 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
8 pub struct ElementFactoryType: u64 {
9 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_DECODER")]
10 const DECODER = ffi::GST_ELEMENT_FACTORY_TYPE_DECODER;
11 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_ENCODER")]
12 const ENCODER = ffi::GST_ELEMENT_FACTORY_TYPE_ENCODER;
13 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_SINK")]
14 const SINK = ffi::GST_ELEMENT_FACTORY_TYPE_SINK;
15 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_SRC")]
16 const SRC = ffi::GST_ELEMENT_FACTORY_TYPE_SRC;
17 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MUXER")]
18 const MUXER = ffi::GST_ELEMENT_FACTORY_TYPE_MUXER;
19 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_DEMUXER")]
20 const DEMUXER = ffi::GST_ELEMENT_FACTORY_TYPE_DEMUXER;
21 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_PARSER")]
22 const PARSER = ffi::GST_ELEMENT_FACTORY_TYPE_PARSER;
23 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_PAYLOADER")]
24 const PAYLOADER = ffi::GST_ELEMENT_FACTORY_TYPE_PAYLOADER;
25 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER")]
26 const DEPAYLOADER = ffi::GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER;
27 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_FORMATTER")]
28 const FORMATTER = ffi::GST_ELEMENT_FACTORY_TYPE_FORMATTER;
29 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_DECRYPTOR")]
30 const DECRYPTOR = ffi::GST_ELEMENT_FACTORY_TYPE_DECRYPTOR;
31 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR")]
32 const ENCRYPTOR = ffi::GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR;
33 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_HARDWARE")]
34 const HARDWARE = ffi::GST_ELEMENT_FACTORY_TYPE_HARDWARE;
35 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_TIMESTAMPER")]
36 const TIMESTAMPER = ffi::GST_ELEMENT_FACTORY_TYPE_TIMESTAMPER;
37
38 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO")]
39 const MEDIA_VIDEO = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO;
40 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO")]
41 const MEDIA_AUDIO = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO;
42 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE")]
43 const MEDIA_IMAGE = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE;
44 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE")]
45 const MEDIA_SUBTITLE = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE;
46 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA")]
47 const MEDIA_METADATA = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA;
48
49 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_ANY")]
50 const ANY = ffi::GST_ELEMENT_FACTORY_TYPE_ANY;
51 #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY")]
52 const MEDIA_ANY = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY;
53
54 const VIDEO_ENCODER = Self::ENCODER.bits() | Self::MEDIA_VIDEO.bits() | Self::MEDIA_IMAGE.bits();
55 const AUDIO_ENCODER = Self::ENCODER.bits() | Self::MEDIA_AUDIO.bits();
56 const AUDIOVIDEO_SINKS = Self::SINK.bits() | Self::MEDIA_AUDIO.bits() | Self::MEDIA_VIDEO.bits() | Self::MEDIA_IMAGE.bits();
57 const DECODABLE = Self::DECODER.bits() | Self::DEMUXER.bits() | Self::DEPAYLOADER.bits() | Self::PARSER.bits() | Self::DECRYPTOR.bits();
58 }
59}
60
61#[doc(hidden)]
62impl IntoGlib for ElementFactoryType {
63 type GlibType = ffi::GstElementFactoryListType;
64
65 #[inline]
66 fn into_glib(self) -> ffi::GstElementFactoryListType {
67 self.bits()
68 }
69}
70
71#[doc(hidden)]
72impl FromGlib<ffi::GstElementFactoryListType> for ElementFactoryType {
73 #[inline]
74 unsafe fn from_glib(value: ffi::GstElementFactoryListType) -> ElementFactoryType {
75 skip_assert_initialized!();
76 ElementFactoryType::from_bits_truncate(bits:value)
77 }
78}
79