2018-04-23 17:34:22 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2017-08-01 12:37:22 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
use glib::translate::*;
|
2018-02-17 17:58:41 +00:00
|
|
|
use glib::value::FromValue;
|
|
|
|
use glib::value::FromValueOptional;
|
|
|
|
use glib::value::SetValue;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::StaticType;
|
|
|
|
use glib::Type;
|
2017-08-01 12:37:22 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2017-08-01 12:37:22 +00:00
|
|
|
pub enum AppStreamType {
|
|
|
|
Stream,
|
|
|
|
Seekable,
|
|
|
|
RandomAccess,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
|
|
|
impl ToGlib for AppStreamType {
|
2020-11-21 18:05:57 +00:00
|
|
|
type GlibType = ffi::GstAppStreamType;
|
2017-08-01 12:37:22 +00:00
|
|
|
|
2020-11-21 18:05:57 +00:00
|
|
|
fn to_glib(&self) -> ffi::GstAppStreamType {
|
2017-08-01 12:37:22 +00:00
|
|
|
match *self {
|
2020-11-21 18:05:57 +00:00
|
|
|
AppStreamType::Stream => ffi::GST_APP_STREAM_TYPE_STREAM,
|
|
|
|
AppStreamType::Seekable => ffi::GST_APP_STREAM_TYPE_SEEKABLE,
|
|
|
|
AppStreamType::RandomAccess => ffi::GST_APP_STREAM_TYPE_RANDOM_ACCESS,
|
2019-06-18 10:12:00 +00:00
|
|
|
AppStreamType::__Unknown(value) => value,
|
2017-08-01 12:37:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-21 18:05:57 +00:00
|
|
|
impl FromGlib<ffi::GstAppStreamType> for AppStreamType {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstAppStreamType) -> Self {
|
2017-08-01 12:37:22 +00:00
|
|
|
skip_assert_initialized!();
|
2017-11-05 17:01:15 +00:00
|
|
|
match value {
|
2017-08-01 12:37:22 +00:00
|
|
|
0 => AppStreamType::Stream,
|
|
|
|
1 => AppStreamType::Seekable,
|
|
|
|
2 => AppStreamType::RandomAccess,
|
|
|
|
value => AppStreamType::__Unknown(value),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl StaticType for AppStreamType {
|
|
|
|
fn static_type() -> Type {
|
2020-11-21 18:05:57 +00:00
|
|
|
unsafe { from_glib(ffi::gst_app_stream_type_get_type()) }
|
2017-08-01 12:37:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> FromValueOptional<'a> for AppStreamType {
|
2020-11-27 13:37:24 +00:00
|
|
|
unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> {
|
2017-08-01 12:37:22 +00:00
|
|
|
Some(FromValue::from_value(value))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> FromValue<'a> for AppStreamType {
|
2020-11-27 13:37:24 +00:00
|
|
|
unsafe fn from_value(value: &glib::Value) -> Self {
|
2020-11-21 18:05:57 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2017-08-01 12:37:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SetValue for AppStreamType {
|
2020-11-27 13:37:24 +00:00
|
|
|
unsafe fn set_value(value: &mut glib::Value, this: &Self) {
|
2020-11-21 18:05:57 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
2017-08-01 12:37:22 +00:00
|
|
|
}
|
|
|
|
}
|