mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-15 14:02:32 +00:00
344 lines
9.5 KiB
Rust
344 lines
9.5 KiB
Rust
// This file was generated by gir (33e9567) from gir-files (???)
|
|
// DO NOT EDIT
|
|
|
|
use ffi;
|
|
use glib::translate::*;
|
|
use std;
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
|
pub enum FlowReturn {
|
|
CustomSuccess2,
|
|
CustomSuccess1,
|
|
CustomSuccess,
|
|
Ok,
|
|
NotLinked,
|
|
Flushing,
|
|
Eos,
|
|
NotNegotiated,
|
|
Error,
|
|
NotSupported,
|
|
CustomError,
|
|
CustomError1,
|
|
CustomError2,
|
|
#[doc(hidden)]
|
|
__Unknown(i32),
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl ToGlib for FlowReturn {
|
|
type GlibType = ffi::GstFlowReturn;
|
|
|
|
fn to_glib(&self) -> ffi::GstFlowReturn {
|
|
match *self {
|
|
FlowReturn::CustomSuccess2 => ffi::GST_FLOW_CUSTOM_SUCCESS_2,
|
|
FlowReturn::CustomSuccess1 => ffi::GST_FLOW_CUSTOM_SUCCESS_1,
|
|
FlowReturn::CustomSuccess => ffi::GST_FLOW_CUSTOM_SUCCESS,
|
|
FlowReturn::Ok => ffi::GST_FLOW_OK,
|
|
FlowReturn::NotLinked => ffi::GST_FLOW_NOT_LINKED,
|
|
FlowReturn::Flushing => ffi::GST_FLOW_FLUSHING,
|
|
FlowReturn::Eos => ffi::GST_FLOW_EOS,
|
|
FlowReturn::NotNegotiated => ffi::GST_FLOW_NOT_NEGOTIATED,
|
|
FlowReturn::Error => ffi::GST_FLOW_ERROR,
|
|
FlowReturn::NotSupported => ffi::GST_FLOW_NOT_SUPPORTED,
|
|
FlowReturn::CustomError => ffi::GST_FLOW_CUSTOM_ERROR,
|
|
FlowReturn::CustomError1 => ffi::GST_FLOW_CUSTOM_ERROR_1,
|
|
FlowReturn::CustomError2 => ffi::GST_FLOW_CUSTOM_ERROR_2,
|
|
FlowReturn::__Unknown(value) => unsafe{std::mem::transmute(value)}
|
|
}
|
|
}
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl FromGlib<ffi::GstFlowReturn> for FlowReturn {
|
|
fn from_glib(value: ffi::GstFlowReturn) -> Self {
|
|
match value as i32 {
|
|
102 => FlowReturn::CustomSuccess2,
|
|
101 => FlowReturn::CustomSuccess1,
|
|
100 => FlowReturn::CustomSuccess,
|
|
0 => FlowReturn::Ok,
|
|
-1 => FlowReturn::NotLinked,
|
|
-2 => FlowReturn::Flushing,
|
|
-3 => FlowReturn::Eos,
|
|
-4 => FlowReturn::NotNegotiated,
|
|
-5 => FlowReturn::Error,
|
|
-6 => FlowReturn::NotSupported,
|
|
-100 => FlowReturn::CustomError,
|
|
-101 => FlowReturn::CustomError1,
|
|
-102 => FlowReturn::CustomError2,
|
|
value => FlowReturn::__Unknown(value),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
|
pub enum Format {
|
|
Undefined,
|
|
Default,
|
|
Bytes,
|
|
Time,
|
|
Buffers,
|
|
Percent,
|
|
#[doc(hidden)]
|
|
__Unknown(i32),
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl ToGlib for Format {
|
|
type GlibType = ffi::GstFormat;
|
|
|
|
fn to_glib(&self) -> ffi::GstFormat {
|
|
match *self {
|
|
Format::Undefined => ffi::GST_FORMAT_UNDEFINED,
|
|
Format::Default => ffi::GST_FORMAT_DEFAULT,
|
|
Format::Bytes => ffi::GST_FORMAT_BYTES,
|
|
Format::Time => ffi::GST_FORMAT_TIME,
|
|
Format::Buffers => ffi::GST_FORMAT_BUFFERS,
|
|
Format::Percent => ffi::GST_FORMAT_PERCENT,
|
|
Format::__Unknown(value) => unsafe{std::mem::transmute(value)}
|
|
}
|
|
}
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl FromGlib<ffi::GstFormat> for Format {
|
|
fn from_glib(value: ffi::GstFormat) -> Self {
|
|
match value as i32 {
|
|
0 => Format::Undefined,
|
|
1 => Format::Default,
|
|
2 => Format::Bytes,
|
|
3 => Format::Time,
|
|
4 => Format::Buffers,
|
|
5 => Format::Percent,
|
|
value => Format::__Unknown(value),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
|
pub enum PadDirection {
|
|
Unknown,
|
|
Src,
|
|
Sink,
|
|
#[doc(hidden)]
|
|
__Unknown(i32),
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl ToGlib for PadDirection {
|
|
type GlibType = ffi::GstPadDirection;
|
|
|
|
fn to_glib(&self) -> ffi::GstPadDirection {
|
|
match *self {
|
|
PadDirection::Unknown => ffi::GST_PAD_UNKNOWN,
|
|
PadDirection::Src => ffi::GST_PAD_SRC,
|
|
PadDirection::Sink => ffi::GST_PAD_SINK,
|
|
PadDirection::__Unknown(value) => unsafe{std::mem::transmute(value)}
|
|
}
|
|
}
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl FromGlib<ffi::GstPadDirection> for PadDirection {
|
|
fn from_glib(value: ffi::GstPadDirection) -> Self {
|
|
match value as i32 {
|
|
0 => PadDirection::Unknown,
|
|
1 => PadDirection::Src,
|
|
2 => PadDirection::Sink,
|
|
value => PadDirection::__Unknown(value),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
|
pub enum SeekType {
|
|
None,
|
|
Set,
|
|
End,
|
|
#[doc(hidden)]
|
|
__Unknown(i32),
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl ToGlib for SeekType {
|
|
type GlibType = ffi::GstSeekType;
|
|
|
|
fn to_glib(&self) -> ffi::GstSeekType {
|
|
match *self {
|
|
SeekType::None => ffi::GST_SEEK_TYPE_NONE,
|
|
SeekType::Set => ffi::GST_SEEK_TYPE_SET,
|
|
SeekType::End => ffi::GST_SEEK_TYPE_END,
|
|
SeekType::__Unknown(value) => unsafe{std::mem::transmute(value)}
|
|
}
|
|
}
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl FromGlib<ffi::GstSeekType> for SeekType {
|
|
fn from_glib(value: ffi::GstSeekType) -> Self {
|
|
match value as i32 {
|
|
0 => SeekType::None,
|
|
1 => SeekType::Set,
|
|
2 => SeekType::End,
|
|
value => SeekType::__Unknown(value),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
|
pub enum State {
|
|
VoidPending,
|
|
Null,
|
|
Ready,
|
|
Paused,
|
|
Playing,
|
|
#[doc(hidden)]
|
|
__Unknown(i32),
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl ToGlib for State {
|
|
type GlibType = ffi::GstState;
|
|
|
|
fn to_glib(&self) -> ffi::GstState {
|
|
match *self {
|
|
State::VoidPending => ffi::GST_STATE_VOID_PENDING,
|
|
State::Null => ffi::GST_STATE_NULL,
|
|
State::Ready => ffi::GST_STATE_READY,
|
|
State::Paused => ffi::GST_STATE_PAUSED,
|
|
State::Playing => ffi::GST_STATE_PLAYING,
|
|
State::__Unknown(value) => unsafe{std::mem::transmute(value)}
|
|
}
|
|
}
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl FromGlib<ffi::GstState> for State {
|
|
fn from_glib(value: ffi::GstState) -> Self {
|
|
match value as i32 {
|
|
0 => State::VoidPending,
|
|
1 => State::Null,
|
|
2 => State::Ready,
|
|
3 => State::Paused,
|
|
4 => State::Playing,
|
|
value => State::__Unknown(value),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
|
pub enum StateChange {
|
|
NullToReady,
|
|
ReadyToPaused,
|
|
PausedToPlaying,
|
|
PlayingToPaused,
|
|
PausedToReady,
|
|
ReadyToNull,
|
|
#[doc(hidden)]
|
|
__Unknown(i32),
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl ToGlib for StateChange {
|
|
type GlibType = ffi::GstStateChange;
|
|
|
|
fn to_glib(&self) -> ffi::GstStateChange {
|
|
match *self {
|
|
StateChange::NullToReady => ffi::GST_STATE_CHANGE_NULL_TO_READY,
|
|
StateChange::ReadyToPaused => ffi::GST_STATE_CHANGE_READY_TO_PAUSED,
|
|
StateChange::PausedToPlaying => ffi::GST_STATE_CHANGE_PAUSED_TO_PLAYING,
|
|
StateChange::PlayingToPaused => ffi::GST_STATE_CHANGE_PLAYING_TO_PAUSED,
|
|
StateChange::PausedToReady => ffi::GST_STATE_CHANGE_PAUSED_TO_READY,
|
|
StateChange::ReadyToNull => ffi::GST_STATE_CHANGE_READY_TO_NULL,
|
|
StateChange::__Unknown(value) => unsafe{std::mem::transmute(value)}
|
|
}
|
|
}
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl FromGlib<ffi::GstStateChange> for StateChange {
|
|
fn from_glib(value: ffi::GstStateChange) -> Self {
|
|
match value as i32 {
|
|
10 => StateChange::NullToReady,
|
|
19 => StateChange::ReadyToPaused,
|
|
28 => StateChange::PausedToPlaying,
|
|
35 => StateChange::PlayingToPaused,
|
|
26 => StateChange::PausedToReady,
|
|
17 => StateChange::ReadyToNull,
|
|
value => StateChange::__Unknown(value),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
|
pub enum StateChangeReturn {
|
|
Failure,
|
|
Success,
|
|
Async,
|
|
NoPreroll,
|
|
#[doc(hidden)]
|
|
__Unknown(i32),
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl ToGlib for StateChangeReturn {
|
|
type GlibType = ffi::GstStateChangeReturn;
|
|
|
|
fn to_glib(&self) -> ffi::GstStateChangeReturn {
|
|
match *self {
|
|
StateChangeReturn::Failure => ffi::GST_STATE_CHANGE_FAILURE,
|
|
StateChangeReturn::Success => ffi::GST_STATE_CHANGE_SUCCESS,
|
|
StateChangeReturn::Async => ffi::GST_STATE_CHANGE_ASYNC,
|
|
StateChangeReturn::NoPreroll => ffi::GST_STATE_CHANGE_NO_PREROLL,
|
|
StateChangeReturn::__Unknown(value) => unsafe{std::mem::transmute(value)}
|
|
}
|
|
}
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl FromGlib<ffi::GstStateChangeReturn> for StateChangeReturn {
|
|
fn from_glib(value: ffi::GstStateChangeReturn) -> Self {
|
|
match value as i32 {
|
|
0 => StateChangeReturn::Failure,
|
|
1 => StateChangeReturn::Success,
|
|
2 => StateChangeReturn::Async,
|
|
3 => StateChangeReturn::NoPreroll,
|
|
value => StateChangeReturn::__Unknown(value),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
|
pub enum URIType {
|
|
Unknown,
|
|
Sink,
|
|
Src,
|
|
#[doc(hidden)]
|
|
__Unknown(i32),
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl ToGlib for URIType {
|
|
type GlibType = ffi::GstURIType;
|
|
|
|
fn to_glib(&self) -> ffi::GstURIType {
|
|
match *self {
|
|
URIType::Unknown => ffi::GST_URI_UNKNOWN,
|
|
URIType::Sink => ffi::GST_URI_SINK,
|
|
URIType::Src => ffi::GST_URI_SRC,
|
|
URIType::__Unknown(value) => unsafe{std::mem::transmute(value)}
|
|
}
|
|
}
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl FromGlib<ffi::GstURIType> for URIType {
|
|
fn from_glib(value: ffi::GstURIType) -> Self {
|
|
match value as i32 {
|
|
0 => URIType::Unknown,
|
|
1 => URIType::Sink,
|
|
2 => URIType::Src,
|
|
value => URIType::__Unknown(value),
|
|
}
|
|
}
|
|
}
|
|
|