Replace raw constants with the FFI constants

This commit is contained in:
Guillaume Gomez 2021-06-02 17:43:42 +02:00
parent 96266ff922
commit abf82e6f7a

View file

@ -6,28 +6,28 @@ use glib::translate::*;
bitflags! {
#[doc(alias = "GstElementFactoryListType")]
pub struct ElementFactoryListType: u64 {
const DECODER = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0001;
const ENCODER = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0010;
const SINK = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0100;
const SRC = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_1000;
const MUXER = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0001_0000;
const DEMUXER = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0010_0000;
const PARSER = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0100_0000;
const PAYLOADER = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_1000_0000;
const DEPAYLOADER = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0001_0000_0000;
const FORMATTER = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0010_0000_0000;
const DECRYPTOR = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0100_0000_0000;
const ENCRYPTOR = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_1000_0000_0000;
const HARDWARE = 0b_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0001_0000_0000_0000;
const DECODER = ffi::GST_ELEMENT_FACTORY_TYPE_DECODER as u64;
const ENCODER = ffi::GST_ELEMENT_FACTORY_TYPE_ENCODER as u64;
const SINK = ffi::GST_ELEMENT_FACTORY_TYPE_SINK as u64;
const SRC = ffi::GST_ELEMENT_FACTORY_TYPE_SRC as u64;
const MUXER = ffi::GST_ELEMENT_FACTORY_TYPE_MUXER as u64;
const DEMUXER = ffi::GST_ELEMENT_FACTORY_TYPE_DEMUXER as u64;
const PARSER = ffi::GST_ELEMENT_FACTORY_TYPE_PARSER as u64;
const PAYLOADER = ffi::GST_ELEMENT_FACTORY_TYPE_PAYLOADER as u64;
const DEPAYLOADER = ffi::GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER as u64;
const FORMATTER = ffi::GST_ELEMENT_FACTORY_TYPE_FORMATTER as u64;
const DECRYPTOR = ffi::GST_ELEMENT_FACTORY_TYPE_DECRYPTOR as u64;
const ENCRYPTOR = ffi::GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR as u64;
const HARDWARE = ffi::GST_ELEMENT_FACTORY_TYPE_HARDWARE as u64;
const MEDIA_VIDEO = 0b_0000_0000_0000_0010_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000;
const MEDIA_AUDIO = 0b_0000_0000_0000_0100_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000;
const MEDIA_IMAGE = 0b_0000_0000_0000_1000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000;
const MEDIA_SUBTITLE = 0b_0000_0000_0001_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000;
const MEDIA_METADATA = 0b_0000_0000_0010_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000;
const MEDIA_VIDEO = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO as u64;
const MEDIA_AUDIO = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO as u64;
const MEDIA_IMAGE = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE as u64;
const MEDIA_SUBTITLE = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE as u64;
const MEDIA_METADATA = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA as u64;
const ANY = 0b_0000_0000_0000_0001_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111;
const MEDIA_ANY = 0b_1111_1111_1111_1110_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000;
const ANY = ffi::GST_ELEMENT_FACTORY_TYPE_ANY as u64;
const MEDIA_ANY = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY as u64;
const VIDEO_ENCODER = Self::ENCODER.bits | Self::MEDIA_VIDEO.bits | Self::MEDIA_IMAGE.bits;
const AUDIO_ENCODER = Self::ENCODER.bits | Self::MEDIA_AUDIO.bits;