Commit 3179806f authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Regenerate everything with latest GIR

And fix-up manual code
parent 99a60e92
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use AppStreamType; use AppStreamType;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
...@@ -7,7 +7,6 @@ use glib::StaticType; ...@@ -7,7 +7,6 @@ use glib::StaticType;
use glib::value::{Value, SetValue, FromValue, FromValueOptional}; use glib::value::{Value, SetValue, FromValue, FromValueOptional};
use gobject_ffi; use gobject_ffi;
use glib::translate::*; use glib::translate::*;
use std;
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum AppStreamType { pub enum AppStreamType {
...@@ -27,7 +26,7 @@ impl ToGlib for AppStreamType { ...@@ -27,7 +26,7 @@ impl ToGlib for AppStreamType {
AppStreamType::Stream => ffi::GST_APP_STREAM_TYPE_STREAM, AppStreamType::Stream => ffi::GST_APP_STREAM_TYPE_STREAM,
AppStreamType::Seekable => ffi::GST_APP_STREAM_TYPE_SEEKABLE, AppStreamType::Seekable => ffi::GST_APP_STREAM_TYPE_SEEKABLE,
AppStreamType::RandomAccess => ffi::GST_APP_STREAM_TYPE_RANDOM_ACCESS, AppStreamType::RandomAccess => ffi::GST_APP_STREAM_TYPE_RANDOM_ACCESS,
AppStreamType::__Unknown(value) => unsafe{std::mem::transmute(value)} AppStreamType::__Unknown(value) => value
} }
} }
} }
...@@ -36,7 +35,7 @@ impl ToGlib for AppStreamType { ...@@ -36,7 +35,7 @@ impl ToGlib for AppStreamType {
impl FromGlib<ffi::GstAppStreamType> for AppStreamType { impl FromGlib<ffi::GstAppStreamType> for AppStreamType {
fn from_glib(value: ffi::GstAppStreamType) -> Self { fn from_glib(value: ffi::GstAppStreamType) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value as i32 { match value {
0 => AppStreamType::Stream, 0 => AppStreamType::Stream,
1 => AppStreamType::Seekable, 1 => AppStreamType::Seekable,
2 => AppStreamType::RandomAccess, 2 => AppStreamType::RandomAccess,
...@@ -59,13 +58,13 @@ impl<'a> FromValueOptional<'a> for AppStreamType { ...@@ -59,13 +58,13 @@ impl<'a> FromValueOptional<'a> for AppStreamType {
impl<'a> FromValue<'a> for AppStreamType { impl<'a> FromValue<'a> for AppStreamType {
unsafe fn from_value(value: &Value) -> Self { unsafe fn from_value(value: &Value) -> Self {
from_glib(std::mem::transmute::<i32, ffi::GstAppStreamType>(gobject_ffi::g_value_get_enum(value.to_glib_none().0))) from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
} }
} }
impl SetValue for AppStreamType { impl SetValue for AppStreamType {
unsafe fn set_value(value: &mut Value, this: &Self) { unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32) gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
} }
} }
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod app_sink; mod app_sink;
......
...@@ -36,7 +36,7 @@ impl AudioChannelPosition { ...@@ -36,7 +36,7 @@ impl AudioChannelPosition {
let positions_raw: [ffi::GstAudioChannelPosition; 64] = let positions_raw: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= len as usize { array_init::array_init_copy(|i| if i >= len as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
positions[i].to_glib() positions[i].to_glib()
}); });
...@@ -69,7 +69,7 @@ impl AudioChannelPosition { ...@@ -69,7 +69,7 @@ impl AudioChannelPosition {
let len = positions.len(); let len = positions.len();
let mut positions_raw: [ffi::GstAudioChannelPosition; 64] = let mut positions_raw: [ffi::GstAudioChannelPosition; 64] =
[ffi::GstAudioChannelPosition::Invalid; 64]; [ffi::GST_AUDIO_CHANNEL_POSITION_INVALID; 64];
let valid: bool = unsafe { let valid: bool = unsafe {
from_glib(ffi::gst_audio_channel_positions_from_mask( from_glib(ffi::gst_audio_channel_positions_from_mask(
len as i32, len as i32,
...@@ -102,7 +102,7 @@ impl AudioChannelPosition { ...@@ -102,7 +102,7 @@ impl AudioChannelPosition {
let len = positions.len(); let len = positions.len();
let mut positions_raw: [ffi::GstAudioChannelPosition; 64] = let mut positions_raw: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= len as usize { array_init::array_init_copy(|i| if i >= len as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
positions[i].to_glib() positions[i].to_glib()
}); });
...@@ -145,7 +145,7 @@ impl AudioChannelPosition { ...@@ -145,7 +145,7 @@ impl AudioChannelPosition {
let len = positions.len(); let len = positions.len();
let positions_raw: [ffi::GstAudioChannelPosition; 64] = let positions_raw: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= len as usize { array_init::array_init_copy(|i| if i >= len as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
positions[i].to_glib() positions[i].to_glib()
}); });
...@@ -178,14 +178,14 @@ pub fn buffer_reorder_channels( ...@@ -178,14 +178,14 @@ pub fn buffer_reorder_channels(
let from_raw: [ffi::GstAudioChannelPosition; 64] = let from_raw: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= from_len as usize { array_init::array_init_copy(|i| if i >= from_len as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
from[i].to_glib() from[i].to_glib()
}); });
let to_raw: [ffi::GstAudioChannelPosition; 64] = let to_raw: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= to_len as usize { array_init::array_init_copy(|i| if i >= to_len as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
to[i].to_glib() to[i].to_glib()
}); });
...@@ -225,14 +225,14 @@ pub fn reorder_channels( ...@@ -225,14 +225,14 @@ pub fn reorder_channels(
let from_raw: [ffi::GstAudioChannelPosition; 64] = let from_raw: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= from_len as usize { array_init::array_init_copy(|i| if i >= from_len as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
from[i].to_glib() from[i].to_glib()
}); });
let to_raw: [ffi::GstAudioChannelPosition; 64] = let to_raw: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= to_len as usize { array_init::array_init_copy(|i| if i >= to_len as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
to[i].to_glib() to[i].to_glib()
}); });
...@@ -271,14 +271,14 @@ pub fn get_channel_reorder_map( ...@@ -271,14 +271,14 @@ pub fn get_channel_reorder_map(
let from_raw: [ffi::GstAudioChannelPosition; 64] = let from_raw: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= from_len as usize { array_init::array_init_copy(|i| if i >= from_len as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
from[i].to_glib() from[i].to_glib()
}); });
let to_raw: [ffi::GstAudioChannelPosition; 64] = let to_raw: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= to_len as usize { array_init::array_init_copy(|i| if i >= to_len as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
to[i].to_glib() to[i].to_glib()
}); });
......
...@@ -44,7 +44,7 @@ impl<'a> AudioInfoBuilder<'a> { ...@@ -44,7 +44,7 @@ impl<'a> AudioInfoBuilder<'a> {
let positions: [ffi::GstAudioChannelPosition; 64] = let positions: [ffi::GstAudioChannelPosition; 64] =
array_init::array_init_copy(|i| if i >= self.channels as usize { array_init::array_init_copy(|i| if i >= self.channels as usize {
ffi::GstAudioChannelPosition::Invalid ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
} else { } else {
p[i].to_glib() p[i].to_glib()
}); });
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
...@@ -7,7 +7,6 @@ use glib::StaticType; ...@@ -7,7 +7,6 @@ use glib::StaticType;
use glib::value::{Value, SetValue, FromValue, FromValueOptional}; use glib::value::{Value, SetValue, FromValue, FromValueOptional};
use gobject_ffi; use gobject_ffi;
use glib::translate::*; use glib::translate::*;
use std;
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum AudioChannelPosition { pub enum AudioChannelPosition {
...@@ -83,7 +82,7 @@ impl ToGlib for AudioChannelPosition { ...@@ -83,7 +82,7 @@ impl ToGlib for AudioChannelPosition {
AudioChannelPosition::WideRight => ffi::GST_AUDIO_CHANNEL_POSITION_WIDE_RIGHT, AudioChannelPosition::WideRight => ffi::GST_AUDIO_CHANNEL_POSITION_WIDE_RIGHT,
AudioChannelPosition::SurroundLeft => ffi::GST_AUDIO_CHANNEL_POSITION_SURROUND_LEFT, AudioChannelPosition::SurroundLeft => ffi::GST_AUDIO_CHANNEL_POSITION_SURROUND_LEFT,
AudioChannelPosition::SurroundRight => ffi::GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT, AudioChannelPosition::SurroundRight => ffi::GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT,
AudioChannelPosition::__Unknown(value) => unsafe{std::mem::transmute(value)} AudioChannelPosition::__Unknown(value) => value
} }
} }
} }
...@@ -92,7 +91,7 @@ impl ToGlib for AudioChannelPosition { ...@@ -92,7 +91,7 @@ impl ToGlib for AudioChannelPosition {
impl FromGlib<ffi::GstAudioChannelPosition> for AudioChannelPosition { impl FromGlib<ffi::GstAudioChannelPosition> for AudioChannelPosition {
fn from_glib(value: ffi::GstAudioChannelPosition) -> Self { fn from_glib(value: ffi::GstAudioChannelPosition) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value as i32 { match value {
-3 => AudioChannelPosition::None, -3 => AudioChannelPosition::None,
-2 => AudioChannelPosition::Mono, -2 => AudioChannelPosition::Mono,
-1 => AudioChannelPosition::Invalid, -1 => AudioChannelPosition::Invalid,
...@@ -143,13 +142,13 @@ impl<'a> FromValueOptional<'a> for AudioChannelPosition { ...@@ -143,13 +142,13 @@ impl<'a> FromValueOptional<'a> for AudioChannelPosition {
impl<'a> FromValue<'a> for AudioChannelPosition { impl<'a> FromValue<'a> for AudioChannelPosition {
unsafe fn from_value(value: &Value) -> Self { unsafe fn from_value(value: &Value) -> Self {
from_glib(std::mem::transmute::<i32, ffi::GstAudioChannelPosition>(gobject_ffi::g_value_get_enum(value.to_glib_none().0))) from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
} }
} }
impl SetValue for AudioChannelPosition { impl SetValue for AudioChannelPosition {
unsafe fn set_value(value: &mut Value, this: &Self) { unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32) gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
} }
} }
...@@ -229,7 +228,7 @@ impl ToGlib for AudioFormat { ...@@ -229,7 +228,7 @@ impl ToGlib for AudioFormat {
AudioFormat::F32be => ffi::GST_AUDIO_FORMAT_F32BE, AudioFormat::F32be => ffi::GST_AUDIO_FORMAT_F32BE,
AudioFormat::F64le => ffi::GST_AUDIO_FORMAT_F64LE, AudioFormat::F64le => ffi::GST_AUDIO_FORMAT_F64LE,
AudioFormat::F64be => ffi::GST_AUDIO_FORMAT_F64BE, AudioFormat::F64be => ffi::GST_AUDIO_FORMAT_F64BE,
AudioFormat::__Unknown(value) => unsafe{std::mem::transmute(value)} AudioFormat::__Unknown(value) => value
} }
} }
} }
...@@ -238,7 +237,7 @@ impl ToGlib for AudioFormat { ...@@ -238,7 +237,7 @@ impl ToGlib for AudioFormat {
impl FromGlib<ffi::GstAudioFormat> for AudioFormat { impl FromGlib<ffi::GstAudioFormat> for AudioFormat {
fn from_glib(value: ffi::GstAudioFormat) -> Self { fn from_glib(value: ffi::GstAudioFormat) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value as i32 { match value {
0 => AudioFormat::Unknown, 0 => AudioFormat::Unknown,
1 => AudioFormat::Encoded, 1 => AudioFormat::Encoded,
2 => AudioFormat::S8, 2 => AudioFormat::S8,
...@@ -290,13 +289,13 @@ impl<'a> FromValueOptional<'a> for AudioFormat { ...@@ -290,13 +289,13 @@ impl<'a> FromValueOptional<'a> for AudioFormat {
impl<'a> FromValue<'a> for AudioFormat { impl<'a> FromValue<'a> for AudioFormat {
unsafe fn from_value(value: &Value) -> Self { unsafe fn from_value(value: &Value) -> Self {
from_glib(std::mem::transmute::<i32, ffi::GstAudioFormat>(gobject_ffi::g_value_get_enum(value.to_glib_none().0))) from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
} }
} }
impl SetValue for AudioFormat { impl SetValue for AudioFormat {
unsafe fn set_value(value: &mut Value, this: &Self) { unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32) gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
} }
} }
...@@ -316,7 +315,7 @@ impl ToGlib for AudioLayout { ...@@ -316,7 +315,7 @@ impl ToGlib for AudioLayout {
match *self { match *self {
AudioLayout::Interleaved => ffi::GST_AUDIO_LAYOUT_INTERLEAVED, AudioLayout::Interleaved => ffi::GST_AUDIO_LAYOUT_INTERLEAVED,
AudioLayout::NonInterleaved => ffi::GST_AUDIO_LAYOUT_NON_INTERLEAVED, AudioLayout::NonInterleaved => ffi::GST_AUDIO_LAYOUT_NON_INTERLEAVED,
AudioLayout::__Unknown(value) => unsafe{std::mem::transmute(value)} AudioLayout::__Unknown(value) => value
} }
} }
} }
...@@ -325,7 +324,7 @@ impl ToGlib for AudioLayout { ...@@ -325,7 +324,7 @@ impl ToGlib for AudioLayout {
impl FromGlib<ffi::GstAudioLayout> for AudioLayout { impl FromGlib<ffi::GstAudioLayout> for AudioLayout {
fn from_glib(value: ffi::GstAudioLayout) -> Self { fn from_glib(value: ffi::GstAudioLayout) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value as i32 { match value {
0 => AudioLayout::Interleaved, 0 => AudioLayout::Interleaved,
1 => AudioLayout::NonInterleaved, 1 => AudioLayout::NonInterleaved,
value => AudioLayout::__Unknown(value), value => AudioLayout::__Unknown(value),
...@@ -347,13 +346,13 @@ impl<'a> FromValueOptional<'a> for AudioLayout { ...@@ -347,13 +346,13 @@ impl<'a> FromValueOptional<'a> for AudioLayout {
impl<'a> FromValue<'a> for AudioLayout { impl<'a> FromValue<'a> for AudioLayout {
unsafe fn from_value(value: &Value) -> Self { unsafe fn from_value(value: &Value) -> Self {
from_glib(std::mem::transmute::<i32, ffi::GstAudioLayout>(gobject_ffi::g_value_get_enum(value.to_glib_none().0))) from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
} }
} }
impl SetValue for AudioLayout { impl SetValue for AudioLayout {
unsafe fn set_value(value: &mut Value, this: &Self) { unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32) gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
} }
} }
...@@ -375,7 +374,7 @@ impl ToGlib for StreamVolumeFormat { ...@@ -375,7 +374,7 @@ impl ToGlib for StreamVolumeFormat {
StreamVolumeFormat::Linear => ffi::GST_STREAM_VOLUME_FORMAT_LINEAR, StreamVolumeFormat::Linear => ffi::GST_STREAM_VOLUME_FORMAT_LINEAR,
StreamVolumeFormat::Cubic => ffi::GST_STREAM_VOLUME_FORMAT_CUBIC, StreamVolumeFormat::Cubic => ffi::GST_STREAM_VOLUME_FORMAT_CUBIC,
StreamVolumeFormat::Db => ffi::GST_STREAM_VOLUME_FORMAT_DB, StreamVolumeFormat::Db => ffi::GST_STREAM_VOLUME_FORMAT_DB,
StreamVolumeFormat::__Unknown(value) => unsafe{std::mem::transmute(value)} StreamVolumeFormat::__Unknown(value) => value
} }
} }
} }
...@@ -384,7 +383,7 @@ impl ToGlib for StreamVolumeFormat { ...@@ -384,7 +383,7 @@ impl ToGlib for StreamVolumeFormat {
impl FromGlib<ffi::GstStreamVolumeFormat> for StreamVolumeFormat { impl FromGlib<ffi::GstStreamVolumeFormat> for StreamVolumeFormat {
fn from_glib(value: ffi::GstStreamVolumeFormat) -> Self { fn from_glib(value: ffi::GstStreamVolumeFormat) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value as i32 { match value {
0 => StreamVolumeFormat::Linear, 0 => StreamVolumeFormat::Linear,
1 => StreamVolumeFormat::Cubic, 1 => StreamVolumeFormat::Cubic,
2 => StreamVolumeFormat::Db, 2 => StreamVolumeFormat::Db,
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod stream_volume; mod stream_volume;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use StreamVolumeFormat; use StreamVolumeFormat;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
use glib::translate::*; use glib::translate::*;
use std;
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod adapter; mod adapter;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use BaseSrc; use BaseSrc;
......
// This file was generated by gir (0fe730d) from gir-files (???) // This file was generated by gir (94e079d) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
...@@ -9,7 +9,6 @@ use glib::StaticType; ...@@ -9,7 +9,6 @@ use glib::StaticType;
use glib::value::{Value, SetValue, FromValue, FromValueOptional}; use glib::value::{Value, SetValue, FromValue, FromValueOptional};
use gobject_ffi; use gobject_ffi;
use glib::translate::*; use glib::translate::*;
use std;
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum PlayerColorBalanceType { pub enum PlayerColorBalanceType {
...@@ -31,7 +30,7 @@ impl ToGlib for PlayerColorBalanceType { ...@@ -31,7 +30,7 @@ impl ToGlib for PlayerColorBalanceType {
PlayerColorBalanceType::Brightness => ffi::GST_PLAYER_COLOR_BALANCE_BRIGHTNESS, PlayerColorBalanceType::Brightness => ffi::GST_PLAYER_COLOR_BALANCE_BRIGHTNESS,
PlayerColorBalanceType::Saturation => ffi::GST_PLAYER_COLOR_BALANCE_SATURATION, PlayerColorBalanceType::Saturation => ffi::GST_PLAYER_COLOR_BALANCE_SATURATION,
PlayerColorBalanceType::Contrast => ffi::GST_PLAYER_COLOR_BALANCE_CONTRAST, PlayerColorBalanceType::Contrast => ffi::GST_PLAYER_COLOR_BALANCE_CONTRAST,
PlayerColorBalanceType::__Unknown(value) => unsafe{std::mem::transmute(value)} PlayerColorBalanceType::__Unknown(value) => value
} }
} }
} }
...@@ -40,7 +39,7 @@ impl ToGlib for PlayerColorBalanceType { ...@@ -40,7 +39,7 @@ impl ToGlib for PlayerColorBalanceType {
impl FromGlib<ffi::GstPlayerColorBalanceType> for PlayerColorBalanceType { impl FromGlib<ffi::GstPlayerColorBalanceType> for PlayerColorBalanceType {
fn from_glib(value: ffi::GstPlayerColorBalanceType) -> Self { fn from_glib(value: ffi::GstPlayerColorBalanceType) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value as i32 { match value {
3 => PlayerColorBalanceType::Hue, 3 => PlayerColorBalanceType::Hue,
0 => PlayerColorBalanceType::Brightness, 0 => PlayerColorBalanceType::Brightness,
2 => PlayerColorBalanceType::Saturation, 2 => PlayerColorBalanceType::Saturation,
...@@ -64,13 +63,13 @@ impl<'a> FromValueOptional<'a> for PlayerColorBalanceType { ...@@ -64,13 +63,13 @@ impl<'a> FromValueOptional<'a> for PlayerColorBalanceType {
impl<'a> FromValue<'a> for PlayerColorBalanceType { impl<'a> FromValue<'a> for PlayerColorBalanceType {
unsafe fn from_value(value: &Value) -> Self { unsafe fn from_value(value: &Value) -> Self {
from_glib(std::mem::transmute::<i32, ffi::GstPlayerColorBalanceType>(gobject_ffi::g_value_get_enum(value.to_glib_none().0))) from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
} }
} }
impl SetValue for PlayerColorBalanceType { impl SetValue for PlayerColorBalanceType {
unsafe fn set_value(value: &mut Value, this: &Self) { unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32) gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
} }
} }
...@@ -88,7 +87,7 @@ impl ToGlib for PlayerError { ...@@ -88,7 +87,7 @@ impl ToGlib for PlayerError {
fn to_glib(&self) -> ffi::GstPlayerError { fn to_glib(&self) -> ffi::GstPlayerError {
match *self { match *self {
PlayerError::Failed => ffi::GST_PLAYER_ERROR_FAILED, PlayerError::Failed => ffi::GST_PLAYER_ERROR_FAILED,
PlayerError::__Unknown(value) => unsafe{std::mem::transmute(value)} PlayerError::__Unknown(value) => value
} }
} }
} }
...@@ -97,7 +96,7 @@ impl ToGlib for PlayerError { ...@@ -97,7 +96,7 @@ impl ToGlib for PlayerError {
impl FromGlib<ffi::GstPlayerError> for PlayerError { impl FromGlib<ffi::GstPlayerError> for PlayerError {
fn from_glib(value: ffi::GstPlayerError) -> Self { fn from_glib(value: ffi::GstPlayerError) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value as i32 { match value {
0 => PlayerError::Failed, 0 => PlayerError::Failed,
value => PlayerError::__Unknown(value), value => PlayerError::__Unknown(value),
} }
...@@ -111,7 +110,7 @@ impl ErrorDomain for PlayerError { ...@@ -111,7 +110,7 @@ impl ErrorDomain for PlayerError {
} }
fn code(self) -> i32 { fn code(self) -> i32 {
self.to_glib() as i32 self.to_glib()
} }
fn from(code: i32) -> Option<Self> { fn from(code: i32) -> Option<Self> {
...@@ -137,13 +136,13 @@ impl<'a> FromValueOptional<'a> for PlayerError { ...@@ -137,13 +136,13 @@ impl<'a> FromValueOptional<'a> for PlayerError {
impl<'a> FromValue<'a> for PlayerError { impl<'a> FromValue<'a> for PlayerError {
unsafe fn from_value(value: &Value) -> Self { unsafe fn from_value(value: &Value) -> Self {
from_glib(std::mem::transmute::<i32, ffi::GstPlayerError>(gobject_ffi::g_value_get_enum(value.to_glib_none().0))) from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
} }
} }
impl SetValue for PlayerError { impl SetValue for PlayerError {
unsafe fn set_value(value: &mut Value, this: &Self) { unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32) gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
} }
} }