use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_audio_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum AudioChannelPosition {
None,
Mono,
Invalid,
FrontLeft,
FrontRight,
FrontCenter,
Lfe1,
RearLeft,
RearRight,
FrontLeftOfCenter,
FrontRightOfCenter,
RearCenter,
Lfe2,
SideLeft,
SideRight,
TopFrontLeft,
TopFrontRight,
TopFrontCenter,
TopCenter,
TopRearLeft,
TopRearRight,
TopSideLeft,
TopSideRight,
TopRearCenter,
BottomFrontCenter,
BottomFrontLeft,
BottomFrontRight,
WideLeft,
WideRight,
SurroundLeft,
SurroundRight,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for AudioChannelPosition {
type GlibType = gst_audio_sys::GstAudioChannelPosition;
fn to_glib(&self) -> gst_audio_sys::GstAudioChannelPosition {
match *self {
AudioChannelPosition::None => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_NONE,
AudioChannelPosition::Mono => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_MONO,
AudioChannelPosition::Invalid => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID,
AudioChannelPosition::FrontLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
AudioChannelPosition::FrontRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT
}
AudioChannelPosition::FrontCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER
}
AudioChannelPosition::Lfe1 => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_LFE1,
AudioChannelPosition::RearLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
AudioChannelPosition::RearRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
AudioChannelPosition::FrontLeftOfCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER
}
AudioChannelPosition::FrontRightOfCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER
}
AudioChannelPosition::RearCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_CENTER
}
AudioChannelPosition::Lfe2 => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_LFE2,
AudioChannelPosition::SideLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
AudioChannelPosition::SideRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
AudioChannelPosition::TopFrontLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_LEFT
}
AudioChannelPosition::TopFrontRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT
}
AudioChannelPosition::TopFrontCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER
}
AudioChannelPosition::TopCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_CENTER,
AudioChannelPosition::TopRearLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT
}
AudioChannelPosition::TopRearRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT
}
AudioChannelPosition::TopSideLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_LEFT
}
AudioChannelPosition::TopSideRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_RIGHT
}
AudioChannelPosition::TopRearCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER
}
AudioChannelPosition::BottomFrontCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_CENTER
}
AudioChannelPosition::BottomFrontLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_LEFT
}
AudioChannelPosition::BottomFrontRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_RIGHT
}
AudioChannelPosition::WideLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_WIDE_LEFT,
AudioChannelPosition::WideRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_WIDE_RIGHT,
AudioChannelPosition::SurroundLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SURROUND_LEFT
}
AudioChannelPosition::SurroundRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT
}
AudioChannelPosition::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioChannelPosition> for AudioChannelPosition {
fn from_glib(value: gst_audio_sys::GstAudioChannelPosition) -> Self {
skip_assert_initialized!();
match value {
-3 => AudioChannelPosition::None,
-2 => AudioChannelPosition::Mono,
-1 => AudioChannelPosition::Invalid,
0 => AudioChannelPosition::FrontLeft,
1 => AudioChannelPosition::FrontRight,
2 => AudioChannelPosition::FrontCenter,
3 => AudioChannelPosition::Lfe1,
4 => AudioChannelPosition::RearLeft,
5 => AudioChannelPosition::RearRight,
6 => AudioChannelPosition::FrontLeftOfCenter,
7 => AudioChannelPosition::FrontRightOfCenter,
8 => AudioChannelPosition::RearCenter,
9 => AudioChannelPosition::Lfe2,
10 => AudioChannelPosition::SideLeft,
11 => AudioChannelPosition::SideRight,
12 => AudioChannelPosition::TopFrontLeft,
13 => AudioChannelPosition::TopFrontRight,
14 => AudioChannelPosition::TopFrontCenter,
15 => AudioChannelPosition::TopCenter,
16 => AudioChannelPosition::TopRearLeft,
17 => AudioChannelPosition::TopRearRight,
18 => AudioChannelPosition::TopSideLeft,
19 => AudioChannelPosition::TopSideRight,
20 => AudioChannelPosition::TopRearCenter,
21 => AudioChannelPosition::BottomFrontCenter,
22 => AudioChannelPosition::BottomFrontLeft,
23 => AudioChannelPosition::BottomFrontRight,
24 => AudioChannelPosition::WideLeft,
25 => AudioChannelPosition::WideRight,
26 => AudioChannelPosition::SurroundLeft,
27 => AudioChannelPosition::SurroundRight,
value => AudioChannelPosition::__Unknown(value),
}
}
}
impl StaticType for AudioChannelPosition {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_channel_position_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for AudioChannelPosition {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for AudioChannelPosition {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioChannelPosition {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum AudioDitherMethod {
None,
Rpdf,
Tpdf,
TpdfHf,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for AudioDitherMethod {
type GlibType = gst_audio_sys::GstAudioDitherMethod;
fn to_glib(&self) -> gst_audio_sys::GstAudioDitherMethod {
match *self {
AudioDitherMethod::None => gst_audio_sys::GST_AUDIO_DITHER_NONE,
AudioDitherMethod::Rpdf => gst_audio_sys::GST_AUDIO_DITHER_RPDF,
AudioDitherMethod::Tpdf => gst_audio_sys::GST_AUDIO_DITHER_TPDF,
AudioDitherMethod::TpdfHf => gst_audio_sys::GST_AUDIO_DITHER_TPDF_HF,
AudioDitherMethod::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioDitherMethod> for AudioDitherMethod {
fn from_glib(value: gst_audio_sys::GstAudioDitherMethod) -> Self {
skip_assert_initialized!();
match value {
0 => AudioDitherMethod::None,
1 => AudioDitherMethod::Rpdf,
2 => AudioDitherMethod::Tpdf,
3 => AudioDitherMethod::TpdfHf,
value => AudioDitherMethod::__Unknown(value),
}
}
}
impl StaticType for AudioDitherMethod {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_dither_method_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for AudioDitherMethod {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for AudioDitherMethod {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioDitherMethod {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum AudioFormat {
Unknown,
Encoded,
S8,
U8,
S16le,
S16be,
U16le,
U16be,
S2432le,
S2432be,
U2432le,
U2432be,
S32le,
S32be,
U32le,
U32be,
S24le,
S24be,
U24le,
U24be,
S20le,
S20be,
U20le,
U20be,
S18le,
S18be,
U18le,
U18be,
F32le,
F32be,
F64le,
F64be,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for AudioFormat {
type GlibType = gst_audio_sys::GstAudioFormat;
fn to_glib(&self) -> gst_audio_sys::GstAudioFormat {
match *self {
AudioFormat::Unknown => gst_audio_sys::GST_AUDIO_FORMAT_UNKNOWN,
AudioFormat::Encoded => gst_audio_sys::GST_AUDIO_FORMAT_ENCODED,
AudioFormat::S8 => gst_audio_sys::GST_AUDIO_FORMAT_S8,
AudioFormat::U8 => gst_audio_sys::GST_AUDIO_FORMAT_U8,
AudioFormat::S16le => gst_audio_sys::GST_AUDIO_FORMAT_S16LE,
AudioFormat::S16be => gst_audio_sys::GST_AUDIO_FORMAT_S16BE,
AudioFormat::U16le => gst_audio_sys::GST_AUDIO_FORMAT_U16LE,
AudioFormat::U16be => gst_audio_sys::GST_AUDIO_FORMAT_U16BE,
AudioFormat::S2432le => gst_audio_sys::GST_AUDIO_FORMAT_S24_32LE,
AudioFormat::S2432be => gst_audio_sys::GST_AUDIO_FORMAT_S24_32BE,
AudioFormat::U2432le => gst_audio_sys::GST_AUDIO_FORMAT_U24_32LE,
AudioFormat::U2432be => gst_audio_sys::GST_AUDIO_FORMAT_U24_32BE,
AudioFormat::S32le => gst_audio_sys::GST_AUDIO_FORMAT_S32LE,
AudioFormat::S32be => gst_audio_sys::GST_AUDIO_FORMAT_S32BE,
AudioFormat::U32le => gst_audio_sys::GST_AUDIO_FORMAT_U32LE,
AudioFormat::U32be => gst_audio_sys::GST_AUDIO_FORMAT_U32BE,
AudioFormat::S24le => gst_audio_sys::GST_AUDIO_FORMAT_S24LE,
AudioFormat::S24be => gst_audio_sys::GST_AUDIO_FORMAT_S24BE,
AudioFormat::U24le => gst_audio_sys::GST_AUDIO_FORMAT_U24LE,
AudioFormat::U24be => gst_audio_sys::GST_AUDIO_FORMAT_U24BE,
AudioFormat::S20le => gst_audio_sys::GST_AUDIO_FORMAT_S20LE,
AudioFormat::S20be => gst_audio_sys::GST_AUDIO_FORMAT_S20BE,
AudioFormat::U20le => gst_audio_sys::GST_AUDIO_FORMAT_U20LE,
AudioFormat::U20be => gst_audio_sys::GST_AUDIO_FORMAT_U20BE,
AudioFormat::S18le => gst_audio_sys::GST_AUDIO_FORMAT_S18LE,
AudioFormat::S18be => gst_audio_sys::GST_AUDIO_FORMAT_S18BE,
AudioFormat::U18le => gst_audio_sys::GST_AUDIO_FORMAT_U18LE,
AudioFormat::U18be => gst_audio_sys::GST_AUDIO_FORMAT_U18BE,
AudioFormat::F32le => gst_audio_sys::GST_AUDIO_FORMAT_F32LE,
AudioFormat::F32be => gst_audio_sys::GST_AUDIO_FORMAT_F32BE,
AudioFormat::F64le => gst_audio_sys::GST_AUDIO_FORMAT_F64LE,
AudioFormat::F64be => gst_audio_sys::GST_AUDIO_FORMAT_F64BE,
AudioFormat::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioFormat> for AudioFormat {
fn from_glib(value: gst_audio_sys::GstAudioFormat) -> Self {
skip_assert_initialized!();
match value {
0 => AudioFormat::Unknown,
1 => AudioFormat::Encoded,
2 => AudioFormat::S8,
3 => AudioFormat::U8,
4 => AudioFormat::S16le,
5 => AudioFormat::S16be,
6 => AudioFormat::U16le,
7 => AudioFormat::U16be,
8 => AudioFormat::S2432le,
9 => AudioFormat::S2432be,
10 => AudioFormat::U2432le,
11 => AudioFormat::U2432be,
12 => AudioFormat::S32le,
13 => AudioFormat::S32be,
14 => AudioFormat::U32le,
15 => AudioFormat::U32be,
16 => AudioFormat::S24le,
17 => AudioFormat::S24be,
18 => AudioFormat::U24le,
19 => AudioFormat::U24be,
20 => AudioFormat::S20le,
21 => AudioFormat::S20be,
22 => AudioFormat::U20le,
23 => AudioFormat::U20be,
24 => AudioFormat::S18le,
25 => AudioFormat::S18be,
26 => AudioFormat::U18le,
27 => AudioFormat::U18be,
28 => AudioFormat::F32le,
29 => AudioFormat::F32be,
30 => AudioFormat::F64le,
31 => AudioFormat::F64be,
value => AudioFormat::__Unknown(value),
}
}
}
impl StaticType for AudioFormat {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_format_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for AudioFormat {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for AudioFormat {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioFormat {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum AudioLayout {
Interleaved,
NonInterleaved,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for AudioLayout {
type GlibType = gst_audio_sys::GstAudioLayout;
fn to_glib(&self) -> gst_audio_sys::GstAudioLayout {
match *self {
AudioLayout::Interleaved => gst_audio_sys::GST_AUDIO_LAYOUT_INTERLEAVED,
AudioLayout::NonInterleaved => gst_audio_sys::GST_AUDIO_LAYOUT_NON_INTERLEAVED,
AudioLayout::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioLayout> for AudioLayout {
fn from_glib(value: gst_audio_sys::GstAudioLayout) -> Self {
skip_assert_initialized!();
match value {
0 => AudioLayout::Interleaved,
1 => AudioLayout::NonInterleaved,
value => AudioLayout::__Unknown(value),
}
}
}
impl StaticType for AudioLayout {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_layout_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for AudioLayout {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for AudioLayout {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioLayout {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum AudioNoiseShapingMethod {
None,
ErrorFeedback,
Simple,
Medium,
High,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for AudioNoiseShapingMethod {
type GlibType = gst_audio_sys::GstAudioNoiseShapingMethod;
fn to_glib(&self) -> gst_audio_sys::GstAudioNoiseShapingMethod {
match *self {
AudioNoiseShapingMethod::None => gst_audio_sys::GST_AUDIO_NOISE_SHAPING_NONE,
AudioNoiseShapingMethod::ErrorFeedback => {
gst_audio_sys::GST_AUDIO_NOISE_SHAPING_ERROR_FEEDBACK
}
AudioNoiseShapingMethod::Simple => gst_audio_sys::GST_AUDIO_NOISE_SHAPING_SIMPLE,
AudioNoiseShapingMethod::Medium => gst_audio_sys::GST_AUDIO_NOISE_SHAPING_MEDIUM,
AudioNoiseShapingMethod::High => gst_audio_sys::GST_AUDIO_NOISE_SHAPING_HIGH,
AudioNoiseShapingMethod::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioNoiseShapingMethod> for AudioNoiseShapingMethod {
fn from_glib(value: gst_audio_sys::GstAudioNoiseShapingMethod) -> Self {
skip_assert_initialized!();
match value {
0 => AudioNoiseShapingMethod::None,
1 => AudioNoiseShapingMethod::ErrorFeedback,
2 => AudioNoiseShapingMethod::Simple,
3 => AudioNoiseShapingMethod::Medium,
4 => AudioNoiseShapingMethod::High,
value => AudioNoiseShapingMethod::__Unknown(value),
}
}
}
impl StaticType for AudioNoiseShapingMethod {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_noise_shaping_method_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for AudioNoiseShapingMethod {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for AudioNoiseShapingMethod {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioNoiseShapingMethod {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum AudioResamplerMethod {
Nearest,
Linear,
Cubic,
BlackmanNuttall,
Kaiser,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for AudioResamplerMethod {
type GlibType = gst_audio_sys::GstAudioResamplerMethod;
fn to_glib(&self) -> gst_audio_sys::GstAudioResamplerMethod {
match *self {
AudioResamplerMethod::Nearest => gst_audio_sys::GST_AUDIO_RESAMPLER_METHOD_NEAREST,
AudioResamplerMethod::Linear => gst_audio_sys::GST_AUDIO_RESAMPLER_METHOD_LINEAR,
AudioResamplerMethod::Cubic => gst_audio_sys::GST_AUDIO_RESAMPLER_METHOD_CUBIC,
AudioResamplerMethod::BlackmanNuttall => {
gst_audio_sys::GST_AUDIO_RESAMPLER_METHOD_BLACKMAN_NUTTALL
}
AudioResamplerMethod::Kaiser => gst_audio_sys::GST_AUDIO_RESAMPLER_METHOD_KAISER,
AudioResamplerMethod::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioResamplerMethod> for AudioResamplerMethod {
fn from_glib(value: gst_audio_sys::GstAudioResamplerMethod) -> Self {
skip_assert_initialized!();
match value {
0 => AudioResamplerMethod::Nearest,
1 => AudioResamplerMethod::Linear,
2 => AudioResamplerMethod::Cubic,
3 => AudioResamplerMethod::BlackmanNuttall,
4 => AudioResamplerMethod::Kaiser,
value => AudioResamplerMethod::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
impl StaticType for AudioResamplerMethod {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_resampler_method_get_type()) }
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
impl<'a> FromValueOptional<'a> for AudioResamplerMethod {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
impl<'a> FromValue<'a> for AudioResamplerMethod {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
impl SetValue for AudioResamplerMethod {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum AudioRingBufferFormatType {
Raw,
MuLaw,
ALaw,
ImaAdpcm,
Mpeg,
Gsm,
Iec958,
Ac3,
Eac3,
Dts,
Mpeg2Aac,
Mpeg4Aac,
#[cfg(any(feature = "v1_12", feature = "dox"))]
Mpeg2AacRaw,
#[cfg(any(feature = "v1_12", feature = "dox"))]
Mpeg4AacRaw,
#[cfg(any(feature = "v1_12", feature = "dox"))]
Flac,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for AudioRingBufferFormatType {
type GlibType = gst_audio_sys::GstAudioRingBufferFormatType;
fn to_glib(&self) -> gst_audio_sys::GstAudioRingBufferFormatType {
match *self {
AudioRingBufferFormatType::Raw => gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW,
AudioRingBufferFormatType::MuLaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW
}
AudioRingBufferFormatType::ALaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW
}
AudioRingBufferFormatType::ImaAdpcm => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IMA_ADPCM
}
AudioRingBufferFormatType::Mpeg => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG
}
AudioRingBufferFormatType::Gsm => gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_GSM,
AudioRingBufferFormatType::Iec958 => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958
}
AudioRingBufferFormatType::Ac3 => gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3,
AudioRingBufferFormatType::Eac3 => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3
}
AudioRingBufferFormatType::Dts => gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS,
AudioRingBufferFormatType::Mpeg2Aac => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC
}
AudioRingBufferFormatType::Mpeg4Aac => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
AudioRingBufferFormatType::Mpeg2AacRaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC_RAW
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
AudioRingBufferFormatType::Mpeg4AacRaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC_RAW
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
AudioRingBufferFormatType::Flac => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_FLAC
}
AudioRingBufferFormatType::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioRingBufferFormatType> for AudioRingBufferFormatType {
fn from_glib(value: gst_audio_sys::GstAudioRingBufferFormatType) -> Self {
skip_assert_initialized!();
match value {
0 => AudioRingBufferFormatType::Raw,
1 => AudioRingBufferFormatType::MuLaw,
2 => AudioRingBufferFormatType::ALaw,
3 => AudioRingBufferFormatType::ImaAdpcm,
4 => AudioRingBufferFormatType::Mpeg,
5 => AudioRingBufferFormatType::Gsm,
6 => AudioRingBufferFormatType::Iec958,
7 => AudioRingBufferFormatType::Ac3,
8 => AudioRingBufferFormatType::Eac3,
9 => AudioRingBufferFormatType::Dts,
10 => AudioRingBufferFormatType::Mpeg2Aac,
11 => AudioRingBufferFormatType::Mpeg4Aac,
#[cfg(any(feature = "v1_12", feature = "dox"))]
12 => AudioRingBufferFormatType::Mpeg2AacRaw,
#[cfg(any(feature = "v1_12", feature = "dox"))]
13 => AudioRingBufferFormatType::Mpeg4AacRaw,
#[cfg(any(feature = "v1_12", feature = "dox"))]
14 => AudioRingBufferFormatType::Flac,
value => AudioRingBufferFormatType::__Unknown(value),
}
}
}
impl StaticType for AudioRingBufferFormatType {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_ring_buffer_format_type_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for AudioRingBufferFormatType {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for AudioRingBufferFormatType {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioRingBufferFormatType {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum StreamVolumeFormat {
Linear,
Cubic,
Db,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for StreamVolumeFormat {
type GlibType = gst_audio_sys::GstStreamVolumeFormat;
fn to_glib(&self) -> gst_audio_sys::GstStreamVolumeFormat {
match *self {
StreamVolumeFormat::Linear => gst_audio_sys::GST_STREAM_VOLUME_FORMAT_LINEAR,
StreamVolumeFormat::Cubic => gst_audio_sys::GST_STREAM_VOLUME_FORMAT_CUBIC,
StreamVolumeFormat::Db => gst_audio_sys::GST_STREAM_VOLUME_FORMAT_DB,
StreamVolumeFormat::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstStreamVolumeFormat> for StreamVolumeFormat {
fn from_glib(value: gst_audio_sys::GstStreamVolumeFormat) -> Self {
skip_assert_initialized!();
match value {
0 => StreamVolumeFormat::Linear,
1 => StreamVolumeFormat::Cubic,
2 => StreamVolumeFormat::Db,
value => StreamVolumeFormat::__Unknown(value),
}
}
}