gstreamer-rs/gstreamer/src/auto/enums.rs

336 lines
9.9 KiB
Rust
Raw Normal View History

// This file was generated by gir (b155303) from gir-files (???)
// DO NOT EDIT
use ffi;
use glib::translate::*;
#[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)]
__Nonexhaustive(()),
}
#[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::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstFlowReturn> for FlowReturn {
fn from_glib(value: ffi::GstFlowReturn) -> Self {
match value {
ffi::GST_FLOW_CUSTOM_SUCCESS_2 => FlowReturn::CustomSuccess2,
ffi::GST_FLOW_CUSTOM_SUCCESS_1 => FlowReturn::CustomSuccess1,
ffi::GST_FLOW_CUSTOM_SUCCESS => FlowReturn::CustomSuccess,
ffi::GST_FLOW_OK => FlowReturn::Ok,
ffi::GST_FLOW_NOT_LINKED => FlowReturn::NotLinked,
ffi::GST_FLOW_FLUSHING => FlowReturn::Flushing,
ffi::GST_FLOW_EOS => FlowReturn::Eos,
ffi::GST_FLOW_NOT_NEGOTIATED => FlowReturn::NotNegotiated,
ffi::GST_FLOW_ERROR => FlowReturn::Error,
ffi::GST_FLOW_NOT_SUPPORTED => FlowReturn::NotSupported,
ffi::GST_FLOW_CUSTOM_ERROR => FlowReturn::CustomError,
ffi::GST_FLOW_CUSTOM_ERROR_1 => FlowReturn::CustomError1,
ffi::GST_FLOW_CUSTOM_ERROR_2 => FlowReturn::CustomError2,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Format {
Undefined,
Default,
Bytes,
Time,
Buffers,
Percent,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[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::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstFormat> for Format {
fn from_glib(value: ffi::GstFormat) -> Self {
match value {
ffi::GST_FORMAT_UNDEFINED => Format::Undefined,
ffi::GST_FORMAT_DEFAULT => Format::Default,
ffi::GST_FORMAT_BYTES => Format::Bytes,
ffi::GST_FORMAT_TIME => Format::Time,
ffi::GST_FORMAT_BUFFERS => Format::Buffers,
ffi::GST_FORMAT_PERCENT => Format::Percent,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum PadDirection {
Unknown,
Src,
Sink,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[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::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstPadDirection> for PadDirection {
fn from_glib(value: ffi::GstPadDirection) -> Self {
match value {
ffi::GST_PAD_UNKNOWN => PadDirection::Unknown,
ffi::GST_PAD_SRC => PadDirection::Src,
ffi::GST_PAD_SINK => PadDirection::Sink,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum SeekType {
None,
Set,
End,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[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::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstSeekType> for SeekType {
fn from_glib(value: ffi::GstSeekType) -> Self {
match value {
ffi::GST_SEEK_TYPE_NONE => SeekType::None,
ffi::GST_SEEK_TYPE_SET => SeekType::Set,
ffi::GST_SEEK_TYPE_END => SeekType::End,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum State {
VoidPending,
Null,
Ready,
Paused,
Playing,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[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::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstState> for State {
fn from_glib(value: ffi::GstState) -> Self {
match value {
ffi::GST_STATE_VOID_PENDING => State::VoidPending,
ffi::GST_STATE_NULL => State::Null,
ffi::GST_STATE_READY => State::Ready,
ffi::GST_STATE_PAUSED => State::Paused,
ffi::GST_STATE_PLAYING => State::Playing,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum StateChange {
NullToReady,
ReadyToPaused,
PausedToPlaying,
PlayingToPaused,
PausedToReady,
ReadyToNull,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[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::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstStateChange> for StateChange {
fn from_glib(value: ffi::GstStateChange) -> Self {
match value {
ffi::GST_STATE_CHANGE_NULL_TO_READY => StateChange::NullToReady,
ffi::GST_STATE_CHANGE_READY_TO_PAUSED => StateChange::ReadyToPaused,
ffi::GST_STATE_CHANGE_PAUSED_TO_PLAYING => StateChange::PausedToPlaying,
ffi::GST_STATE_CHANGE_PLAYING_TO_PAUSED => StateChange::PlayingToPaused,
ffi::GST_STATE_CHANGE_PAUSED_TO_READY => StateChange::PausedToReady,
ffi::GST_STATE_CHANGE_READY_TO_NULL => StateChange::ReadyToNull,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum StateChangeReturn {
Failure,
Success,
Async,
NoPreroll,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[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::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstStateChangeReturn> for StateChangeReturn {
fn from_glib(value: ffi::GstStateChangeReturn) -> Self {
match value {
ffi::GST_STATE_CHANGE_FAILURE => StateChangeReturn::Failure,
ffi::GST_STATE_CHANGE_SUCCESS => StateChangeReturn::Success,
ffi::GST_STATE_CHANGE_ASYNC => StateChangeReturn::Async,
ffi::GST_STATE_CHANGE_NO_PREROLL => StateChangeReturn::NoPreroll,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum URIType {
Unknown,
Sink,
Src,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[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::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstURIType> for URIType {
fn from_glib(value: ffi::GstURIType) -> Self {
match value {
ffi::GST_URI_UNKNOWN => URIType::Unknown,
ffi::GST_URI_SINK => URIType::Sink,
ffi::GST_URI_SRC => URIType::Src,
}
}
}