flags.rs 8.4 KB
Newer Older
1
// This file was generated by gir (5c71144) from gir-files (???)
Sebastian Dröge's avatar
Sebastian Dröge committed
2 3 4
// DO NOT EDIT

use ffi;
Sebastian Dröge's avatar
Sebastian Dröge committed
5 6 7 8
use glib::Type;
use glib::StaticType;
use glib::value::{Value, SetValue, FromValue, FromValueOptional};
use gobject_ffi;
Sebastian Dröge's avatar
Sebastian Dröge committed
9 10
use glib::translate::*;

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
bitflags! {
    pub struct BufferFlags: u32 {
        const BUFFER_FLAG_LIVE = 16;
        const BUFFER_FLAG_DECODE_ONLY = 32;
        const BUFFER_FLAG_DISCONT = 64;
        const BUFFER_FLAG_RESYNC = 128;
        const BUFFER_FLAG_CORRUPTED = 256;
        const BUFFER_FLAG_MARKER = 512;
        const BUFFER_FLAG_HEADER = 1024;
        const BUFFER_FLAG_GAP = 2048;
        const BUFFER_FLAG_DROPPABLE = 4096;
        const BUFFER_FLAG_DELTA_UNIT = 8192;
        const BUFFER_FLAG_TAG_MEMORY = 16384;
        const BUFFER_FLAG_SYNC_AFTER = 32768;
        const BUFFER_FLAG_LAST = 1048576;
    }
}

#[doc(hidden)]
impl ToGlib for BufferFlags {
    type GlibType = ffi::GstBufferFlags;

    fn to_glib(&self) -> ffi::GstBufferFlags {
        ffi::GstBufferFlags::from_bits_truncate(self.bits())
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstBufferFlags> for BufferFlags {
    fn from_glib(value: ffi::GstBufferFlags) -> BufferFlags {
        skip_assert_initialized!();
        BufferFlags::from_bits_truncate(value.bits())
    }
}

impl StaticType for BufferFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_buffer_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for BufferFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for BufferFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(ffi::GstBufferFlags::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0)))
    }
}

impl SetValue for BufferFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits())
    }
}

Sebastian Dröge's avatar
Sebastian Dröge committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
bitflags! {
    pub struct PadProbeType: u32 {
        const PAD_PROBE_TYPE_INVALID = 0;
        const PAD_PROBE_TYPE_IDLE = 1;
        const PAD_PROBE_TYPE_BLOCK = 2;
        const PAD_PROBE_TYPE_BUFFER = 16;
        const PAD_PROBE_TYPE_BUFFER_LIST = 32;
        const PAD_PROBE_TYPE_EVENT_DOWNSTREAM = 64;
        const PAD_PROBE_TYPE_EVENT_UPSTREAM = 128;
        const PAD_PROBE_TYPE_EVENT_FLUSH = 256;
        const PAD_PROBE_TYPE_QUERY_DOWNSTREAM = 512;
        const PAD_PROBE_TYPE_QUERY_UPSTREAM = 1024;
        const PAD_PROBE_TYPE_PUSH = 4096;
        const PAD_PROBE_TYPE_PULL = 8192;
        const PAD_PROBE_TYPE_BLOCKING = 3;
        const PAD_PROBE_TYPE_DATA_DOWNSTREAM = 112;
        const PAD_PROBE_TYPE_DATA_UPSTREAM = 128;
        const PAD_PROBE_TYPE_DATA_BOTH = 240;
        const PAD_PROBE_TYPE_BLOCK_DOWNSTREAM = 114;
        const PAD_PROBE_TYPE_BLOCK_UPSTREAM = 130;
        const PAD_PROBE_TYPE_EVENT_BOTH = 192;
        const PAD_PROBE_TYPE_QUERY_BOTH = 1536;
        const PAD_PROBE_TYPE_ALL_BOTH = 1776;
        const PAD_PROBE_TYPE_SCHEDULING = 12288;
    }
}

#[doc(hidden)]
impl ToGlib for PadProbeType {
    type GlibType = ffi::GstPadProbeType;

    fn to_glib(&self) -> ffi::GstPadProbeType {
        ffi::GstPadProbeType::from_bits_truncate(self.bits())
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstPadProbeType> for PadProbeType {
    fn from_glib(value: ffi::GstPadProbeType) -> PadProbeType {
        skip_assert_initialized!();
        PadProbeType::from_bits_truncate(value.bits())
    }
}

impl StaticType for PadProbeType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_pad_probe_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PadProbeType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PadProbeType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(ffi::GstPadProbeType::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0)))
    }
}

impl SetValue for PadProbeType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits())
    }
}

Sebastian Dröge's avatar
Sebastian Dröge committed
138
bitflags! {
139 140 141 142 143 144 145 146 147 148 149 150 151
    pub struct SeekFlags: u32 {
        const SEEK_FLAG_NONE = 0;
        const SEEK_FLAG_FLUSH = 1;
        const SEEK_FLAG_ACCURATE = 2;
        const SEEK_FLAG_KEY_UNIT = 4;
        const SEEK_FLAG_SEGMENT = 8;
        const SEEK_FLAG_TRICKMODE = 16;
        const SEEK_FLAG_SKIP = 16;
        const SEEK_FLAG_SNAP_BEFORE = 32;
        const SEEK_FLAG_SNAP_AFTER = 64;
        const SEEK_FLAG_SNAP_NEAREST = 96;
        const SEEK_FLAG_TRICKMODE_KEY_UNITS = 128;
        const SEEK_FLAG_TRICKMODE_NO_AUDIO = 256;
Sebastian Dröge's avatar
Sebastian Dröge committed
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
    }
}

#[doc(hidden)]
impl ToGlib for SeekFlags {
    type GlibType = ffi::GstSeekFlags;

    fn to_glib(&self) -> ffi::GstSeekFlags {
        ffi::GstSeekFlags::from_bits_truncate(self.bits())
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstSeekFlags> for SeekFlags {
    fn from_glib(value: ffi::GstSeekFlags) -> SeekFlags {
167
        skip_assert_initialized!();
Sebastian Dröge's avatar
Sebastian Dröge committed
168 169 170 171
        SeekFlags::from_bits_truncate(value.bits())
    }
}

Sebastian Dröge's avatar
Sebastian Dröge committed
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
impl StaticType for SeekFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_seek_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SeekFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SeekFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(ffi::GstSeekFlags::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0)))
    }
}

impl SetValue for SeekFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits())
    }
}

196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
bitflags! {
    pub struct StreamFlags: u32 {
        const STREAM_FLAG_NONE = 0;
        const STREAM_FLAG_SPARSE = 1;
        const STREAM_FLAG_SELECT = 2;
        const STREAM_FLAG_UNSELECT = 4;
    }
}

#[doc(hidden)]
impl ToGlib for StreamFlags {
    type GlibType = ffi::GstStreamFlags;

    fn to_glib(&self) -> ffi::GstStreamFlags {
        ffi::GstStreamFlags::from_bits_truncate(self.bits())
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstStreamFlags> for StreamFlags {
    fn from_glib(value: ffi::GstStreamFlags) -> StreamFlags {
217
        skip_assert_initialized!();
218 219 220 221
        StreamFlags::from_bits_truncate(value.bits())
    }
}

Sebastian Dröge's avatar
Sebastian Dröge committed
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
impl StaticType for StreamFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_stream_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for StreamFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for StreamFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(ffi::GstStreamFlags::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0)))
    }
}

impl SetValue for StreamFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits())
    }
}

246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
bitflags! {
    pub struct StreamType: u32 {
        const STREAM_TYPE_UNKNOWN = 1;
        const STREAM_TYPE_AUDIO = 2;
        const STREAM_TYPE_VIDEO = 4;
        const STREAM_TYPE_CONTAINER = 8;
        const STREAM_TYPE_TEXT = 16;
    }
}

#[doc(hidden)]
impl ToGlib for StreamType {
    type GlibType = ffi::GstStreamType;

    fn to_glib(&self) -> ffi::GstStreamType {
        ffi::GstStreamType::from_bits_truncate(self.bits())
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstStreamType> for StreamType {
    fn from_glib(value: ffi::GstStreamType) -> StreamType {
268
        skip_assert_initialized!();
269 270 271 272
        StreamType::from_bits_truncate(value.bits())
    }
}

Sebastian Dröge's avatar
Sebastian Dröge committed
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
impl StaticType for StreamType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_stream_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for StreamType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for StreamType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(ffi::GstStreamType::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0)))
    }
}

impl SetValue for StreamType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits())
    }
}