Regenerate with latest gir and configure default concurrency to send+sync

This commit is contained in:
Sebastian Dröge 2017-06-25 11:04:37 +03:00
parent e41fb76d2d
commit b792f4b5da
16 changed files with 155 additions and 127 deletions

4
Cargo.lock generated
View file

@ -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)",

View file

@ -5,6 +5,7 @@ version = "1.0"
min_cfg_version = "1.0"
target_path = "gstreamer"
work_mode = "normal"
concurrency = "send+sync"
external_libraries = [
"GLib",

View file

@ -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;

View file

@ -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<P: IsA<Element>>(&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<F: Fn(&Self, &Bin, &Element) + 'static>(&self, f: F) -> u64;
fn connect_deep_element_added<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(&self, f: F) -> u64;
#[cfg(feature = "v1_10")]
fn connect_deep_element_removed<F: Fn(&Self, &Bin, &Element) + 'static>(&self, f: F) -> u64;
fn connect_deep_element_removed<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(&self, f: F) -> u64;
fn connect_do_latency<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> u64;
fn connect_do_latency<F: Fn(&Self) -> bool + Send + Sync + 'static>(&self, f: F) -> u64;
fn connect_element_added<F: Fn(&Self, &Element) + 'static>(&self, f: F) -> u64;
fn connect_element_added<F: Fn(&Self, &Element) + Send + Sync + 'static>(&self, f: F) -> u64;
fn connect_element_removed<F: Fn(&Self, &Element) + 'static>(&self, f: F) -> u64;
fn connect_element_removed<F: Fn(&Self, &Element) + Send + Sync + 'static>(&self, f: F) -> u64;
}
impl<O: IsA<Bin> + IsA<glib::object::Object>> BinExt for O {
@ -217,42 +220,42 @@ impl<O: IsA<Bin> + IsA<glib::object::Object>> BinExt for O {
}
#[cfg(feature = "v1_10")]
fn connect_deep_element_added<F: Fn(&Self, &Bin, &Element) + 'static>(&self, f: F) -> u64 {
fn connect_deep_element_added<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Bin, &Element) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self, &Bin, &Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "deep-element-added",
transmute(deep_element_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
#[cfg(feature = "v1_10")]
fn connect_deep_element_removed<F: Fn(&Self, &Bin, &Element) + 'static>(&self, f: F) -> u64 {
fn connect_deep_element_removed<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Bin, &Element) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self, &Bin, &Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "deep-element-removed",
transmute(deep_element_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_do_latency<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> u64 {
fn connect_do_latency<F: Fn(&Self) -> bool + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self) -> bool + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self) -> bool + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "do-latency",
transmute(do_latency_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_element_added<F: Fn(&Self, &Element) + 'static>(&self, f: F) -> u64 {
fn connect_element_added<F: Fn(&Self, &Element) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Element) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self, &Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "element-added",
transmute(element_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_element_removed<F: Fn(&Self, &Element) + 'static>(&self, f: F) -> u64 {
fn connect_element_removed<F: Fn(&Self, &Element) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Element) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self, &Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "element-removed",
transmute(element_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
@ -263,7 +266,7 @@ impl<O: IsA<Bin> + IsA<glib::object::Object>> BinExt for O {
unsafe extern "C" fn deep_element_added_trampoline<P>(this: *mut ffi::GstBin, sub_bin: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P, &Bin, &Element) + 'static> = transmute(f);
let f: &Box_<Fn(&P, &Bin, &Element) + Send + Sync + 'static> = 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<Bin> {
unsafe extern "C" fn deep_element_removed_trampoline<P>(this: *mut ffi::GstBin, sub_bin: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P, &Bin, &Element) + 'static> = transmute(f);
let f: &Box_<Fn(&P, &Bin, &Element) + Send + Sync + 'static> = 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<P>(this: *mut ffi::GstBin, f: glib_ffi::gpointer) -> glib_ffi::gboolean
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P) -> bool + 'static> = transmute(f);
let f: &Box_<Fn(&P) -> bool + Send + Sync + 'static> = transmute(f);
f(&Bin::from_glib_none(this).downcast_unchecked()).to_glib()
}
unsafe extern "C" fn element_added_trampoline<P>(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P, &Element) + 'static> = transmute(f);
let f: &Box_<Fn(&P, &Element) + Send + Sync + 'static> = transmute(f);
f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(element))
}
unsafe extern "C" fn element_removed_trampoline<P>(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P, &Element) + 'static> = transmute(f);
let f: &Box_<Fn(&P, &Element) + Send + Sync + 'static> = transmute(f);
f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(element))
}

View file

@ -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);

View file

@ -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<f64>;
@ -122,7 +125,7 @@ pub trait ClockExt {
fn set_property_window_threshold(&self, window_threshold: i32);
#[cfg(feature = "v1_6")]
fn connect_synced<F: Fn(&Self, bool) + 'static>(&self, f: F) -> u64;
fn connect_synced<F: Fn(&Self, bool) + Send + Sync + 'static>(&self, f: F) -> u64;
}
impl<O: IsA<Clock> + IsA<glib::object::Object>> ClockExt for O {
@ -306,9 +309,9 @@ impl<O: IsA<Clock> + IsA<glib::object::Object>> ClockExt for O {
}
#[cfg(feature = "v1_6")]
fn connect_synced<F: Fn(&Self, bool) + 'static>(&self, f: F) -> u64 {
fn connect_synced<F: Fn(&Self, bool) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, bool) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self, bool) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "synced",
transmute(synced_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
@ -319,6 +322,6 @@ impl<O: IsA<Clock> + IsA<glib::object::Object>> ClockExt for O {
unsafe extern "C" fn synced_trampoline<P>(this: *mut ffi::GstClock, synced: glib_ffi::gboolean, f: glib_ffi::gpointer)
where P: IsA<Clock> {
callback_guard!();
let f: &Box_<Fn(&P, bool) + 'static> = transmute(f);
let f: &Box_<Fn(&P, bool) + Send + Sync + 'static> = transmute(f);
f(&Clock::from_glib_none(this).downcast_unchecked(), from_glib(synced))
}

View file

@ -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<P: IsA<Element>>(&self, srcpadname: &str, dest: &P, destpadname: &str);
fn connect_no_more_pads<F: Fn(&Self) + 'static>(&self, f: F) -> u64;
fn connect_no_more_pads<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64;
fn connect_pad_added<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64;
fn connect_pad_added<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64;
fn connect_pad_removed<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64;
fn connect_pad_removed<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64;
}
impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
@ -540,25 +543,25 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
}
}
fn connect_no_more_pads<F: Fn(&Self) + 'static>(&self, f: F) -> u64 {
fn connect_no_more_pads<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "no-more-pads",
transmute(no_more_pads_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_pad_added<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64 {
fn connect_pad_added<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pad-added",
transmute(pad_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_pad_removed<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64 {
fn connect_pad_removed<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pad-removed",
transmute(pad_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
@ -568,20 +571,20 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
unsafe extern "C" fn no_more_pads_trampoline<P>(this: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Element> {
callback_guard!();
let f: &Box_<Fn(&P) + 'static> = transmute(f);
let f: &Box_<Fn(&P) + Send + Sync + 'static> = transmute(f);
f(&Element::from_glib_none(this).downcast_unchecked())
}
unsafe extern "C" fn pad_added_trampoline<P>(this: *mut ffi::GstElement, new_pad: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Element> {
callback_guard!();
let f: &Box_<Fn(&P, &Pad) + 'static> = transmute(f);
let f: &Box_<Fn(&P, &Pad) + Send + Sync + 'static> = transmute(f);
f(&Element::from_glib_none(this).downcast_unchecked(), &from_glib_none(new_pad))
}
unsafe extern "C" fn pad_removed_trampoline<P>(this: *mut ffi::GstElement, old_pad: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Element> {
callback_guard!();
let f: &Box_<Fn(&P, &Pad) + 'static> = transmute(f);
let f: &Box_<Fn(&P, &Pad) + Send + Sync + 'static> = transmute(f);
f(&Element::from_glib_none(this).downcast_unchecked(), &from_glib_none(old_pad))
}

View file

@ -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;

View file

@ -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<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,
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<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,
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<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,
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<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,
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<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,
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<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,
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<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,
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<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,
match value as i32 {
0 => URIType::Unknown,
1 => URIType::Sink,
2 => URIType::Src,
value => URIType::__Unknown(value),
}
}
}

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64;
fn connect_linked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64;
fn connect_unlinked<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64;
fn connect_unlinked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64;
}
impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
@ -670,17 +673,17 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
}
}
fn connect_linked<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64 {
fn connect_linked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "linked",
transmute(linked_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_unlinked<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64 {
fn connect_unlinked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + 'static>> = Box_::new(Box_::new(f));
let f: Box_<Box_<Fn(&Self, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "unlinked",
transmute(unlinked_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
@ -690,13 +693,13 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
unsafe extern "C" fn linked_trampoline<P>(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Pad> {
callback_guard!();
let f: &Box_<Fn(&P, &Pad) + 'static> = transmute(f);
let f: &Box_<Fn(&P, &Pad) + Send + Sync + 'static> = transmute(f);
f(&Pad::from_glib_none(this).downcast_unchecked(), &from_glib_none(peer))
}
unsafe extern "C" fn unlinked_trampoline<P>(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Pad> {
callback_guard!();
let f: &Box_<Fn(&P, &Pad) + 'static> = transmute(f);
let f: &Box_<Fn(&P, &Pad) + Send + Sync + 'static> = transmute(f);
f(&Pad::from_glib_none(this).downcast_unchecked(), &from_glib_none(peer))
}

View file

@ -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;

View file

@ -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;

View file

@ -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;