From b792f4b5da7b3bb7d1e215afca3462bfe69db4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 25 Jun 2017 11:04:37 +0300 Subject: [PATCH] Regenerate with latest gir and configure default concurrency to send+sync --- Cargo.lock | 4 +- Gir_Gst.toml | 1 + gstreamer/src/auto/alias.rs | 2 +- gstreamer/src/auto/bin.rs | 45 ++++---- gstreamer/src/auto/bus.rs | 5 +- gstreamer/src/auto/clock.rs | 13 ++- gstreamer/src/auto/element.rs | 29 +++--- gstreamer/src/auto/element_factory.rs | 2 +- gstreamer/src/auto/enums.rs | 145 ++++++++++++++------------ gstreamer/src/auto/flags.rs | 2 +- gstreamer/src/auto/mod.rs | 2 +- gstreamer/src/auto/object.rs | 5 +- gstreamer/src/auto/pad.rs | 21 ++-- gstreamer/src/auto/pad_template.rs | 2 +- gstreamer/src/auto/pipeline.rs | 2 +- gstreamer/src/auto/u_r_i_handler.rs | 2 +- 16 files changed, 155 insertions(+), 127 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a0dd1bddf..55a4b7918 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "glib" version = "0.1.3" -source = "git+https://github.com/gtk-rs/glib#46658ce0f51fa8f46468720cb3f2d03cef4e4b93" +source = "git+https://github.com/gtk-rs/glib#d3aed89e92d6162f385b699ccd546ee799612c93" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", @@ -51,7 +51,7 @@ dependencies = [ [[package]] name = "gstreamer-sys" version = "0.1.1" -source = "git+https://github.com/sdroege/gstreamer-sys#01d79cc53ccdb1b06b09656fde04f3868c9dc246" +source = "git+https://github.com/sdroege/gstreamer-sys#0d5b1c60a6d74150a55de4b5f980e09dd67014f2" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", diff --git a/Gir_Gst.toml b/Gir_Gst.toml index f063a5a04..f1dbf7acb 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -5,6 +5,7 @@ version = "1.0" min_cfg_version = "1.0" target_path = "gstreamer" work_mode = "normal" +concurrency = "send+sync" external_libraries = [ "GLib", diff --git a/gstreamer/src/auto/alias.rs b/gstreamer/src/auto/alias.rs index 462b5b170..ccfa7d068 100644 --- a/gstreamer/src/auto/alias.rs +++ b/gstreamer/src/auto/alias.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT pub type ClockTime = u64; diff --git a/gstreamer/src/auto/bin.rs b/gstreamer/src/auto/bin.rs index c71428167..0ed783646 100644 --- a/gstreamer/src/auto/bin.rs +++ b/gstreamer/src/auto/bin.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use Element; @@ -35,6 +35,9 @@ impl Bin { } } +unsafe impl Send for Bin {} +unsafe impl Sync for Bin {} + pub trait BinExt { fn add>(&self, element: &P) -> Result<(), glib::error::BoolError>; @@ -84,16 +87,16 @@ pub trait BinExt { fn set_property_message_forward(&self, message_forward: bool); #[cfg(feature = "v1_10")] - fn connect_deep_element_added(&self, f: F) -> u64; + fn connect_deep_element_added(&self, f: F) -> u64; #[cfg(feature = "v1_10")] - fn connect_deep_element_removed(&self, f: F) -> u64; + fn connect_deep_element_removed(&self, f: F) -> u64; - fn connect_do_latency bool + 'static>(&self, f: F) -> u64; + fn connect_do_latency bool + Send + Sync + 'static>(&self, f: F) -> u64; - fn connect_element_added(&self, f: F) -> u64; + fn connect_element_added(&self, f: F) -> u64; - fn connect_element_removed(&self, f: F) -> u64; + fn connect_element_removed(&self, f: F) -> u64; } impl + IsA> BinExt for O { @@ -217,42 +220,42 @@ impl + IsA> BinExt for O { } #[cfg(feature = "v1_10")] - fn connect_deep_element_added(&self, f: F) -> u64 { + fn connect_deep_element_added(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "deep-element-added", transmute(deep_element_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) } } #[cfg(feature = "v1_10")] - fn connect_deep_element_removed(&self, f: F) -> u64 { + fn connect_deep_element_removed(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "deep-element-removed", transmute(deep_element_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) } } - fn connect_do_latency bool + 'static>(&self, f: F) -> u64 { + fn connect_do_latency bool + Send + Sync + 'static>(&self, f: F) -> u64 { unsafe { - let f: Box_ bool + 'static>> = Box_::new(Box_::new(f)); + let f: Box_ bool + Send + Sync + 'static>> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "do-latency", transmute(do_latency_trampoline:: as usize), Box_::into_raw(f) as *mut _) } } - fn connect_element_added(&self, f: F) -> u64 { + fn connect_element_added(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "element-added", transmute(element_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) } } - fn connect_element_removed(&self, f: F) -> u64 { + fn connect_element_removed(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "element-removed", transmute(element_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) } @@ -263,7 +266,7 @@ impl + IsA> BinExt for O { unsafe extern "C" fn deep_element_added_trampoline

(this: *mut ffi::GstBin, sub_bin: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(sub_bin), &from_glib_none(element)) } @@ -271,27 +274,27 @@ where P: IsA { unsafe extern "C" fn deep_element_removed_trampoline

(this: *mut ffi::GstBin, sub_bin: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(sub_bin), &from_glib_none(element)) } unsafe extern "C" fn do_latency_trampoline

(this: *mut ffi::GstBin, f: glib_ffi::gpointer) -> glib_ffi::gboolean where P: IsA { callback_guard!(); - let f: &Box_ bool + 'static> = transmute(f); + let f: &Box_ bool + Send + Sync + 'static> = transmute(f); f(&Bin::from_glib_none(this).downcast_unchecked()).to_glib() } unsafe extern "C" fn element_added_trampoline

(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(element)) } unsafe extern "C" fn element_removed_trampoline

(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(element)) } diff --git a/gstreamer/src/auto/bus.rs b/gstreamer/src/auto/bus.rs index 1d01ecd93..89414ace3 100644 --- a/gstreamer/src/auto/bus.rs +++ b/gstreamer/src/auto/bus.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use Object; @@ -22,6 +22,9 @@ impl Bus { } } +unsafe impl Send for Bus {} +unsafe impl Sync for Bus {} + pub trait BusExt { fn add_signal_watch(&self); diff --git a/gstreamer/src/auto/clock.rs b/gstreamer/src/auto/clock.rs index c8b249a54..87e17ca48 100644 --- a/gstreamer/src/auto/clock.rs +++ b/gstreamer/src/auto/clock.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use ClockTime; @@ -60,6 +60,9 @@ impl Clock { //} } +unsafe impl Send for Clock {} +unsafe impl Sync for Clock {} + pub trait ClockExt { fn add_observation(&self, slave: ClockTime, master: ClockTime) -> Option; @@ -122,7 +125,7 @@ pub trait ClockExt { fn set_property_window_threshold(&self, window_threshold: i32); #[cfg(feature = "v1_6")] - fn connect_synced(&self, f: F) -> u64; + fn connect_synced(&self, f: F) -> u64; } impl + IsA> ClockExt for O { @@ -306,9 +309,9 @@ impl + IsA> ClockExt for O { } #[cfg(feature = "v1_6")] - fn connect_synced(&self, f: F) -> u64 { + fn connect_synced(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "synced", transmute(synced_trampoline:: as usize), Box_::into_raw(f) as *mut _) } @@ -319,6 +322,6 @@ impl + IsA> ClockExt for O { unsafe extern "C" fn synced_trampoline

(this: *mut ffi::GstClock, synced: glib_ffi::gboolean, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Clock::from_glib_none(this).downcast_unchecked(), from_glib(synced)) } diff --git a/gstreamer/src/auto/element.rs b/gstreamer/src/auto/element.rs index abec71330..5af9387be 100644 --- a/gstreamer/src/auto/element.rs +++ b/gstreamer/src/auto/element.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use Bus; @@ -66,6 +66,9 @@ impl Element { } } +unsafe impl Send for Element {} +unsafe impl Sync for Element {} + pub trait ElementExt { fn abort_state(&self); @@ -193,11 +196,11 @@ pub trait ElementExt { fn unlink_pads>(&self, srcpadname: &str, dest: &P, destpadname: &str); - fn connect_no_more_pads(&self, f: F) -> u64; + fn connect_no_more_pads(&self, f: F) -> u64; - fn connect_pad_added(&self, f: F) -> u64; + fn connect_pad_added(&self, f: F) -> u64; - fn connect_pad_removed(&self, f: F) -> u64; + fn connect_pad_removed(&self, f: F) -> u64; } impl + IsA> ElementExt for O { @@ -540,25 +543,25 @@ impl + IsA> ElementExt for O { } } - fn connect_no_more_pads(&self, f: F) -> u64 { + fn connect_no_more_pads(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "no-more-pads", transmute(no_more_pads_trampoline:: as usize), Box_::into_raw(f) as *mut _) } } - fn connect_pad_added(&self, f: F) -> u64 { + fn connect_pad_added(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "pad-added", transmute(pad_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) } } - fn connect_pad_removed(&self, f: F) -> u64 { + fn connect_pad_removed(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "pad-removed", transmute(pad_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) } @@ -568,20 +571,20 @@ impl + IsA> ElementExt for O { unsafe extern "C" fn no_more_pads_trampoline

(this: *mut ffi::GstElement, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Element::from_glib_none(this).downcast_unchecked()) } unsafe extern "C" fn pad_added_trampoline

(this: *mut ffi::GstElement, new_pad: *mut ffi::GstPad, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Element::from_glib_none(this).downcast_unchecked(), &from_glib_none(new_pad)) } unsafe extern "C" fn pad_removed_trampoline

(this: *mut ffi::GstElement, old_pad: *mut ffi::GstPad, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Element::from_glib_none(this).downcast_unchecked(), &from_glib_none(old_pad)) } diff --git a/gstreamer/src/auto/element_factory.rs b/gstreamer/src/auto/element_factory.rs index 1d8cb72ac..c40c907df 100644 --- a/gstreamer/src/auto/element_factory.rs +++ b/gstreamer/src/auto/element_factory.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use Element; diff --git a/gstreamer/src/auto/enums.rs b/gstreamer/src/auto/enums.rs index a22f30695..f964c2249 100644 --- a/gstreamer/src/auto/enums.rs +++ b/gstreamer/src/auto/enums.rs @@ -1,8 +1,9 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use ffi; use glib::translate::*; +use std; #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum FlowReturn { @@ -20,7 +21,7 @@ pub enum FlowReturn { CustomError1, CustomError2, #[doc(hidden)] - __Nonexhaustive(()), + __Unknown(i32), } #[doc(hidden)] @@ -42,7 +43,7 @@ impl ToGlib for FlowReturn { 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!(), + FlowReturn::__Unknown(value) => unsafe{std::mem::transmute(value)} } } } @@ -50,20 +51,21 @@ impl ToGlib for FlowReturn { #[doc(hidden)] impl FromGlib 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, + 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), } } } @@ -77,7 +79,7 @@ pub enum Format { Buffers, Percent, #[doc(hidden)] - __Nonexhaustive(()), + __Unknown(i32), } #[doc(hidden)] @@ -92,7 +94,7 @@ impl ToGlib for Format { Format::Time => ffi::GST_FORMAT_TIME, Format::Buffers => ffi::GST_FORMAT_BUFFERS, Format::Percent => ffi::GST_FORMAT_PERCENT, - Format::__Nonexhaustive(_) => panic!(), + Format::__Unknown(value) => unsafe{std::mem::transmute(value)} } } } @@ -100,13 +102,14 @@ impl ToGlib for Format { #[doc(hidden)] impl FromGlib 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, + 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), } } } @@ -117,7 +120,7 @@ pub enum PadDirection { Src, Sink, #[doc(hidden)] - __Nonexhaustive(()), + __Unknown(i32), } #[doc(hidden)] @@ -129,7 +132,7 @@ impl ToGlib for PadDirection { PadDirection::Unknown => ffi::GST_PAD_UNKNOWN, PadDirection::Src => ffi::GST_PAD_SRC, PadDirection::Sink => ffi::GST_PAD_SINK, - PadDirection::__Nonexhaustive(_) => panic!(), + PadDirection::__Unknown(value) => unsafe{std::mem::transmute(value)} } } } @@ -137,10 +140,11 @@ impl ToGlib for PadDirection { #[doc(hidden)] impl FromGlib 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, + match value as i32 { + 0 => PadDirection::Unknown, + 1 => PadDirection::Src, + 2 => PadDirection::Sink, + value => PadDirection::__Unknown(value), } } } @@ -151,7 +155,7 @@ pub enum SeekType { Set, End, #[doc(hidden)] - __Nonexhaustive(()), + __Unknown(i32), } #[doc(hidden)] @@ -163,7 +167,7 @@ impl ToGlib for SeekType { SeekType::None => ffi::GST_SEEK_TYPE_NONE, SeekType::Set => ffi::GST_SEEK_TYPE_SET, SeekType::End => ffi::GST_SEEK_TYPE_END, - SeekType::__Nonexhaustive(_) => panic!(), + SeekType::__Unknown(value) => unsafe{std::mem::transmute(value)} } } } @@ -171,10 +175,11 @@ impl ToGlib for SeekType { #[doc(hidden)] impl FromGlib 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, + match value as i32 { + 0 => SeekType::None, + 1 => SeekType::Set, + 2 => SeekType::End, + value => SeekType::__Unknown(value), } } } @@ -187,7 +192,7 @@ pub enum State { Paused, Playing, #[doc(hidden)] - __Nonexhaustive(()), + __Unknown(i32), } #[doc(hidden)] @@ -201,7 +206,7 @@ impl ToGlib for State { State::Ready => ffi::GST_STATE_READY, State::Paused => ffi::GST_STATE_PAUSED, State::Playing => ffi::GST_STATE_PLAYING, - State::__Nonexhaustive(_) => panic!(), + State::__Unknown(value) => unsafe{std::mem::transmute(value)} } } } @@ -209,12 +214,13 @@ impl ToGlib for State { #[doc(hidden)] impl FromGlib 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, + match value as i32 { + 0 => State::VoidPending, + 1 => State::Null, + 2 => State::Ready, + 3 => State::Paused, + 4 => State::Playing, + value => State::__Unknown(value), } } } @@ -228,7 +234,7 @@ pub enum StateChange { PausedToReady, ReadyToNull, #[doc(hidden)] - __Nonexhaustive(()), + __Unknown(i32), } #[doc(hidden)] @@ -243,7 +249,7 @@ impl ToGlib for StateChange { 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!(), + StateChange::__Unknown(value) => unsafe{std::mem::transmute(value)} } } } @@ -251,13 +257,14 @@ impl ToGlib for StateChange { #[doc(hidden)] impl FromGlib 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, + 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), } } } @@ -269,7 +276,7 @@ pub enum StateChangeReturn { Async, NoPreroll, #[doc(hidden)] - __Nonexhaustive(()), + __Unknown(i32), } #[doc(hidden)] @@ -282,7 +289,7 @@ impl ToGlib for StateChangeReturn { 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!(), + StateChangeReturn::__Unknown(value) => unsafe{std::mem::transmute(value)} } } } @@ -290,11 +297,12 @@ impl ToGlib for StateChangeReturn { #[doc(hidden)] impl FromGlib 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, + match value as i32 { + 0 => StateChangeReturn::Failure, + 1 => StateChangeReturn::Success, + 2 => StateChangeReturn::Async, + 3 => StateChangeReturn::NoPreroll, + value => StateChangeReturn::__Unknown(value), } } } @@ -305,7 +313,7 @@ pub enum URIType { Sink, Src, #[doc(hidden)] - __Nonexhaustive(()), + __Unknown(i32), } #[doc(hidden)] @@ -317,7 +325,7 @@ impl ToGlib for URIType { URIType::Unknown => ffi::GST_URI_UNKNOWN, URIType::Sink => ffi::GST_URI_SINK, URIType::Src => ffi::GST_URI_SRC, - URIType::__Nonexhaustive(_) => panic!(), + URIType::__Unknown(value) => unsafe{std::mem::transmute(value)} } } } @@ -325,10 +333,11 @@ impl ToGlib for URIType { #[doc(hidden)] impl FromGlib 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, + match value as i32 { + 0 => URIType::Unknown, + 1 => URIType::Sink, + 2 => URIType::Src, + value => URIType::__Unknown(value), } } } diff --git a/gstreamer/src/auto/flags.rs b/gstreamer/src/auto/flags.rs index b6ccd668f..93ba373a1 100644 --- a/gstreamer/src/auto/flags.rs +++ b/gstreamer/src/auto/flags.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use ffi; diff --git a/gstreamer/src/auto/mod.rs b/gstreamer/src/auto/mod.rs index 1a0feb2cd..55252c28b 100644 --- a/gstreamer/src/auto/mod.rs +++ b/gstreamer/src/auto/mod.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT mod bin; diff --git a/gstreamer/src/auto/object.rs b/gstreamer/src/auto/object.rs index 743cf9582..07b1300fd 100644 --- a/gstreamer/src/auto/object.rs +++ b/gstreamer/src/auto/object.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use ClockTime; @@ -36,6 +36,9 @@ impl Object { //} } +unsafe impl Send for Object {} +unsafe impl Sync for Object {} + pub trait ObjectExt { //fn add_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool; diff --git a/gstreamer/src/auto/pad.rs b/gstreamer/src/auto/pad.rs index e2c9e8b91..f898a5a0e 100644 --- a/gstreamer/src/auto/pad.rs +++ b/gstreamer/src/auto/pad.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use Element; @@ -57,6 +57,9 @@ impl Pad { //} } +unsafe impl Send for Pad {} +unsafe impl Sync for Pad {} + pub trait PadExt { //fn activate_mode(&self, mode: /*Ignored*/PadMode, active: bool) -> bool; @@ -234,9 +237,9 @@ pub trait PadExt { fn set_property_template(&self, template: Option<&PadTemplate>); - fn connect_linked(&self, f: F) -> u64; + fn connect_linked(&self, f: F) -> u64; - fn connect_unlinked(&self, f: F) -> u64; + fn connect_unlinked(&self, f: F) -> u64; } impl + IsA> PadExt for O { @@ -670,17 +673,17 @@ impl + IsA> PadExt for O { } } - fn connect_linked(&self, f: F) -> u64 { + fn connect_linked(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "linked", transmute(linked_trampoline:: as usize), Box_::into_raw(f) as *mut _) } } - fn connect_unlinked(&self, f: F) -> u64 { + fn connect_unlinked(&self, f: F) -> u64 { unsafe { - let f: Box_> = Box_::new(Box_::new(f)); + let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "unlinked", transmute(unlinked_trampoline:: as usize), Box_::into_raw(f) as *mut _) } @@ -690,13 +693,13 @@ impl + IsA> PadExt for O { unsafe extern "C" fn linked_trampoline

(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Pad::from_glib_none(this).downcast_unchecked(), &from_glib_none(peer)) } unsafe extern "C" fn unlinked_trampoline

(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); - let f: &Box_ = transmute(f); + let f: &Box_ = transmute(f); f(&Pad::from_glib_none(this).downcast_unchecked(), &from_glib_none(peer)) } diff --git a/gstreamer/src/auto/pad_template.rs b/gstreamer/src/auto/pad_template.rs index c1fc1c24b..f287a459f 100644 --- a/gstreamer/src/auto/pad_template.rs +++ b/gstreamer/src/auto/pad_template.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use Object; diff --git a/gstreamer/src/auto/pipeline.rs b/gstreamer/src/auto/pipeline.rs index 56c588f22..829e1fa79 100644 --- a/gstreamer/src/auto/pipeline.rs +++ b/gstreamer/src/auto/pipeline.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use Bin; diff --git a/gstreamer/src/auto/u_r_i_handler.rs b/gstreamer/src/auto/u_r_i_handler.rs index 2ac1471b8..45ec6699f 100644 --- a/gstreamer/src/auto/u_r_i_handler.rs +++ b/gstreamer/src/auto/u_r_i_handler.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (b155303) from gir-files (???) +// This file was generated by gir (531f8d9) from gir-files (???) // DO NOT EDIT use Error;