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)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
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;
|
2021-04-19 16:24:43 +00:00
|
|
|
use glib::value::ToValue;
|
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]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstAppStreamType")]
|
2017-08-01 12:37:22 +00:00
|
|
|
pub enum AppStreamType {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_APP_STREAM_TYPE_STREAM")]
|
2017-08-01 12:37:22 +00:00
|
|
|
Stream,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_APP_STREAM_TYPE_SEEKABLE")]
|
2017-08-01 12:37:22 +00:00
|
|
|
Seekable,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_APP_STREAM_TYPE_RANDOM_ACCESS")]
|
2017-08-01 12:37:22 +00:00
|
|
|
RandomAccess,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for AppStreamType {
|
2020-11-21 18:05:57 +00:00
|
|
|
type GlibType = ffi::GstAppStreamType;
|
2017-08-01 12:37:22 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstAppStreamType {
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for AppStreamType {
|
|
|
|
type Type = Self;
|
2017-08-01 12:37:22 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for AppStreamType {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for AppStreamType {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
|
|
|
let mut value = glib::Value::for_value_type::<AppStreamType>();
|
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2017-08-01 12:37:22 +00:00
|
|
|
}
|
|
|
|
}
|