Regenerate with latest gir

This commit is contained in:
Sebastian Dröge 2019-01-29 15:53:44 +02:00
parent 16adb8e8b8
commit 00cbd49923
85 changed files with 1386 additions and 1371 deletions

View file

@ -116,6 +116,11 @@ trait_name = "GstBinExt"
name = "Gst.Bus" name = "Gst.Bus"
status = "generate" status = "generate"
final_type = true final_type = true
[[object.function]]
name = "set_sync_handler"
# Into<Option<_>> makes this hard to use
ignore = true
[[object.function]] [[object.function]]
name = "add_signal_watch_full" name = "add_signal_watch_full"
# Priority # Priority
@ -139,6 +144,16 @@ final_type = true
# More convenient manual implementation # More convenient manual implementation
ignore = true ignore = true
[[object.function]]
name = "add_watch"
# More specific trait bounds possible for the closure
ignore = true
[[object.function]]
name = "add_watch_full"
# More specific trait bounds possible for the closure
ignore = true
[[object.function]] [[object.function]]
name = "remove_watch" name = "remove_watch"
[object.function.return] [object.function.return]
@ -337,6 +352,11 @@ status = "generate"
# It is already a Result # It is already a Result
nullable = false nullable = false
[[object.function]]
name = "call_async"
# more specific closure type possible
ignore = true
[[object.function]] [[object.function]]
name = "add_pad" name = "add_pad"
[object.function.return] [object.function.return]
@ -796,6 +816,26 @@ status = "generate"
# Wrong place # Wrong place
ignore = true ignore = true
[[object.function]]
pattern = "set_.*_function_full"
# More specific closure trait bounds possible
ignore = true
[[object.function]]
name = "start_task"
# More specific closure trait bounds possible
ignore = true
[[object.function]]
name = "sticky_events_foreach"
# Complex closure argument handling
ignore = true
[[object.function]]
name = "add_probe"
# Complex closure argument handling
ignore = true
[[object]] [[object]]
name = "Gst.PadTemplate" name = "Gst.PadTemplate"
status = "generate" status = "generate"
@ -883,6 +923,11 @@ name = "Gst.Plugin"
status = "generate" status = "generate"
final_type = true final_type = true
[[object.function]]
pattern = "register_static.*"
# Needs manual implementation
ignore = true
[[object.function]] [[object.function]]
name = "list_free" name = "list_free"
# useless and unsafe # useless and unsafe

View file

@ -87,7 +87,7 @@ impl AppSink {
} }
} }
//pub fn set_callbacks(&self, callbacks: /*Ignored*/&mut AppSinkCallbacks, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) { //pub fn set_callbacks(&self, callbacks: /*Ignored*/&mut AppSinkCallbacks, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call ffi::gst_app_sink_set_callbacks() } // unsafe { TODO: call ffi::gst_app_sink_set_callbacks() }
//} //}
@ -160,65 +160,65 @@ impl AppSink {
pub fn connect_eos<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_eos<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"eos\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"eos\0".as_ptr() as *const _,
transmute(eos_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(eos_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_buffer_list_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_buffer_list_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::buffer-list\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::buffer-list\0".as_ptr() as *const _,
transmute(notify_buffer_list_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_buffer_list_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_caps_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_caps_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _,
transmute(notify_caps_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_caps_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_drop_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_drop_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::drop\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::drop\0".as_ptr() as *const _,
transmute(notify_drop_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_drop_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_emit_signals_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_emit_signals_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::emit-signals\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::emit-signals\0".as_ptr() as *const _,
transmute(notify_emit_signals_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_emit_signals_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::eos\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::eos\0".as_ptr() as *const _,
transmute(notify_eos_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_eos_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_max_buffers_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_max_buffers_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-buffers\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::max-buffers\0".as_ptr() as *const _,
transmute(notify_max_buffers_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_max_buffers_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_wait_on_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_wait_on_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::wait-on-eos\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::wait-on-eos\0".as_ptr() as *const _,
transmute(notify_wait_on_eos_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_wait_on_eos_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -226,42 +226,42 @@ impl AppSink {
unsafe impl Send for AppSink {} unsafe impl Send for AppSink {}
unsafe impl Sync for AppSink {} unsafe impl Sync for AppSink {}
unsafe extern "C" fn eos_trampoline(this: *mut ffi::GstAppSink, f: glib_ffi::gpointer) { unsafe extern "C" fn eos_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut ffi::GstAppSink, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSink) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_buffer_list_trampoline(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_buffer_list_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSink) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_caps_trampoline(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_caps_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSink) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_drop_trampoline(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_drop_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSink) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_emit_signals_trampoline(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_emit_signals_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSink) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_eos_trampoline(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_eos_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSink) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_max_buffers_trampoline(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_max_buffers_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSink) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_wait_on_eos_trampoline(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_wait_on_eos_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut ffi::GstAppSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSink) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -70,7 +70,7 @@ impl AppSrc {
} }
} }
//pub fn set_callbacks(&self, callbacks: /*Ignored*/&mut AppSrcCallbacks, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) { //pub fn set_callbacks(&self, callbacks: /*Ignored*/&mut AppSrcCallbacks, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call ffi::gst_app_src_set_callbacks() } // unsafe { TODO: call ffi::gst_app_src_set_callbacks() }
//} //}
@ -212,129 +212,129 @@ impl AppSrc {
pub fn connect_enough_data<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_enough_data<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"enough-data\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"enough-data\0".as_ptr() as *const _,
transmute(enough_data_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(enough_data_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_need_data<F: Fn(&AppSrc, u32) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_need_data<F: Fn(&AppSrc, u32) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc, u32) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"need-data\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"need-data\0".as_ptr() as *const _,
transmute(need_data_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(need_data_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_seek_data<F: Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_seek_data<F: Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"seek-data\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"seek-data\0".as_ptr() as *const _,
transmute(seek_data_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(seek_data_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_block_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_block_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::block\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::block\0".as_ptr() as *const _,
transmute(notify_block_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_block_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_caps_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_caps_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _,
transmute(notify_caps_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_caps_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_current_level_bytes_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_current_level_bytes_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::current-level-bytes\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::current-level-bytes\0".as_ptr() as *const _,
transmute(notify_current_level_bytes_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_current_level_bytes_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_duration_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_duration_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
transmute(notify_duration_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_duration_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_emit_signals_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_emit_signals_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::emit-signals\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::emit-signals\0".as_ptr() as *const _,
transmute(notify_emit_signals_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_emit_signals_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_format_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_format_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::format\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::format\0".as_ptr() as *const _,
transmute(notify_format_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_format_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_is_live_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_is_live_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::is-live\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::is-live\0".as_ptr() as *const _,
transmute(notify_is_live_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_is_live_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_max_bytes_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_max_bytes_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-bytes\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::max-bytes\0".as_ptr() as *const _,
transmute(notify_max_bytes_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_max_bytes_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_max_latency_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_max_latency_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-latency\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::max-latency\0".as_ptr() as *const _,
transmute(notify_max_latency_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_max_latency_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_min_latency_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_min_latency_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::min-latency\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::min-latency\0".as_ptr() as *const _,
transmute(notify_min_latency_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_min_latency_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_min_percent_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_min_percent_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::min-percent\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::min-percent\0".as_ptr() as *const _,
transmute(notify_min_percent_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_min_percent_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_size_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_size_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::size\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::size\0".as_ptr() as *const _,
transmute(notify_size_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_size_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_stream_type_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_stream_type_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&AppSrc) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::stream-type\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::stream-type\0".as_ptr() as *const _,
transmute(notify_stream_type_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_stream_type_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -342,82 +342,82 @@ impl AppSrc {
unsafe impl Send for AppSrc {} unsafe impl Send for AppSrc {}
unsafe impl Sync for AppSrc {} unsafe impl Sync for AppSrc {}
unsafe extern "C" fn enough_data_trampoline(this: *mut ffi::GstAppSrc, f: glib_ffi::gpointer) { unsafe extern "C" fn enough_data_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn need_data_trampoline(this: *mut ffi::GstAppSrc, length: libc::c_uint, f: glib_ffi::gpointer) { unsafe extern "C" fn need_data_trampoline<F: Fn(&AppSrc, u32) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, length: libc::c_uint, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc, u32) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), length) f(&from_glib_borrow(this), length)
} }
unsafe extern "C" fn seek_data_trampoline(this: *mut ffi::GstAppSrc, offset: u64, f: glib_ffi::gpointer) -> glib_ffi::gboolean { unsafe extern "C" fn seek_data_trampoline<F: Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, offset: u64, f: glib_ffi::gpointer) -> glib_ffi::gboolean {
let f: &&(Fn(&AppSrc, u64) -> bool + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), offset).to_glib() f(&from_glib_borrow(this), offset).to_glib()
} }
unsafe extern "C" fn notify_block_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_block_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_caps_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_caps_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_current_level_bytes_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_current_level_bytes_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_duration_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_duration_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_emit_signals_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_emit_signals_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_format_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_format_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_is_live_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_is_live_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_max_bytes_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_max_bytes_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_max_latency_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_max_latency_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_min_latency_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_min_latency_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_min_percent_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_min_percent_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_size_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_size_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_stream_type_trampoline(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_stream_type_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut ffi::GstAppSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSrc) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -76,29 +76,29 @@ impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
fn connect_property_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _,
transmute(notify_mute_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_mute_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::volume\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::volume\0".as_ptr() as *const _,
transmute(notify_volume_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_volume_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_mute_trampoline<P>(this: *mut ffi::GstStreamVolume, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_mute_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstStreamVolume, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<StreamVolume> { where P: IsA<StreamVolume> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&StreamVolume::from_glib_borrow(this).unsafe_cast()) f(&StreamVolume::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_volume_trampoline<P>(this: *mut ffi::GstStreamVolume, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_volume_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstStreamVolume, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<StreamVolume> { where P: IsA<StreamVolume> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&StreamVolume::from_glib_borrow(this).unsafe_cast()) f(&StreamVolume::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -106,30 +106,30 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
#[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg(any(feature = "v1_14", feature = "dox"))]
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _,
transmute(notify_latency_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_latency_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_start_time_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_start_time_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::start-time\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::start-time\0".as_ptr() as *const _,
transmute(notify_start_time_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_start_time_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
#[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg(any(feature = "v1_14", feature = "dox"))]
unsafe extern "C" fn notify_latency_trampoline<P>(this: *mut ffi::GstAggregator, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstAggregator, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Aggregator> { where P: IsA<Aggregator> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Aggregator::from_glib_borrow(this).unsafe_cast()) f(&Aggregator::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_start_time_trampoline<P>(this: *mut ffi::GstAggregator, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_start_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstAggregator, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Aggregator> { where P: IsA<Aggregator> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Aggregator::from_glib_borrow(this).unsafe_cast()) f(&Aggregator::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -336,155 +336,155 @@ impl<O: IsA<BaseSink>> BaseSinkExt for O {
fn connect_property_async_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_async_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::async\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::async\0".as_ptr() as *const _,
transmute(notify_async_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_async_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::blocksize\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::blocksize\0".as_ptr() as *const _,
transmute(notify_blocksize_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_blocksize_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::enable-last-sample\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::enable-last-sample\0".as_ptr() as *const _,
transmute(notify_enable_last_sample_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_enable_last_sample_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::last-sample\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::last-sample\0".as_ptr() as *const _,
transmute(notify_last_sample_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_last_sample_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-bitrate\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::max-bitrate\0".as_ptr() as *const _,
transmute(notify_max_bitrate_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_max_bitrate_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-lateness\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::max-lateness\0".as_ptr() as *const _,
transmute(notify_max_lateness_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_max_lateness_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::qos\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::qos\0".as_ptr() as *const _,
transmute(notify_qos_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_qos_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::render-delay\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::render-delay\0".as_ptr() as *const _,
transmute(notify_render_delay_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_render_delay_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::sync\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::sync\0".as_ptr() as *const _,
transmute(notify_sync_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_sync_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::throttle-time\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::throttle-time\0".as_ptr() as *const _,
transmute(notify_throttle_time_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_throttle_time_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::ts-offset\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::ts-offset\0".as_ptr() as *const _,
transmute(notify_ts_offset_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_ts_offset_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_async_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_async_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_blocksize_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_blocksize_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_enable_last_sample_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_enable_last_sample_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_last_sample_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_last_sample_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_max_bitrate_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_max_bitrate_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_max_lateness_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_max_lateness_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_qos_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_qos_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_render_delay_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_render_delay_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_sync_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_sync_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_throttle_time_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_throttle_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_ts_offset_trampoline<P>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_ts_offset_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSink, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSink> { where P: IsA<BaseSink> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSink::from_glib_borrow(this).unsafe_cast()) f(&BaseSink::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -210,57 +210,57 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::blocksize\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::blocksize\0".as_ptr() as *const _,
transmute(notify_blocksize_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_blocksize_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::do-timestamp\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::do-timestamp\0".as_ptr() as *const _,
transmute(notify_do_timestamp_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_do_timestamp_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::num-buffers\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::num-buffers\0".as_ptr() as *const _,
transmute(notify_num_buffers_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_num_buffers_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::typefind\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::typefind\0".as_ptr() as *const _,
transmute(notify_typefind_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_typefind_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_blocksize_trampoline<P>(this: *mut ffi::GstBaseSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_blocksize_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSrc> { where P: IsA<BaseSrc> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSrc::from_glib_borrow(this).unsafe_cast()) f(&BaseSrc::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_do_timestamp_trampoline<P>(this: *mut ffi::GstBaseSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_do_timestamp_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSrc> { where P: IsA<BaseSrc> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSrc::from_glib_borrow(this).unsafe_cast()) f(&BaseSrc::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_num_buffers_trampoline<P>(this: *mut ffi::GstBaseSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_num_buffers_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSrc> { where P: IsA<BaseSrc> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSrc::from_glib_borrow(this).unsafe_cast()) f(&BaseSrc::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_typefind_trampoline<P>(this: *mut ffi::GstBaseSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_typefind_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseSrc, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseSrc> { where P: IsA<BaseSrc> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseSrc::from_glib_borrow(this).unsafe_cast()) f(&BaseSrc::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -165,15 +165,15 @@ impl<O: IsA<BaseTransform>> BaseTransformExt for O {
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::qos\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::qos\0".as_ptr() as *const _,
transmute(notify_qos_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_qos_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_qos_trampoline<P>(this: *mut ffi::GstBaseTransform, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_qos_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBaseTransform, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<BaseTransform> { where P: IsA<BaseTransform> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&BaseTransform::from_glib_borrow(this).unsafe_cast()) f(&BaseTransform::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -34,11 +34,11 @@ pub fn type_find_helper_for_extension<'a, P: IsA<gst::Object> + 'a, Q: Into<Opti
} }
} }
//pub fn type_find_helper_get_range<'a, P: IsA<gst::Object>, Q: IsA<gst::Object> + 'a, R: Into<Option<&'a Q>>>(obj: &P, parent: R, func: /*Unknown conversion*//*Unimplemented*/TypeFindHelperGetRangeFunction, size: u64, extension: &str) -> (Option<gst::Caps>, gst::TypeFindProbability) { //pub fn type_find_helper_get_range<'a, P: IsA<gst::Object>, Q: IsA<gst::Object> + 'a, R: Into<Option<&'a Q>>, S: FnMut(&gst::Object, &gst::Object, u64, u32, &gst::Buffer) -> gst::FlowReturn>(obj: &P, parent: R, func: S, size: u64, extension: &str) -> (Option<gst::Caps>, gst::TypeFindProbability) {
// unsafe { TODO: call ffi::gst_type_find_helper_get_range() } // unsafe { TODO: call ffi::gst_type_find_helper_get_range() }
//} //}
//#[cfg(any(feature = "v1_14_3", feature = "dox"))] //#[cfg(any(feature = "v1_14_3", feature = "dox"))]
//pub fn type_find_helper_get_range_full<'a, 'b, P: IsA<gst::Object>, Q: IsA<gst::Object> + 'a, R: Into<Option<&'a Q>>, S: Into<Option<&'b str>>>(obj: &P, parent: R, func: /*Unknown conversion*//*Unimplemented*/TypeFindHelperGetRangeFunction, size: u64, extension: S) -> (gst::FlowReturn, gst::Caps, gst::TypeFindProbability) { //pub fn type_find_helper_get_range_full<'a, 'b, P: IsA<gst::Object>, Q: IsA<gst::Object> + 'a, R: Into<Option<&'a Q>>, S: FnMut(&gst::Object, &gst::Object, u64, u32, &gst::Buffer) -> gst::FlowReturn, T: Into<Option<&'b str>>>(obj: &P, parent: R, func: S, size: u64, extension: T) -> (gst::FlowReturn, gst::Caps, gst::TypeFindProbability) {
// unsafe { TODO: call ffi::gst_type_find_helper_get_range_full() } // unsafe { TODO: call ffi::gst_type_find_helper_get_range_full() }
//} //}

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -127,9 +127,9 @@ impl TestClock {
pub fn connect_property_clock_type_notify<F: Fn(&TestClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_clock_type_notify<F: Fn(&TestClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&TestClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::clock-type\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::clock-type\0".as_ptr() as *const _,
transmute(notify_clock_type_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_clock_type_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -143,7 +143,7 @@ impl Default for TestClock {
unsafe impl Send for TestClock {} unsafe impl Send for TestClock {}
unsafe impl Sync for TestClock {} unsafe impl Sync for TestClock {}
unsafe extern "C" fn notify_clock_type_trampoline(this: *mut ffi::GstTestClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_clock_type_trampoline<F: Fn(&TestClock) + Send + Sync + 'static>(this: *mut ffi::GstTestClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&TestClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -52,13 +52,12 @@ impl Asset {
pub fn request_async<'a, P: IsA<gio::Cancellable> + 'a, Q: Into<Option<&'a P>>, R: FnOnce(Result<Asset, Error>) + Send + 'static>(extractable_type: glib::types::Type, id: &str, cancellable: Q, callback: R) { pub fn request_async<'a, P: IsA<gio::Cancellable> + 'a, Q: Into<Option<&'a P>>, R: FnOnce(Result<Asset, Error>) + Send + 'static>(extractable_type: glib::types::Type, id: &str, cancellable: Q, callback: R) {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
let cancellable = cancellable.into(); let cancellable = cancellable.into();
let user_data: Box<Box<R>> = Box::new(Box::new(callback)); let user_data: Box<R> = Box::new(callback);
unsafe extern "C" fn request_async_trampoline<R: FnOnce(Result<Asset, Error>) + Send + 'static>(_source_object: *mut gobject_ffi::GObject, res: *mut gio_ffi::GAsyncResult, user_data: glib_ffi::gpointer) unsafe extern "C" fn request_async_trampoline<R: FnOnce(Result<Asset, Error>) + Send + 'static>(_source_object: *mut gobject_ffi::GObject, res: *mut gio_ffi::GAsyncResult, user_data: glib_ffi::gpointer) {
{
let mut error = ptr::null_mut(); let mut error = ptr::null_mut();
let ret = ffi::ges_asset_request_finish(res, &mut error); let ret = ffi::ges_asset_request_finish(res, &mut error);
let result = if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }; let result = if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) };
let callback: Box<Box<R>> = Box::from_raw(user_data as *mut _); let callback: Box<R> = Box::from_raw(user_data as *mut _);
callback(result); callback(result);
} }
let callback = request_async_trampoline::<R>; let callback = request_async_trampoline::<R>;
@ -184,29 +183,29 @@ impl<O: IsA<Asset>> AssetExt for O {
fn connect_property_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::proxy\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::proxy\0".as_ptr() as *const _,
transmute(notify_proxy_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_proxy_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::proxy-target\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::proxy-target\0".as_ptr() as *const _,
transmute(notify_proxy_target_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_proxy_target_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_proxy_trampoline<P>(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_proxy_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Asset> { where P: IsA<Asset> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Asset::from_glib_borrow(this).unsafe_cast()) f(&Asset::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_proxy_target_trampoline<P>(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_proxy_target_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Asset> { where P: IsA<Asset> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Asset::from_glib_borrow(this).unsafe_cast()) f(&Asset::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -147,29 +147,29 @@ impl<O: IsA<Clip>> ClipExt for O {
fn connect_property_layer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_layer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::layer\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::layer\0".as_ptr() as *const _,
transmute(notify_layer_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_layer_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::supported-formats\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::supported-formats\0".as_ptr() as *const _,
transmute(notify_supported_formats_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_supported_formats_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_layer_trampoline<P>(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_layer_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Clip> { where P: IsA<Clip> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Clip::from_glib_borrow(this).unsafe_cast()) f(&Clip::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_supported_formats_trampoline<P>(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_supported_formats_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Clip> { where P: IsA<Clip> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Clip::from_glib_borrow(this).unsafe_cast()) f(&Clip::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -101,43 +101,43 @@ impl<O: IsA<Container>> GESContainerExt for O {
fn connect_child_added<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_child_added<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &TimelineElement) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"child-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"child-added\0".as_ptr() as *const _,
transmute(child_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(child_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_child_removed<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_child_removed<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &TimelineElement) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"child-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"child-removed\0".as_ptr() as *const _,
transmute(child_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(child_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::height\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::height\0".as_ptr() as *const _,
transmute(notify_height_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_height_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn child_added_trampoline<P>(this: *mut ffi::GESContainer, element: *mut ffi::GESTimelineElement, f: glib_ffi::gpointer) unsafe extern "C" fn child_added_trampoline<P, F: Fn(&P, &TimelineElement) + 'static>(this: *mut ffi::GESContainer, element: *mut ffi::GESTimelineElement, f: glib_ffi::gpointer)
where P: IsA<Container> { where P: IsA<Container> {
let f: &&(Fn(&P, &TimelineElement) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Container::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element)) f(&Container::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element))
} }
unsafe extern "C" fn child_removed_trampoline<P>(this: *mut ffi::GESContainer, element: *mut ffi::GESTimelineElement, f: glib_ffi::gpointer) unsafe extern "C" fn child_removed_trampoline<P, F: Fn(&P, &TimelineElement) + 'static>(this: *mut ffi::GESContainer, element: *mut ffi::GESTimelineElement, f: glib_ffi::gpointer)
where P: IsA<Container> { where P: IsA<Container> {
let f: &&(Fn(&P, &TimelineElement) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Container::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element)) f(&Container::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element))
} }
unsafe extern "C" fn notify_height_trampoline<P>(this: *mut ffi::GESContainer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_height_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESContainer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Container> { where P: IsA<Container> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Container::from_glib_borrow(this).unsafe_cast()) f(&Container::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -23,7 +23,7 @@ glib_wrapper! {
} }
impl Effect { impl Effect {
pub fn new(bin_description: &str) -> Effect { pub fn new(bin_description: &str) -> Option<Effect> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_none(ffi::ges_effect_new(bin_description.to_glib_none().0)) from_glib_none(ffi::ges_effect_new(bin_description.to_glib_none().0))

View file

@ -148,71 +148,71 @@ impl<O: IsA<Group>> GroupExt for O {
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::in-point\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::in-point\0".as_ptr() as *const _,
transmute(notify_in_point_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_in_point_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-duration\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::max-duration\0".as_ptr() as *const _,
transmute(notify_max_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_max_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _,
transmute(notify_priority_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_priority_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::start\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::start\0".as_ptr() as *const _,
transmute(notify_start_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_start_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Group> { where P: IsA<Group> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Group::from_glib_borrow(this).unsafe_cast()) f(&Group::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_in_point_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_in_point_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Group> { where P: IsA<Group> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Group::from_glib_borrow(this).unsafe_cast()) f(&Group::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_max_duration_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_max_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Group> { where P: IsA<Group> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Group::from_glib_borrow(this).unsafe_cast()) f(&Group::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_priority_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_priority_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Group> { where P: IsA<Group> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Group::from_glib_borrow(this).unsafe_cast()) f(&Group::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_start_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_start_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Group> { where P: IsA<Group> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Group::from_glib_borrow(this).unsafe_cast()) f(&Group::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -162,57 +162,57 @@ impl<O: IsA<Layer>> LayerExt for O {
fn connect_clip_added<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_clip_added<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Clip) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"clip-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"clip-added\0".as_ptr() as *const _,
transmute(clip_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(clip_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_clip_removed<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_clip_removed<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Clip) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"clip-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"clip-removed\0".as_ptr() as *const _,
transmute(clip_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(clip_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::auto-transition\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::auto-transition\0".as_ptr() as *const _,
transmute(notify_auto_transition_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_auto_transition_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _,
transmute(notify_priority_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_priority_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn clip_added_trampoline<P>(this: *mut ffi::GESLayer, clip: *mut ffi::GESClip, f: glib_ffi::gpointer) unsafe extern "C" fn clip_added_trampoline<P, F: Fn(&P, &Clip) + 'static>(this: *mut ffi::GESLayer, clip: *mut ffi::GESClip, f: glib_ffi::gpointer)
where P: IsA<Layer> { where P: IsA<Layer> {
let f: &&(Fn(&P, &Clip) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Layer::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(clip)) f(&Layer::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(clip))
} }
unsafe extern "C" fn clip_removed_trampoline<P>(this: *mut ffi::GESLayer, clip: *mut ffi::GESClip, f: glib_ffi::gpointer) unsafe extern "C" fn clip_removed_trampoline<P, F: Fn(&P, &Clip) + 'static>(this: *mut ffi::GESLayer, clip: *mut ffi::GESClip, f: glib_ffi::gpointer)
where P: IsA<Layer> { where P: IsA<Layer> {
let f: &&(Fn(&P, &Clip) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Layer::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(clip)) f(&Layer::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(clip))
} }
unsafe extern "C" fn notify_auto_transition_trampoline<P>(this: *mut ffi::GESLayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_auto_transition_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESLayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Layer> { where P: IsA<Layer> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Layer::from_glib_borrow(this).unsafe_cast()) f(&Layer::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_priority_trampoline<P>(this: *mut ffi::GESLayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_priority_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESLayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Layer> { where P: IsA<Layer> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Layer::from_glib_borrow(this).unsafe_cast()) f(&Layer::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -236,85 +236,85 @@ impl<O: IsA<Pipeline>> GESPipelineExt for O {
fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::audio-filter\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::audio-filter\0".as_ptr() as *const _,
transmute(notify_audio_filter_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_audio_filter_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::audio-sink\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::audio-sink\0".as_ptr() as *const _,
transmute(notify_audio_sink_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_audio_sink_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mode\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::mode\0".as_ptr() as *const _,
transmute(notify_mode_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_mode_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::timeline\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::timeline\0".as_ptr() as *const _,
transmute(notify_timeline_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_timeline_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::video-filter\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::video-filter\0".as_ptr() as *const _,
transmute(notify_video_filter_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_video_filter_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::video-sink\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::video-sink\0".as_ptr() as *const _,
transmute(notify_video_sink_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_video_sink_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_audio_filter_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_audio_filter_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pipeline> { where P: IsA<Pipeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pipeline::from_glib_borrow(this).unsafe_cast()) f(&Pipeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_audio_sink_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_audio_sink_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pipeline> { where P: IsA<Pipeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pipeline::from_glib_borrow(this).unsafe_cast()) f(&Pipeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_mode_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_mode_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pipeline> { where P: IsA<Pipeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pipeline::from_glib_borrow(this).unsafe_cast()) f(&Pipeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_timeline_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_timeline_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pipeline> { where P: IsA<Pipeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pipeline::from_glib_borrow(this).unsafe_cast()) f(&Pipeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_video_filter_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_video_filter_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pipeline> { where P: IsA<Pipeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pipeline::from_glib_borrow(this).unsafe_cast()) f(&Pipeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_video_sink_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_video_sink_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pipeline> { where P: IsA<Pipeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pipeline::from_glib_borrow(this).unsafe_cast()) f(&Pipeline::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -162,85 +162,85 @@ impl<O: IsA<Project>> ProjectExt for O {
fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Asset) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"asset-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"asset-added\0".as_ptr() as *const _,
transmute(asset_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(asset_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Asset) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"asset-loading\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"asset-loading\0".as_ptr() as *const _,
transmute(asset_loading_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(asset_loading_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Asset) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"asset-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"asset-removed\0".as_ptr() as *const _,
transmute(asset_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(asset_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, glib::types::Type) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, glib::types::Type) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Error, &str, glib::types::Type) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"error-loading-asset\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"error-loading-asset\0".as_ptr() as *const _,
transmute(error_loading_asset_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(error_loading_asset_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Timeline) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"loaded\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"loaded\0".as_ptr() as *const _,
transmute(loaded_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(loaded_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(&self, f: F) -> SignalHandlerId { fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"missing-uri\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"missing-uri\0".as_ptr() as *const _,
transmute(missing_uri_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(missing_uri_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn asset_added_trampoline<P>(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) unsafe extern "C" fn asset_added_trampoline<P, F: Fn(&P, &Asset) + 'static>(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer)
where P: IsA<Project> { where P: IsA<Project> {
let f: &&(Fn(&P, &Asset) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(asset)) f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(asset))
} }
unsafe extern "C" fn asset_loading_trampoline<P>(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) unsafe extern "C" fn asset_loading_trampoline<P, F: Fn(&P, &Asset) + 'static>(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer)
where P: IsA<Project> { where P: IsA<Project> {
let f: &&(Fn(&P, &Asset) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(asset)) f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(asset))
} }
unsafe extern "C" fn asset_removed_trampoline<P>(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) unsafe extern "C" fn asset_removed_trampoline<P, F: Fn(&P, &Asset) + 'static>(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer)
where P: IsA<Project> { where P: IsA<Project> {
let f: &&(Fn(&P, &Asset) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(asset)) f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(asset))
} }
unsafe extern "C" fn error_loading_asset_trampoline<P>(this: *mut ffi::GESProject, error: *mut glib_ffi::GError, id: *mut libc::c_char, extractable_type: glib_ffi::GType, f: glib_ffi::gpointer) unsafe extern "C" fn error_loading_asset_trampoline<P, F: Fn(&P, &Error, &str, glib::types::Type) + 'static>(this: *mut ffi::GESProject, error: *mut glib_ffi::GError, id: *mut libc::c_char, extractable_type: glib_ffi::GType, f: glib_ffi::gpointer)
where P: IsA<Project> { where P: IsA<Project> {
let f: &&(Fn(&P, &Error, &str, glib::types::Type) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(error), &GString::from_glib_borrow(id), from_glib(extractable_type)) f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(error), &GString::from_glib_borrow(id), from_glib(extractable_type))
} }
unsafe extern "C" fn loaded_trampoline<P>(this: *mut ffi::GESProject, timeline: *mut ffi::GESTimeline, f: glib_ffi::gpointer) unsafe extern "C" fn loaded_trampoline<P, F: Fn(&P, &Timeline) + 'static>(this: *mut ffi::GESProject, timeline: *mut ffi::GESTimeline, f: glib_ffi::gpointer)
where P: IsA<Project> { where P: IsA<Project> {
let f: &&(Fn(&P, &Timeline) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(timeline)) f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(timeline))
} }
unsafe extern "C" fn missing_uri_trampoline<P>(this: *mut ffi::GESProject, error: *mut glib_ffi::GError, wrong_asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) -> *mut libc::c_char unsafe extern "C" fn missing_uri_trampoline<P, F: Fn(&P, &Error, &Asset) -> Option<GString> + 'static>(this: *mut ffi::GESProject, error: *mut glib_ffi::GError, wrong_asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) -> *mut libc::c_char
where P: IsA<Project> { where P: IsA<Project> {
let f: &&(Fn(&P, &Error, &Asset) -> Option<GString> + 'static) = transmute(f); let f: &F = transmute(f);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(error), &from_glib_borrow(wrong_asset)).to_glib_full() f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(error), &from_glib_borrow(wrong_asset)).to_glib_full()
} }

View file

@ -292,17 +292,17 @@ impl<O: IsA<Timeline>> TimelineExt for O {
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"commited\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"commited\0".as_ptr() as *const _,
transmute(commited_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(commited_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_group_added<F: Fn(&Self, &Group) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_group_added<F: Fn(&Self, &Group) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Group) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"group-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"group-added\0".as_ptr() as *const _,
transmute(group_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(group_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
@ -312,17 +312,17 @@ impl<O: IsA<Timeline>> TimelineExt for O {
fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Layer) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"layer-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"layer-added\0".as_ptr() as *const _,
transmute(layer_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(layer_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_layer_removed<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_layer_removed<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Layer) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"layer-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"layer-removed\0".as_ptr() as *const _,
transmute(layer_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(layer_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
@ -332,123 +332,123 @@ impl<O: IsA<Timeline>> TimelineExt for O {
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"snapping-ended\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"snapping-ended\0".as_ptr() as *const _,
transmute(snapping_ended_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(snapping_ended_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"snapping-started\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"snapping-started\0".as_ptr() as *const _,
transmute(snapping_started_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(snapping_started_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_track_added<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_track_added<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Track) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"track-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"track-added\0".as_ptr() as *const _,
transmute(track_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(track_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Track) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"track-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"track-removed\0".as_ptr() as *const _,
transmute(track_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(track_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::auto-transition\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::auto-transition\0".as_ptr() as *const _,
transmute(notify_auto_transition_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_auto_transition_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::snapping-distance\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::snapping-distance\0".as_ptr() as *const _,
transmute(notify_snapping_distance_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_snapping_distance_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn commited_trampoline<P>(this: *mut ffi::GESTimeline, f: glib_ffi::gpointer) unsafe extern "C" fn commited_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimeline, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast()) f(&Timeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn group_added_trampoline<P>(this: *mut ffi::GESTimeline, group: *mut ffi::GESGroup, f: glib_ffi::gpointer) unsafe extern "C" fn group_added_trampoline<P, F: Fn(&P, &Group) + 'static>(this: *mut ffi::GESTimeline, group: *mut ffi::GESGroup, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P, &Group) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(group)) f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(group))
} }
unsafe extern "C" fn layer_added_trampoline<P>(this: *mut ffi::GESTimeline, layer: *mut ffi::GESLayer, f: glib_ffi::gpointer) unsafe extern "C" fn layer_added_trampoline<P, F: Fn(&P, &Layer) + 'static>(this: *mut ffi::GESTimeline, layer: *mut ffi::GESLayer, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P, &Layer) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(layer)) f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(layer))
} }
unsafe extern "C" fn layer_removed_trampoline<P>(this: *mut ffi::GESTimeline, layer: *mut ffi::GESLayer, f: glib_ffi::gpointer) unsafe extern "C" fn layer_removed_trampoline<P, F: Fn(&P, &Layer) + 'static>(this: *mut ffi::GESTimeline, layer: *mut ffi::GESLayer, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P, &Layer) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(layer)) f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(layer))
} }
unsafe extern "C" fn snapping_ended_trampoline<P>(this: *mut ffi::GESTimeline, object: *mut ffi::GESTrackElement, p0: *mut ffi::GESTrackElement, p1: u64, f: glib_ffi::gpointer) unsafe extern "C" fn snapping_ended_trampoline<P, F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static>(this: *mut ffi::GESTimeline, object: *mut ffi::GESTrackElement, p0: *mut ffi::GESTrackElement, p1: u64, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P, &TrackElement, &TrackElement, u64) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object), &from_glib_borrow(p0), p1) f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object), &from_glib_borrow(p0), p1)
} }
unsafe extern "C" fn snapping_started_trampoline<P>(this: *mut ffi::GESTimeline, object: *mut ffi::GESTrackElement, p0: *mut ffi::GESTrackElement, p1: u64, f: glib_ffi::gpointer) unsafe extern "C" fn snapping_started_trampoline<P, F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static>(this: *mut ffi::GESTimeline, object: *mut ffi::GESTrackElement, p0: *mut ffi::GESTrackElement, p1: u64, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P, &TrackElement, &TrackElement, u64) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object), &from_glib_borrow(p0), p1) f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object), &from_glib_borrow(p0), p1)
} }
unsafe extern "C" fn track_added_trampoline<P>(this: *mut ffi::GESTimeline, track: *mut ffi::GESTrack, f: glib_ffi::gpointer) unsafe extern "C" fn track_added_trampoline<P, F: Fn(&P, &Track) + 'static>(this: *mut ffi::GESTimeline, track: *mut ffi::GESTrack, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P, &Track) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(track)) f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(track))
} }
unsafe extern "C" fn track_removed_trampoline<P>(this: *mut ffi::GESTimeline, track: *mut ffi::GESTrack, f: glib_ffi::gpointer) unsafe extern "C" fn track_removed_trampoline<P, F: Fn(&P, &Track) + 'static>(this: *mut ffi::GESTimeline, track: *mut ffi::GESTrack, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P, &Track) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(track)) f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(track))
} }
unsafe extern "C" fn notify_auto_transition_trampoline<P>(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_auto_transition_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast()) f(&Timeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast()) f(&Timeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_snapping_distance_trampoline<P>(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_snapping_distance_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Timeline> { where P: IsA<Timeline> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Timeline::from_glib_borrow(this).unsafe_cast()) f(&Timeline::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -31,7 +31,7 @@ glib_wrapper! {
pub const NONE_TIMELINE_ELEMENT: Option<&TimelineElement> = None; pub const NONE_TIMELINE_ELEMENT: Option<&TimelineElement> = None;
pub trait TimelineElementExt: 'static { pub trait TimelineElementExt: 'static {
//fn add_child_property<P: IsA</*Ignored*/glib::ParamSpec>, Q: IsA<glib::Object>>(&self, pspec: &P, child: &Q) -> bool; //fn add_child_property<P: IsA<glib::Object>>(&self, pspec: /*Ignored*/&glib::ParamSpec, child: &P) -> bool;
fn copy(&self, deep: bool) -> Option<TimelineElement>; fn copy(&self, deep: bool) -> Option<TimelineElement>;
@ -39,7 +39,7 @@ pub trait TimelineElementExt: 'static {
//fn get_child_property(&self, property_name: &str, value: /*Ignored*/glib::Value) -> bool; //fn get_child_property(&self, property_name: &str, value: /*Ignored*/glib::Value) -> bool;
//fn get_child_property_by_pspec<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P, value: /*Ignored*/glib::Value); //fn get_child_property_by_pspec(&self, pspec: /*Ignored*/&glib::ParamSpec, value: /*Ignored*/glib::Value);
//fn get_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported); //fn get_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported);
@ -69,7 +69,7 @@ pub trait TimelineElementExt: 'static {
fn paste(&self, paste_position: gst::ClockTime) -> Option<TimelineElement>; fn paste(&self, paste_position: gst::ClockTime) -> Option<TimelineElement>;
//fn remove_child_property<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P) -> bool; //fn remove_child_property(&self, pspec: /*Ignored*/&glib::ParamSpec) -> bool;
fn ripple(&self, start: gst::ClockTime) -> bool; fn ripple(&self, start: gst::ClockTime) -> bool;
@ -83,7 +83,7 @@ pub trait TimelineElementExt: 'static {
//fn set_child_property(&self, property_name: &str, value: /*Ignored*/&glib::Value) -> bool; //fn set_child_property(&self, property_name: &str, value: /*Ignored*/&glib::Value) -> bool;
//fn set_child_property_by_pspec<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P, value: /*Ignored*/&glib::Value); //fn set_child_property_by_pspec(&self, pspec: /*Ignored*/&glib::ParamSpec, value: /*Ignored*/&glib::Value);
//fn set_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported); //fn set_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported);
@ -135,7 +135,7 @@ pub trait TimelineElementExt: 'static {
} }
impl<O: IsA<TimelineElement>> TimelineElementExt for O { impl<O: IsA<TimelineElement>> TimelineElementExt for O {
//fn add_child_property<P: IsA</*Ignored*/glib::ParamSpec>, Q: IsA<glib::Object>>(&self, pspec: &P, child: &Q) -> bool { //fn add_child_property<P: IsA<glib::Object>>(&self, pspec: /*Ignored*/&glib::ParamSpec, child: &P) -> bool {
// unsafe { TODO: call ffi::ges_timeline_element_add_child_property() } // unsafe { TODO: call ffi::ges_timeline_element_add_child_property() }
//} //}
@ -153,7 +153,7 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
// unsafe { TODO: call ffi::ges_timeline_element_get_child_property() } // unsafe { TODO: call ffi::ges_timeline_element_get_child_property() }
//} //}
//fn get_child_property_by_pspec<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P, value: /*Ignored*/glib::Value) { //fn get_child_property_by_pspec(&self, pspec: /*Ignored*/&glib::ParamSpec, value: /*Ignored*/glib::Value) {
// unsafe { TODO: call ffi::ges_timeline_element_get_child_property_by_pspec() } // unsafe { TODO: call ffi::ges_timeline_element_get_child_property_by_pspec() }
//} //}
@ -235,7 +235,7 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
} }
} }
//fn remove_child_property<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P) -> bool { //fn remove_child_property(&self, pspec: /*Ignored*/&glib::ParamSpec) -> bool {
// unsafe { TODO: call ffi::ges_timeline_element_remove_child_property() } // unsafe { TODO: call ffi::ges_timeline_element_remove_child_property() }
//} //}
@ -271,7 +271,7 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
// unsafe { TODO: call ffi::ges_timeline_element_set_child_property() } // unsafe { TODO: call ffi::ges_timeline_element_set_child_property() }
//} //}
//fn set_child_property_by_pspec<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P, value: /*Ignored*/&glib::Value) { //fn set_child_property_by_pspec(&self, pspec: /*Ignored*/&glib::ParamSpec, value: /*Ignored*/&glib::Value) {
// unsafe { TODO: call ffi::ges_timeline_element_set_child_property_by_pspec() } // unsafe { TODO: call ffi::ges_timeline_element_set_child_property_by_pspec() }
//} //}
@ -368,127 +368,127 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::in-point\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::in-point\0".as_ptr() as *const _,
transmute(notify_in_point_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_in_point_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-duration\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::max-duration\0".as_ptr() as *const _,
transmute(notify_max_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_max_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _,
transmute(notify_name_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_name_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::parent\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::parent\0".as_ptr() as *const _,
transmute(notify_parent_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_parent_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _,
transmute(notify_priority_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_priority_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_serialize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_serialize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::serialize\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::serialize\0".as_ptr() as *const _,
transmute(notify_serialize_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_serialize_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::start\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::start\0".as_ptr() as *const _,
transmute(notify_start_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_start_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::timeline\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::timeline\0".as_ptr() as *const _,
transmute(notify_timeline_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_timeline_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TimelineElement> { where P: IsA<TimelineElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast()) f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_in_point_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_in_point_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TimelineElement> { where P: IsA<TimelineElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast()) f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_max_duration_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_max_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TimelineElement> { where P: IsA<TimelineElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast()) f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_name_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_name_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TimelineElement> { where P: IsA<TimelineElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast()) f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_parent_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_parent_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TimelineElement> { where P: IsA<TimelineElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast()) f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_priority_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_priority_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TimelineElement> { where P: IsA<TimelineElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast()) f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_serialize_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_serialize_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TimelineElement> { where P: IsA<TimelineElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast()) f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_start_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_start_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TimelineElement> { where P: IsA<TimelineElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast()) f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_timeline_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_timeline_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TimelineElement> { where P: IsA<TimelineElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast()) f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -54,7 +54,7 @@ pub trait GESTrackExt: 'static {
fn remove_element<P: IsA<TrackElement>>(&self, object: &P) -> Result<(), glib::error::BoolError>; fn remove_element<P: IsA<TrackElement>>(&self, object: &P) -> Result<(), glib::error::BoolError>;
//fn set_create_element_for_gap_func(&self, func: /*Unknown conversion*//*Unimplemented*/CreateElementForGapFunc); //fn set_create_element_for_gap_func<P: Fn(&Track) -> gst::Element + 'static>(&self, func: P);
fn set_mixing(&self, mixing: bool); fn set_mixing(&self, mixing: bool);
@ -126,7 +126,7 @@ impl<O: IsA<Track>> GESTrackExt for O {
} }
} }
//fn set_create_element_for_gap_func(&self, func: /*Unknown conversion*//*Unimplemented*/CreateElementForGapFunc) { //fn set_create_element_for_gap_func<P: Fn(&Track) -> gst::Element + 'static>(&self, func: P) {
// unsafe { TODO: call ffi::ges_track_set_create_element_for_gap_func() } // unsafe { TODO: call ffi::ges_track_set_create_element_for_gap_func() }
//} //}
@ -180,85 +180,85 @@ impl<O: IsA<Track>> GESTrackExt for O {
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"commited\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"commited\0".as_ptr() as *const _,
transmute(commited_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(commited_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &TrackElement) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"track-element-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"track-element-added\0".as_ptr() as *const _,
transmute(track_element_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(track_element_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &TrackElement) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"track-element-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"track-element-removed\0".as_ptr() as *const _,
transmute(track_element_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(track_element_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_mixing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_mixing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mixing\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::mixing\0".as_ptr() as *const _,
transmute(notify_mixing_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_mixing_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_restriction_caps_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_restriction_caps_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::restriction-caps\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::restriction-caps\0".as_ptr() as *const _,
transmute(notify_restriction_caps_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_restriction_caps_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn commited_trampoline<P>(this: *mut ffi::GESTrack, f: glib_ffi::gpointer) unsafe extern "C" fn commited_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTrack, f: glib_ffi::gpointer)
where P: IsA<Track> { where P: IsA<Track> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Track::from_glib_borrow(this).unsafe_cast()) f(&Track::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn track_element_added_trampoline<P>(this: *mut ffi::GESTrack, effect: *mut ffi::GESTrackElement, f: glib_ffi::gpointer) unsafe extern "C" fn track_element_added_trampoline<P, F: Fn(&P, &TrackElement) + 'static>(this: *mut ffi::GESTrack, effect: *mut ffi::GESTrackElement, f: glib_ffi::gpointer)
where P: IsA<Track> { where P: IsA<Track> {
let f: &&(Fn(&P, &TrackElement) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Track::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(effect)) f(&Track::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(effect))
} }
unsafe extern "C" fn track_element_removed_trampoline<P>(this: *mut ffi::GESTrack, effect: *mut ffi::GESTrackElement, f: glib_ffi::gpointer) unsafe extern "C" fn track_element_removed_trampoline<P, F: Fn(&P, &TrackElement) + 'static>(this: *mut ffi::GESTrack, effect: *mut ffi::GESTrackElement, f: glib_ffi::gpointer)
where P: IsA<Track> { where P: IsA<Track> {
let f: &&(Fn(&P, &TrackElement) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Track::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(effect)) f(&Track::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(effect))
} }
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Track> { where P: IsA<Track> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Track::from_glib_borrow(this).unsafe_cast()) f(&Track::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_mixing_trampoline<P>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_mixing_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Track> { where P: IsA<Track> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Track::from_glib_borrow(this).unsafe_cast()) f(&Track::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_restriction_caps_trampoline<P>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_restriction_caps_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Track> { where P: IsA<Track> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&Track::from_glib_borrow(this).unsafe_cast()) f(&Track::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -61,7 +61,7 @@ pub trait TrackElementExt: 'static {
fn set_active(&self, active: bool) -> bool; fn set_active(&self, active: bool) -> bool;
//fn set_control_source<P: IsA</*Ignored*/gst::ControlSource>>(&self, source: &P, property_name: &str, binding_type: &str) -> bool; //fn set_control_source(&self, source: /*Ignored*/&gst::ControlSource, property_name: &str, binding_type: &str) -> bool;
fn set_track_type(&self, type_: TrackType); fn set_track_type(&self, type_: TrackType);
@ -151,7 +151,7 @@ impl<O: IsA<TrackElement>> TrackElementExt for O {
} }
} }
//fn set_control_source<P: IsA</*Ignored*/gst::ControlSource>>(&self, source: &P, property_name: &str, binding_type: &str) -> bool { //fn set_control_source(&self, source: /*Ignored*/&gst::ControlSource, property_name: &str, binding_type: &str) -> bool {
// unsafe { TODO: call ffi::ges_track_element_set_control_source() } // unsafe { TODO: call ffi::ges_track_element_set_control_source() }
//} //}
@ -179,43 +179,43 @@ impl<O: IsA<TrackElement>> TrackElementExt for O {
fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::active\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::active\0".as_ptr() as *const _,
transmute(notify_active_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_active_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_track_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_track_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::track\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::track\0".as_ptr() as *const _,
transmute(notify_track_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_track_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::track-type\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::track-type\0".as_ptr() as *const _,
transmute(notify_track_type_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_track_type_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_active_trampoline<P>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_active_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TrackElement> { where P: IsA<TrackElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TrackElement::from_glib_borrow(this).unsafe_cast()) f(&TrackElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_track_trampoline<P>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_track_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TrackElement> { where P: IsA<TrackElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TrackElement::from_glib_borrow(this).unsafe_cast()) f(&TrackElement::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_track_type_trampoline<P>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_track_type_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TrackElement> { where P: IsA<TrackElement> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&TrackElement::from_glib_borrow(this).unsafe_cast()) f(&TrackElement::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -29,7 +29,7 @@ glib_wrapper! {
} }
impl UriClip { impl UriClip {
pub fn new(uri: &str) -> UriClip { pub fn new(uri: &str) -> Option<UriClip> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_none(ffi::ges_uri_clip_new(uri.to_glib_none().0)) from_glib_none(ffi::ges_uri_clip_new(uri.to_glib_none().0))
@ -110,43 +110,43 @@ impl<O: IsA<UriClip>> UriClipExt for O {
fn connect_property_is_image_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_is_image_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::is-image\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::is-image\0".as_ptr() as *const _,
transmute(notify_is_image_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_is_image_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _,
transmute(notify_mute_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_mute_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::supported-formats\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::supported-formats\0".as_ptr() as *const _,
transmute(notify_supported_formats_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_supported_formats_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_is_image_trampoline<P>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_is_image_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<UriClip> { where P: IsA<UriClip> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&UriClip::from_glib_borrow(this).unsafe_cast()) f(&UriClip::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_mute_trampoline<P>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_mute_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<UriClip> { where P: IsA<UriClip> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&UriClip::from_glib_borrow(this).unsafe_cast()) f(&UriClip::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_supported_formats_trampoline<P>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_supported_formats_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<UriClip> { where P: IsA<UriClip> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&UriClip::from_glib_borrow(this).unsafe_cast()) f(&UriClip::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -29,7 +29,7 @@ glib_wrapper! {
} }
impl UriClipAsset { impl UriClipAsset {
//pub fn new<'a, P: IsA<gio::Cancellable> + 'a, Q: Into<Option<&'a P>>, R: /*Unimplemented*/gio::AsyncReadyCallback>(uri: &str, cancellable: Q, callback: R) { //pub fn new<'a, P: IsA<gio::Cancellable> + 'a, Q: Into<Option<&'a P>>, R: FnOnce(Result<(), Error>) + 'static>(uri: &str, cancellable: Q, callback: R) {
// unsafe { TODO: call ffi::ges_uri_clip_asset_new() } // unsafe { TODO: call ffi::ges_uri_clip_asset_new() }
//} //}
@ -92,15 +92,15 @@ impl<O: IsA<UriClipAsset>> UriClipAssetExt for O {
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESUriClipAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ffi::GESUriClipAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<UriClipAsset> { where P: IsA<UriClipAsset> {
let f: &&(Fn(&P) + 'static) = transmute(f); let f: &F = transmute(f);
f(&UriClipAsset::from_glib_borrow(this).unsafe_cast()) f(&UriClipAsset::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -47,15 +47,15 @@ impl<O: IsA<GLBaseFilter>> GLBaseFilterExt for O {
fn connect_property_context_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_context_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::context\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::context\0".as_ptr() as *const _,
transmute(notify_context_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_context_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_context_trampoline<P>(this: *mut ffi::GstGLBaseFilter, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_context_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstGLBaseFilter, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<GLBaseFilter> { where P: IsA<GLBaseFilter> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&GLBaseFilter::from_glib_borrow(this).unsafe_cast()) f(&GLBaseFilter::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -122,15 +122,15 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
fn connect_create_context<F: Fn(&Self, &GLContext) -> GLContext + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_create_context<F: Fn(&Self, &GLContext) -> GLContext + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &GLContext) -> GLContext + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"create-context\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"create-context\0".as_ptr() as *const _,
transmute(create_context_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(create_context_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn create_context_trampoline<P>(this: *mut ffi::GstGLDisplay, context: *mut ffi::GstGLContext, f: glib_ffi::gpointer) -> *mut ffi::GstGLContext unsafe extern "C" fn create_context_trampoline<P, F: Fn(&P, &GLContext) -> GLContext + Send + Sync + 'static>(this: *mut ffi::GstGLDisplay, context: *mut ffi::GstGLContext, f: glib_ffi::gpointer) -> *mut ffi::GstGLContext
where P: IsA<GLDisplay> { where P: IsA<GLDisplay> {
let f: &&(Fn(&P, &GLContext) -> GLContext + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&GLDisplay::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(context)).to_glib_full() f(&GLDisplay::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(context)).to_glib_full()
} }

View file

@ -23,7 +23,7 @@ impl GLDisplayEGL {
} }
} }
//pub fn new_with_egl_display<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(display: P) -> GLDisplayEGL { //pub fn new_with_egl_display(display: /*Unimplemented*/Option<Fundamental: Pointer>) -> GLDisplayEGL {
// unsafe { TODO: call ffi::gst_gl_display_egl_new_with_egl_display() } // unsafe { TODO: call ffi::gst_gl_display_egl_new_with_egl_display() }
//} //}

View file

@ -43,7 +43,7 @@ pub trait GLFramebufferExt: 'static {
fn bind(&self); fn bind(&self);
//fn draw_to_texture<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, mem: /*Ignored*/&mut GLMemory, func: /*Unknown conversion*//*Unimplemented*/GLFramebufferFunc, user_data: P) -> bool; //fn draw_to_texture(&self, mem: /*Ignored*/&mut GLMemory, func: /*Unimplemented*/Fn(/*Unimplemented*/Fundamental: Pointer) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool;
fn get_effective_dimensions(&self) -> (u32, u32); fn get_effective_dimensions(&self) -> (u32, u32);
@ -61,7 +61,7 @@ impl<O: IsA<GLFramebuffer>> GLFramebufferExt for O {
} }
} }
//fn draw_to_texture<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, mem: /*Ignored*/&mut GLMemory, func: /*Unknown conversion*//*Unimplemented*/GLFramebufferFunc, user_data: P) -> bool { //fn draw_to_texture(&self, mem: /*Ignored*/&mut GLMemory, func: /*Unimplemented*/Fn(/*Unimplemented*/Fundamental: Pointer) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
// unsafe { TODO: call ffi::gst_gl_framebuffer_draw_to_texture() } // unsafe { TODO: call ffi::gst_gl_framebuffer_draw_to_texture() }
//} //}

View file

@ -255,9 +255,9 @@ impl GLShader {
pub fn connect_property_linked_notify<F: Fn(&GLShader) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_linked_notify<F: Fn(&GLShader) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&GLShader) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::linked\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::linked\0".as_ptr() as *const _,
transmute(notify_linked_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_linked_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -265,7 +265,7 @@ impl GLShader {
unsafe impl Send for GLShader {} unsafe impl Send for GLShader {}
unsafe impl Sync for GLShader {} unsafe impl Sync for GLShader {}
unsafe extern "C" fn notify_linked_trampoline(this: *mut ffi::GstGLShader, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_linked_trampoline<F: Fn(&GLShader) + Send + Sync + 'static>(this: *mut ffi::GstGLShader, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&GLShader) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -137,41 +137,41 @@ impl GLViewConvert {
pub fn connect_property_downmix_mode_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_downmix_mode_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&GLViewConvert) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::downmix-mode\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::downmix-mode\0".as_ptr() as *const _,
transmute(notify_downmix_mode_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_downmix_mode_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_input_flags_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_input_flags_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&GLViewConvert) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::input-flags-override\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::input-flags-override\0".as_ptr() as *const _,
transmute(notify_input_flags_override_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_input_flags_override_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_input_mode_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_input_mode_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&GLViewConvert) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::input-mode-override\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::input-mode-override\0".as_ptr() as *const _,
transmute(notify_input_mode_override_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_input_mode_override_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_output_flags_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_output_flags_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&GLViewConvert) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::output-flags-override\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::output-flags-override\0".as_ptr() as *const _,
transmute(notify_output_flags_override_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_output_flags_override_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_output_mode_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_output_mode_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&GLViewConvert) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::output-mode-override\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::output-mode-override\0".as_ptr() as *const _,
transmute(notify_output_mode_override_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_output_mode_override_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -185,27 +185,27 @@ impl Default for GLViewConvert {
unsafe impl Send for GLViewConvert {} unsafe impl Send for GLViewConvert {}
unsafe impl Sync for GLViewConvert {} unsafe impl Sync for GLViewConvert {}
unsafe extern "C" fn notify_downmix_mode_trampoline(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_downmix_mode_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&GLViewConvert) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_input_flags_override_trampoline(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_input_flags_override_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&GLViewConvert) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_input_mode_override_trampoline(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_input_mode_override_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&GLViewConvert) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_output_flags_override_trampoline(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_output_flags_override_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&GLViewConvert) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_output_mode_override_trampoline(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_output_mode_override_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut ffi::GstGLViewConvert, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&GLViewConvert) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -156,29 +156,29 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
fn connect_key_event<F: Fn(&Self, &str, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_key_event<F: Fn(&Self, &str, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &str, &str) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"key-event\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"key-event\0".as_ptr() as *const _,
transmute(key_event_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(key_event_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_mouse_event<F: Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_mouse_event<F: Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"mouse-event\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"mouse-event\0".as_ptr() as *const _,
transmute(mouse_event_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(mouse_event_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn key_event_trampoline<P>(this: *mut ffi::GstGLWindow, id: *mut libc::c_char, key: *mut libc::c_char, f: glib_ffi::gpointer) unsafe extern "C" fn key_event_trampoline<P, F: Fn(&P, &str, &str) + Send + Sync + 'static>(this: *mut ffi::GstGLWindow, id: *mut libc::c_char, key: *mut libc::c_char, f: glib_ffi::gpointer)
where P: IsA<GLWindow> { where P: IsA<GLWindow> {
let f: &&(Fn(&P, &str, &str) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&GLWindow::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(id), &GString::from_glib_borrow(key)) f(&GLWindow::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(id), &GString::from_glib_borrow(key))
} }
unsafe extern "C" fn mouse_event_trampoline<P>(this: *mut ffi::GstGLWindow, id: *mut libc::c_char, button: libc::c_int, x: libc::c_double, y: libc::c_double, f: glib_ffi::gpointer) unsafe extern "C" fn mouse_event_trampoline<P, F: Fn(&P, &str, i32, f64, f64) + Send + Sync + 'static>(this: *mut ffi::GstGLWindow, id: *mut libc::c_char, button: libc::c_int, x: libc::c_double, y: libc::c_double, f: glib_ffi::gpointer)
where P: IsA<GLWindow> { where P: IsA<GLWindow> {
let f: &&(Fn(&P, &str, i32, f64, f64) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&GLWindow::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(id), button, x, y) f(&GLWindow::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(id), button, x, y)
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -130,57 +130,57 @@ impl NetClientClock {
pub fn connect_property_address_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_address_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::address\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::address\0".as_ptr() as *const _,
transmute(notify_address_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_address_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_bus_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_bus_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::bus\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::bus\0".as_ptr() as *const _,
transmute(notify_bus_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_bus_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_internal_clock_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_internal_clock_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::internal-clock\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::internal-clock\0".as_ptr() as *const _,
transmute(notify_internal_clock_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_internal_clock_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_minimum_update_interval_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_minimum_update_interval_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::minimum-update-interval\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::minimum-update-interval\0".as_ptr() as *const _,
transmute(notify_minimum_update_interval_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_minimum_update_interval_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_port_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_port_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::port\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::port\0".as_ptr() as *const _,
transmute(notify_port_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_port_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_qos_dscp_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_qos_dscp_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::qos-dscp\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::qos-dscp\0".as_ptr() as *const _,
transmute(notify_qos_dscp_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_qos_dscp_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_round_trip_limit_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_round_trip_limit_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::round-trip-limit\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::round-trip-limit\0".as_ptr() as *const _,
transmute(notify_round_trip_limit_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_round_trip_limit_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -188,37 +188,37 @@ impl NetClientClock {
unsafe impl Send for NetClientClock {} unsafe impl Send for NetClientClock {}
unsafe impl Sync for NetClientClock {} unsafe impl Sync for NetClientClock {}
unsafe extern "C" fn notify_address_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_address_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_bus_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_bus_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_internal_clock_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_internal_clock_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_minimum_update_interval_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_minimum_update_interval_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_port_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_port_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_qos_dscp_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_qos_dscp_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_round_trip_limit_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_round_trip_limit_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -79,17 +79,17 @@ impl NetTimeProvider {
pub fn connect_property_active_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_active_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&NetTimeProvider) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::active\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::active\0".as_ptr() as *const _,
transmute(notify_active_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_active_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_qos_dscp_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_qos_dscp_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&NetTimeProvider) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::qos-dscp\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::qos-dscp\0".as_ptr() as *const _,
transmute(notify_qos_dscp_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_qos_dscp_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -97,12 +97,12 @@ impl NetTimeProvider {
unsafe impl Send for NetTimeProvider {} unsafe impl Send for NetTimeProvider {}
unsafe impl Sync for NetTimeProvider {} unsafe impl Sync for NetTimeProvider {}
unsafe extern "C" fn notify_active_trampoline(this: *mut ffi::GstNetTimeProvider, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_active_trampoline<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(this: *mut ffi::GstNetTimeProvider, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&NetTimeProvider) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_qos_dscp_trampoline(this: *mut ffi::GstNetTimeProvider, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_qos_dscp_trampoline<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(this: *mut ffi::GstNetTimeProvider, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&NetTimeProvider) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -58,25 +58,25 @@ impl PtpClock {
pub fn connect_property_grandmaster_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_grandmaster_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&PtpClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::grandmaster-clock-id\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::grandmaster-clock-id\0".as_ptr() as *const _,
transmute(notify_grandmaster_clock_id_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_grandmaster_clock_id_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_internal_clock_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_internal_clock_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&PtpClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::internal-clock\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::internal-clock\0".as_ptr() as *const _,
transmute(notify_internal_clock_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_internal_clock_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_master_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_master_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&PtpClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::master-clock-id\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::master-clock-id\0".as_ptr() as *const _,
transmute(notify_master_clock_id_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_master_clock_id_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -84,17 +84,17 @@ impl PtpClock {
unsafe impl Send for PtpClock {} unsafe impl Send for PtpClock {}
unsafe impl Sync for PtpClock {} unsafe impl Sync for PtpClock {}
unsafe extern "C" fn notify_grandmaster_clock_id_trampoline(this: *mut ffi::GstPtpClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_grandmaster_clock_id_trampoline<F: Fn(&PtpClock) + Send + Sync + 'static>(this: *mut ffi::GstPtpClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&PtpClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_internal_clock_trampoline(this: *mut ffi::GstPtpClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_internal_clock_trampoline<F: Fn(&PtpClock) + Send + Sync + 'static>(this: *mut ffi::GstPtpClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&PtpClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_master_clock_id_trampoline(this: *mut ffi::GstPtpClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_master_clock_id_trampoline<F: Fn(&PtpClock) + Send + Sync + 'static>(this: *mut ffi::GstPtpClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&PtpClock) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -63,33 +63,33 @@ impl Discoverer {
pub fn connect_discovered<F: Fn(&Discoverer, &DiscovererInfo, &Option<Error>) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_discovered<F: Fn(&Discoverer, &DiscovererInfo, &Option<Error>) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Discoverer, &DiscovererInfo, &Option<Error>) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"discovered\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"discovered\0".as_ptr() as *const _,
transmute(discovered_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(discovered_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_finished<F: Fn(&Discoverer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_finished<F: Fn(&Discoverer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Discoverer) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"finished\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"finished\0".as_ptr() as *const _,
transmute(finished_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(finished_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_source_setup<F: Fn(&Discoverer, &gst::Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_source_setup<F: Fn(&Discoverer, &gst::Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Discoverer, &gst::Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"source-setup\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"source-setup\0".as_ptr() as *const _,
transmute(source_setup_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(source_setup_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_starting<F: Fn(&Discoverer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_starting<F: Fn(&Discoverer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Discoverer) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"starting\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"starting\0".as_ptr() as *const _,
transmute(starting_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(starting_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -97,22 +97,22 @@ impl Discoverer {
unsafe impl Send for Discoverer {} unsafe impl Send for Discoverer {}
unsafe impl Sync for Discoverer {} unsafe impl Sync for Discoverer {}
unsafe extern "C" fn discovered_trampoline(this: *mut ffi::GstDiscoverer, info: *mut ffi::GstDiscovererInfo, error: *mut glib_ffi::GError, f: glib_ffi::gpointer) { unsafe extern "C" fn discovered_trampoline<F: Fn(&Discoverer, &DiscovererInfo, &Option<Error>) + Send + Sync + 'static>(this: *mut ffi::GstDiscoverer, info: *mut ffi::GstDiscovererInfo, error: *mut glib_ffi::GError, f: glib_ffi::gpointer) {
let f: &&(Fn(&Discoverer, &DiscovererInfo, &Option<Error>) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(info), &from_glib_borrow(error)) f(&from_glib_borrow(this), &from_glib_borrow(info), &from_glib_borrow(error))
} }
unsafe extern "C" fn finished_trampoline(this: *mut ffi::GstDiscoverer, f: glib_ffi::gpointer) { unsafe extern "C" fn finished_trampoline<F: Fn(&Discoverer) + Send + Sync + 'static>(this: *mut ffi::GstDiscoverer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Discoverer) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn source_setup_trampoline(this: *mut ffi::GstDiscoverer, source: *mut gst_ffi::GstElement, f: glib_ffi::gpointer) { unsafe extern "C" fn source_setup_trampoline<F: Fn(&Discoverer, &gst::Element) + Send + Sync + 'static>(this: *mut ffi::GstDiscoverer, source: *mut gst_ffi::GstElement, f: glib_ffi::gpointer) {
let f: &&(Fn(&Discoverer, &gst::Element) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(source)) f(&from_glib_borrow(this), &from_glib_borrow(source))
} }
unsafe extern "C" fn starting_trampoline(this: *mut ffi::GstDiscoverer, f: glib_ffi::gpointer) { unsafe extern "C" fn starting_trampoline<F: Fn(&Discoverer) + Send + Sync + 'static>(this: *mut ffi::GstDiscoverer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Discoverer) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -352,201 +352,201 @@ impl Player {
pub fn connect_buffering<F: Fn(&Player, i32) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_buffering<F: Fn(&Player, i32) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player, i32) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"buffering\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"buffering\0".as_ptr() as *const _,
transmute(buffering_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(buffering_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_end_of_stream<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_end_of_stream<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"end-of-stream\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"end-of-stream\0".as_ptr() as *const _,
transmute(end_of_stream_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(end_of_stream_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_error<F: Fn(&Player, &Error) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_error<F: Fn(&Player, &Error) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player, &Error) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"error\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"error\0".as_ptr() as *const _,
transmute(error_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(error_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_media_info_updated<F: Fn(&Player, &PlayerMediaInfo) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_media_info_updated<F: Fn(&Player, &PlayerMediaInfo) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player, &PlayerMediaInfo) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"media-info-updated\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"media-info-updated\0".as_ptr() as *const _,
transmute(media_info_updated_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(media_info_updated_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_mute_changed<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_mute_changed<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"mute-changed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"mute-changed\0".as_ptr() as *const _,
transmute(mute_changed_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(mute_changed_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_state_changed<F: Fn(&Player, PlayerState) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_state_changed<F: Fn(&Player, PlayerState) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player, PlayerState) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"state-changed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"state-changed\0".as_ptr() as *const _,
transmute(state_changed_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(state_changed_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_uri_loaded<F: Fn(&Player, &str) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_uri_loaded<F: Fn(&Player, &str) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player, &str) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"uri-loaded\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"uri-loaded\0".as_ptr() as *const _,
transmute(uri_loaded_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(uri_loaded_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_video_dimensions_changed<F: Fn(&Player, i32, i32) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_video_dimensions_changed<F: Fn(&Player, i32, i32) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player, i32, i32) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"video-dimensions-changed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"video-dimensions-changed\0".as_ptr() as *const _,
transmute(video_dimensions_changed_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(video_dimensions_changed_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_volume_changed<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_volume_changed<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"volume-changed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"volume-changed\0".as_ptr() as *const _,
transmute(volume_changed_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(volume_changed_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_warning<F: Fn(&Player, &Error) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_warning<F: Fn(&Player, &Error) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player, &Error) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"warning\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"warning\0".as_ptr() as *const _,
transmute(warning_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(warning_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_audio_video_offset_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_audio_video_offset_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::audio-video-offset\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::audio-video-offset\0".as_ptr() as *const _,
transmute(notify_audio_video_offset_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_audio_video_offset_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_current_audio_track_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_current_audio_track_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::current-audio-track\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::current-audio-track\0".as_ptr() as *const _,
transmute(notify_current_audio_track_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_current_audio_track_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_current_subtitle_track_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_current_subtitle_track_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::current-subtitle-track\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::current-subtitle-track\0".as_ptr() as *const _,
transmute(notify_current_subtitle_track_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_current_subtitle_track_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_current_video_track_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_current_video_track_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::current-video-track\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::current-video-track\0".as_ptr() as *const _,
transmute(notify_current_video_track_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_current_video_track_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_duration_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_duration_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
transmute(notify_duration_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_duration_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_media_info_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_media_info_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::media-info\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::media-info\0".as_ptr() as *const _,
transmute(notify_media_info_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_media_info_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_mute_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_mute_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _,
transmute(notify_mute_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_mute_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_pipeline_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_pipeline_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::pipeline\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::pipeline\0".as_ptr() as *const _,
transmute(notify_pipeline_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_pipeline_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_position_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_position_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::position\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::position\0".as_ptr() as *const _,
transmute(notify_position_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_position_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_rate_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_rate_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::rate\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::rate\0".as_ptr() as *const _,
transmute(notify_rate_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_rate_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_suburi_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_suburi_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::suburi\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::suburi\0".as_ptr() as *const _,
transmute(notify_suburi_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_suburi_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_uri_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_uri_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::uri\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::uri\0".as_ptr() as *const _,
transmute(notify_uri_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_uri_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_video_multiview_flags_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_video_multiview_flags_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::video-multiview-flags\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::video-multiview-flags\0".as_ptr() as *const _,
transmute(notify_video_multiview_flags_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_video_multiview_flags_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_video_multiview_mode_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_video_multiview_mode_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::video-multiview-mode\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::video-multiview-mode\0".as_ptr() as *const _,
transmute(notify_video_multiview_mode_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_video_multiview_mode_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_volume_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_volume_notify<F: Fn(&Player) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Player) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::volume\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::volume\0".as_ptr() as *const _,
transmute(notify_volume_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_volume_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -554,127 +554,127 @@ impl Player {
unsafe impl Send for Player {} unsafe impl Send for Player {}
unsafe impl Sync for Player {} unsafe impl Sync for Player {}
unsafe extern "C" fn buffering_trampoline(this: *mut ffi::GstPlayer, object: libc::c_int, f: glib_ffi::gpointer) { unsafe extern "C" fn buffering_trampoline<F: Fn(&Player, i32) + Send + 'static>(this: *mut ffi::GstPlayer, object: libc::c_int, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player, i32) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), object) f(&from_glib_borrow(this), object)
} }
unsafe extern "C" fn end_of_stream_trampoline(this: *mut ffi::GstPlayer, f: glib_ffi::gpointer) { unsafe extern "C" fn end_of_stream_trampoline<F: Fn(&Player) + Send + 'static>(this: *mut ffi::GstPlayer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn error_trampoline(this: *mut ffi::GstPlayer, object: *mut glib_ffi::GError, f: glib_ffi::gpointer) { unsafe extern "C" fn error_trampoline<F: Fn(&Player, &Error) + Send + 'static>(this: *mut ffi::GstPlayer, object: *mut glib_ffi::GError, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player, &Error) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(object)) f(&from_glib_borrow(this), &from_glib_borrow(object))
} }
unsafe extern "C" fn media_info_updated_trampoline(this: *mut ffi::GstPlayer, object: *mut ffi::GstPlayerMediaInfo, f: glib_ffi::gpointer) { unsafe extern "C" fn media_info_updated_trampoline<F: Fn(&Player, &PlayerMediaInfo) + Send + 'static>(this: *mut ffi::GstPlayer, object: *mut ffi::GstPlayerMediaInfo, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player, &PlayerMediaInfo) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(object)) f(&from_glib_borrow(this), &from_glib_borrow(object))
} }
unsafe extern "C" fn mute_changed_trampoline(this: *mut ffi::GstPlayer, f: glib_ffi::gpointer) { unsafe extern "C" fn mute_changed_trampoline<F: Fn(&Player) + Send + 'static>(this: *mut ffi::GstPlayer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn state_changed_trampoline(this: *mut ffi::GstPlayer, object: ffi::GstPlayerState, f: glib_ffi::gpointer) { unsafe extern "C" fn state_changed_trampoline<F: Fn(&Player, PlayerState) + Send + 'static>(this: *mut ffi::GstPlayer, object: ffi::GstPlayerState, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player, PlayerState) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), from_glib(object)) f(&from_glib_borrow(this), from_glib(object))
} }
unsafe extern "C" fn uri_loaded_trampoline(this: *mut ffi::GstPlayer, object: *mut libc::c_char, f: glib_ffi::gpointer) { unsafe extern "C" fn uri_loaded_trampoline<F: Fn(&Player, &str) + Send + 'static>(this: *mut ffi::GstPlayer, object: *mut libc::c_char, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player, &str) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &GString::from_glib_borrow(object)) f(&from_glib_borrow(this), &GString::from_glib_borrow(object))
} }
unsafe extern "C" fn video_dimensions_changed_trampoline(this: *mut ffi::GstPlayer, object: libc::c_int, p0: libc::c_int, f: glib_ffi::gpointer) { unsafe extern "C" fn video_dimensions_changed_trampoline<F: Fn(&Player, i32, i32) + Send + 'static>(this: *mut ffi::GstPlayer, object: libc::c_int, p0: libc::c_int, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player, i32, i32) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), object, p0) f(&from_glib_borrow(this), object, p0)
} }
unsafe extern "C" fn volume_changed_trampoline(this: *mut ffi::GstPlayer, f: glib_ffi::gpointer) { unsafe extern "C" fn volume_changed_trampoline<F: Fn(&Player) + Send + 'static>(this: *mut ffi::GstPlayer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn warning_trampoline(this: *mut ffi::GstPlayer, object: *mut glib_ffi::GError, f: glib_ffi::gpointer) { unsafe extern "C" fn warning_trampoline<F: Fn(&Player, &Error) + Send + 'static>(this: *mut ffi::GstPlayer, object: *mut glib_ffi::GError, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player, &Error) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(object)) f(&from_glib_borrow(this), &from_glib_borrow(object))
} }
unsafe extern "C" fn notify_audio_video_offset_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_audio_video_offset_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_current_audio_track_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_current_audio_track_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_current_subtitle_track_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_current_subtitle_track_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_current_video_track_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_current_video_track_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_duration_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_duration_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_media_info_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_media_info_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_mute_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_mute_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_pipeline_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_pipeline_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_position_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_position_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_rate_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_rate_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_suburi_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_suburi_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_uri_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_uri_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_video_multiview_flags_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_video_multiview_flags_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_video_multiview_mode_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_video_multiview_mode_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_volume_trampoline(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_volume_trampoline<F: Fn(&Player) + Send + Sync + 'static>(this: *mut ffi::GstPlayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Player) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -55,7 +55,7 @@ impl PlayerVideoOverlayVideoRenderer {
} }
} }
//pub fn set_window_handle<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, window_handle: P) { //pub fn set_window_handle(&self, window_handle: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_set_window_handle() } // unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_set_window_handle() }
//} //}
@ -73,27 +73,27 @@ impl PlayerVideoOverlayVideoRenderer {
} }
} }
//pub fn new<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(window_handle: P) -> Option<PlayerVideoRenderer> { //pub fn new(window_handle: /*Unimplemented*/Option<Fundamental: Pointer>) -> Option<PlayerVideoRenderer> {
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new() } // unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new() }
//} //}
//pub fn new_with_sink<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: IsA<gst::Element>>(window_handle: P, video_sink: &Q) -> Option<PlayerVideoRenderer> { //pub fn new_with_sink<P: IsA<gst::Element>>(window_handle: /*Unimplemented*/Option<Fundamental: Pointer>, video_sink: &P) -> Option<PlayerVideoRenderer> {
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new_with_sink() } // unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new_with_sink() }
//} //}
pub fn connect_property_video_sink_notify<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_video_sink_notify<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::video-sink\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::video-sink\0".as_ptr() as *const _,
transmute(notify_video_sink_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_video_sink_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_window_handle_notify<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_window_handle_notify<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::window-handle\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::window-handle\0".as_ptr() as *const _,
transmute(notify_window_handle_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_window_handle_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -101,12 +101,12 @@ impl PlayerVideoOverlayVideoRenderer {
unsafe impl Send for PlayerVideoOverlayVideoRenderer {} unsafe impl Send for PlayerVideoOverlayVideoRenderer {}
unsafe impl Sync for PlayerVideoOverlayVideoRenderer {} unsafe impl Sync for PlayerVideoOverlayVideoRenderer {}
unsafe extern "C" fn notify_video_sink_trampoline(this: *mut ffi::GstPlayerVideoOverlayVideoRenderer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_video_sink_trampoline<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(this: *mut ffi::GstPlayerVideoOverlayVideoRenderer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_window_handle_trampoline(this: *mut ffi::GstPlayerVideoOverlayVideoRenderer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_window_handle_trampoline<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(this: *mut ffi::GstPlayerVideoOverlayVideoRenderer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -181,15 +181,15 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
fn connect_accept_certificate<F: Fn(&Self, &gio::TlsConnection, &gio::TlsCertificate, gio::TlsCertificateFlags) -> bool + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_accept_certificate<F: Fn(&Self, &gio::TlsConnection, &gio::TlsCertificate, gio::TlsCertificateFlags) -> bool + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &gio::TlsConnection, &gio::TlsCertificate, gio::TlsCertificateFlags) -> bool + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"accept-certificate\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"accept-certificate\0".as_ptr() as *const _,
transmute(accept_certificate_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(accept_certificate_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn accept_certificate_trampoline<P>(this: *mut ffi::GstRTSPAuth, connection: *mut gio_ffi::GTlsConnection, peer_cert: *mut gio_ffi::GTlsCertificate, errors: gio_ffi::GTlsCertificateFlags, f: glib_ffi::gpointer) -> glib_ffi::gboolean unsafe extern "C" fn accept_certificate_trampoline<P, F: Fn(&P, &gio::TlsConnection, &gio::TlsCertificate, gio::TlsCertificateFlags) -> bool + Send + Sync + 'static>(this: *mut ffi::GstRTSPAuth, connection: *mut gio_ffi::GTlsConnection, peer_cert: *mut gio_ffi::GTlsCertificate, errors: gio_ffi::GTlsCertificateFlags, f: glib_ffi::gpointer) -> glib_ffi::gboolean
where P: IsA<RTSPAuth> { where P: IsA<RTSPAuth> {
let f: &&(Fn(&P, &gio::TlsConnection, &gio::TlsCertificate, gio::TlsCertificateFlags) -> bool + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPAuth::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(connection), &from_glib_borrow(peer_cert), from_glib(errors)).to_glib() f(&RTSPAuth::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(connection), &from_glib_borrow(peer_cert), from_glib(errors)).to_glib()
} }

View file

@ -70,7 +70,7 @@ pub trait RTSPClientExt: 'static {
//fn send_message<'a, P: IsA<RTSPSession> + 'a, Q: Into<Option<&'a P>>>(&self, session: Q, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult; //fn send_message<'a, P: IsA<RTSPSession> + 'a, Q: Into<Option<&'a P>>>(&self, session: Q, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult;
//fn session_filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPClientSessionFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPSession>; //fn session_filter(&self, func: /*Unimplemented*/Fn(&RTSPClient, &RTSPSession) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPSession>;
fn set_auth<'a, P: IsA<RTSPAuth> + 'a, Q: Into<Option<&'a P>>>(&self, auth: Q); fn set_auth<'a, P: IsA<RTSPAuth> + 'a, Q: Into<Option<&'a P>>>(&self, auth: Q);
@ -78,7 +78,7 @@ pub trait RTSPClientExt: 'static {
fn set_mount_points<'a, P: IsA<RTSPMountPoints> + 'a, Q: Into<Option<&'a P>>>(&self, mounts: Q); fn set_mount_points<'a, P: IsA<RTSPMountPoints> + 'a, Q: Into<Option<&'a P>>>(&self, mounts: Q);
//fn set_send_func<'a, P: Into<Option<&'a /*Ignored*/glib::DestroyNotify>>>(&self, func: /*Unknown conversion*//*Unimplemented*/RTSPClientSendFunc, notify: P); //fn set_send_func(&self, func: /*Unimplemented*/Fn(&RTSPClient, /*Ignored*/gst_rtsp::RTSPMessage, bool) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>);
fn set_session_pool<'a, P: IsA<RTSPSessionPool> + 'a, Q: Into<Option<&'a P>>>(&self, pool: Q); fn set_session_pool<'a, P: IsA<RTSPSessionPool> + 'a, Q: Into<Option<&'a P>>>(&self, pool: Q);
@ -198,7 +198,7 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
// unsafe { TODO: call ffi::gst_rtsp_client_send_message() } // unsafe { TODO: call ffi::gst_rtsp_client_send_message() }
//} //}
//fn session_filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPClientSessionFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPSession> { //fn session_filter(&self, func: /*Unimplemented*/Fn(&RTSPClient, &RTSPSession) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPSession> {
// unsafe { TODO: call ffi::gst_rtsp_client_session_filter() } // unsafe { TODO: call ffi::gst_rtsp_client_session_filter() }
//} //}
@ -220,7 +220,7 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
} }
} }
//fn set_send_func<'a, P: Into<Option<&'a /*Ignored*/glib::DestroyNotify>>>(&self, func: /*Unknown conversion*//*Unimplemented*/RTSPClientSendFunc, notify: P) { //fn set_send_func(&self, func: /*Unimplemented*/Fn(&RTSPClient, /*Ignored*/gst_rtsp::RTSPMessage, bool) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call ffi::gst_rtsp_client_set_send_func() } // unsafe { TODO: call ffi::gst_rtsp_client_set_send_func() }
//} //}
@ -254,9 +254,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn connect_announce_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_announce_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"announce-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"announce-request\0".as_ptr() as *const _,
transmute(announce_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(announce_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
@ -266,163 +266,163 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn connect_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"closed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"closed\0".as_ptr() as *const _,
transmute(closed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(closed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_describe_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_describe_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"describe-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"describe-request\0".as_ptr() as *const _,
transmute(describe_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(describe_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_get_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_get_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"get-parameter-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"get-parameter-request\0".as_ptr() as *const _,
transmute(get_parameter_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(get_parameter_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_handle_response<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_handle_response<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"handle-response\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"handle-response\0".as_ptr() as *const _,
transmute(handle_response_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(handle_response_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_new_session<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_new_session<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPSession) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"new-session\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"new-session\0".as_ptr() as *const _,
transmute(new_session_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(new_session_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_options_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_options_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"options-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"options-request\0".as_ptr() as *const _,
transmute(options_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(options_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_pause_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pause_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pause-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pause-request\0".as_ptr() as *const _,
transmute(pause_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pause_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_play_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_play_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"play-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"play-request\0".as_ptr() as *const _,
transmute(play_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(play_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_announce_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_announce_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-announce-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-announce-request\0".as_ptr() as *const _,
transmute(pre_announce_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_announce_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_describe_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_describe_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-describe-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-describe-request\0".as_ptr() as *const _,
transmute(pre_describe_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_describe_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_get_parameter_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_get_parameter_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-get-parameter-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-get-parameter-request\0".as_ptr() as *const _,
transmute(pre_get_parameter_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_get_parameter_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_options_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_options_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-options-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-options-request\0".as_ptr() as *const _,
transmute(pre_options_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_options_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_pause_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_pause_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-pause-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-pause-request\0".as_ptr() as *const _,
transmute(pre_pause_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_pause_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_play_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_play_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-play-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-play-request\0".as_ptr() as *const _,
transmute(pre_play_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_play_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_record_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_record_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-record-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-record-request\0".as_ptr() as *const _,
transmute(pre_record_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_record_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_set_parameter_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_set_parameter_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-set-parameter-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-set-parameter-request\0".as_ptr() as *const _,
transmute(pre_set_parameter_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_set_parameter_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_setup_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_setup_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-setup-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-setup-request\0".as_ptr() as *const _,
transmute(pre_setup_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_setup_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_teardown_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pre_teardown_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pre-teardown-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pre-teardown-request\0".as_ptr() as *const _,
transmute(pre_teardown_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pre_teardown_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_record_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_record_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"record-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"record-request\0".as_ptr() as *const _,
transmute(record_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(record_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
@ -432,215 +432,215 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn connect_set_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_set_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"set-parameter-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"set-parameter-request\0".as_ptr() as *const _,
transmute(set_parameter_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(set_parameter_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_setup_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_setup_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"setup-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"setup-request\0".as_ptr() as *const _,
transmute(setup_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(setup_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_teardown_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_teardown_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"teardown-request\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"teardown-request\0".as_ptr() as *const _,
transmute(teardown_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(teardown_request_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_drop_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_drop_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::drop-backlog\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::drop-backlog\0".as_ptr() as *const _,
transmute(notify_drop_backlog_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_drop_backlog_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mount-points\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::mount-points\0".as_ptr() as *const _,
transmute(notify_mount_points_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_mount_points_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::session-pool\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::session-pool\0".as_ptr() as *const _,
transmute(notify_session_pool_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_session_pool_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn announce_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn announce_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn closed_trampoline<P>(this: *mut ffi::GstRTSPClient, f: glib_ffi::gpointer) unsafe extern "C" fn closed_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast()) f(&RTSPClient::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn describe_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn describe_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn get_parameter_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn get_parameter_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn handle_response_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn handle_response_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn new_session_trampoline<P>(this: *mut ffi::GstRTSPClient, object: *mut ffi::GstRTSPSession, f: glib_ffi::gpointer) unsafe extern "C" fn new_session_trampoline<P, F: Fn(&P, &RTSPSession) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, object: *mut ffi::GstRTSPSession, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPSession) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
} }
unsafe extern "C" fn options_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn options_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn pause_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn pause_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn play_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn play_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_announce_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_announce_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_describe_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_describe_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_get_parameter_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_get_parameter_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_options_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_options_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_pause_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_pause_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_play_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_play_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_record_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_record_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_set_parameter_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_set_parameter_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_setup_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_setup_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_teardown_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode unsafe extern "C" fn pre_teardown_request_trampoline<P, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib() f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)).to_glib()
} }
unsafe extern "C" fn record_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn record_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn set_parameter_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn set_parameter_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn setup_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn setup_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn teardown_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) unsafe extern "C" fn teardown_request_trampoline<P, F: Fn(&P, &RTSPContext) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx)) f(&RTSPClient::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(ctx))
} }
unsafe extern "C" fn notify_drop_backlog_trampoline<P>(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_drop_backlog_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast()) f(&RTSPClient::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_mount_points_trampoline<P>(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_mount_points_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast()) f(&RTSPClient::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_session_pool_trampoline<P>(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_session_pool_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> { where P: IsA<RTSPClient> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPClient::from_glib_borrow(this).unsafe_cast()) f(&RTSPClient::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -107,7 +107,7 @@ pub trait RTSPMediaExt: 'static {
fn n_streams(&self) -> u32; fn n_streams(&self) -> u32;
//fn prepare<'a, P: Into<Option<&'a /*Ignored*/RTSPThread>>>(&self, thread: P) -> bool; //fn prepare(&self, thread: /*Ignored*/Option<&mut RTSPThread>) -> bool;
//fn seek(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange) -> bool; //fn seek(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange) -> bool;
@ -127,7 +127,7 @@ pub trait RTSPMediaExt: 'static {
fn set_multicast_iface<'a, P: Into<Option<&'a str>>>(&self, multicast_iface: P); fn set_multicast_iface<'a, P: Into<Option<&'a str>>>(&self, multicast_iface: P);
//fn set_permissions<'a, P: Into<Option<&'a /*Ignored*/RTSPPermissions>>>(&self, permissions: P); //fn set_permissions(&self, permissions: /*Ignored*/Option<&mut RTSPPermissions>);
fn set_pipeline_state(&self, state: gst::State); fn set_pipeline_state(&self, state: gst::State);
@ -377,7 +377,7 @@ impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {
} }
} }
//fn prepare<'a, P: Into<Option<&'a /*Ignored*/RTSPThread>>>(&self, thread: P) -> bool { //fn prepare(&self, thread: /*Ignored*/Option<&mut RTSPThread>) -> bool {
// unsafe { TODO: call ffi::gst_rtsp_media_prepare() } // unsafe { TODO: call ffi::gst_rtsp_media_prepare() }
//} //}
@ -432,7 +432,7 @@ impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {
} }
} }
//fn set_permissions<'a, P: Into<Option<&'a /*Ignored*/RTSPPermissions>>>(&self, permissions: P) { //fn set_permissions(&self, permissions: /*Ignored*/Option<&mut RTSPPermissions>) {
// unsafe { TODO: call ffi::gst_rtsp_media_set_permissions() } // unsafe { TODO: call ffi::gst_rtsp_media_set_permissions() }
//} //}
@ -574,253 +574,253 @@ impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {
fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, i32) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"new-state\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"new-state\0".as_ptr() as *const _,
transmute(new_state_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(new_state_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_new_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_new_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPStream) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"new-stream\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"new-stream\0".as_ptr() as *const _,
transmute(new_stream_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(new_stream_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"prepared\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"prepared\0".as_ptr() as *const _,
transmute(prepared_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(prepared_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPStream) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"removed-stream\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"removed-stream\0".as_ptr() as *const _,
transmute(removed_stream_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(removed_stream_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, i32) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"target-state\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"target-state\0".as_ptr() as *const _,
transmute(target_state_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(target_state_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"unprepared\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"unprepared\0".as_ptr() as *const _,
transmute(unprepared_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(unprepared_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::buffer-size\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::buffer-size\0".as_ptr() as *const _,
transmute(notify_buffer_size_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_buffer_size_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::clock\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::clock\0".as_ptr() as *const _,
transmute(notify_clock_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_clock_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::eos-shutdown\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::eos-shutdown\0".as_ptr() as *const _,
transmute(notify_eos_shutdown_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_eos_shutdown_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _,
transmute(notify_latency_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_latency_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::profiles\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::profiles\0".as_ptr() as *const _,
transmute(notify_profiles_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_profiles_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::protocols\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::protocols\0".as_ptr() as *const _,
transmute(notify_protocols_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_protocols_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::reusable\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::reusable\0".as_ptr() as *const _,
transmute(notify_reusable_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_reusable_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::shared\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::shared\0".as_ptr() as *const _,
transmute(notify_shared_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_shared_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::stop-on-disconnect\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::stop-on-disconnect\0".as_ptr() as *const _,
transmute(notify_stop_on_disconnect_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_stop_on_disconnect_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::suspend-mode\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::suspend-mode\0".as_ptr() as *const _,
transmute(notify_suspend_mode_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_suspend_mode_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::time-provider\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::time-provider\0".as_ptr() as *const _,
transmute(notify_time_provider_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_time_provider_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::transport-mode\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::transport-mode\0".as_ptr() as *const _,
transmute(notify_transport_mode_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_transport_mode_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn new_state_trampoline<P>(this: *mut ffi::GstRTSPMedia, object: libc::c_int, f: glib_ffi::gpointer) unsafe extern "C" fn new_state_trampoline<P, F: Fn(&P, i32) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, object: libc::c_int, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P, i32) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast(), object) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast(), object)
} }
unsafe extern "C" fn new_stream_trampoline<P>(this: *mut ffi::GstRTSPMedia, object: *mut ffi::GstRTSPStream, f: glib_ffi::gpointer) unsafe extern "C" fn new_stream_trampoline<P, F: Fn(&P, &RTSPStream) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, object: *mut ffi::GstRTSPStream, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P, &RTSPStream) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object)) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
} }
unsafe extern "C" fn prepared_trampoline<P>(this: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer) unsafe extern "C" fn prepared_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn removed_stream_trampoline<P>(this: *mut ffi::GstRTSPMedia, object: *mut ffi::GstRTSPStream, f: glib_ffi::gpointer) unsafe extern "C" fn removed_stream_trampoline<P, F: Fn(&P, &RTSPStream) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, object: *mut ffi::GstRTSPStream, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P, &RTSPStream) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object)) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
} }
unsafe extern "C" fn target_state_trampoline<P>(this: *mut ffi::GstRTSPMedia, object: libc::c_int, f: glib_ffi::gpointer) unsafe extern "C" fn target_state_trampoline<P, F: Fn(&P, i32) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, object: libc::c_int, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P, i32) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast(), object) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast(), object)
} }
unsafe extern "C" fn unprepared_trampoline<P>(this: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer) unsafe extern "C" fn unprepared_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_buffer_size_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_buffer_size_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_clock_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_clock_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_eos_shutdown_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_eos_shutdown_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_latency_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_profiles_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_profiles_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_protocols_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_protocols_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_reusable_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_reusable_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_shared_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_shared_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_stop_on_disconnect_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_stop_on_disconnect_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_suspend_mode_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_suspend_mode_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_time_provider_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_time_provider_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_transport_mode_trampoline<P>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_transport_mode_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMedia> { where P: IsA<RTSPMedia> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMedia::from_glib_borrow(this).unsafe_cast()) f(&RTSPMedia::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -109,7 +109,7 @@ pub trait RTSPMediaFactoryExt: 'static {
fn set_multicast_iface<'a, P: Into<Option<&'a str>>>(&self, multicast_iface: P); fn set_multicast_iface<'a, P: Into<Option<&'a str>>>(&self, multicast_iface: P);
//fn set_permissions<'a, P: Into<Option<&'a /*Ignored*/RTSPPermissions>>>(&self, permissions: P); //fn set_permissions(&self, permissions: /*Ignored*/Option<&mut RTSPPermissions>);
fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile); fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile);
@ -328,7 +328,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
} }
} }
//fn set_permissions<'a, P: Into<Option<&'a /*Ignored*/RTSPPermissions>>>(&self, permissions: P) { //fn set_permissions(&self, permissions: /*Ignored*/Option<&mut RTSPPermissions>) {
// unsafe { TODO: call ffi::gst_rtsp_media_factory_set_permissions() } // unsafe { TODO: call ffi::gst_rtsp_media_factory_set_permissions() }
//} //}
@ -406,183 +406,183 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn connect_media_configure<F: Fn(&Self, &RTSPMedia) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_media_configure<F: Fn(&Self, &RTSPMedia) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPMedia) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"media-configure\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"media-configure\0".as_ptr() as *const _,
transmute(media_configure_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(media_configure_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_media_constructed<F: Fn(&Self, &RTSPMedia) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_media_constructed<F: Fn(&Self, &RTSPMedia) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPMedia) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"media-constructed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"media-constructed\0".as_ptr() as *const _,
transmute(media_constructed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(media_constructed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::buffer-size\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::buffer-size\0".as_ptr() as *const _,
transmute(notify_buffer_size_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_buffer_size_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::clock\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::clock\0".as_ptr() as *const _,
transmute(notify_clock_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_clock_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::eos-shutdown\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::eos-shutdown\0".as_ptr() as *const _,
transmute(notify_eos_shutdown_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_eos_shutdown_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _,
transmute(notify_latency_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_latency_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_launch_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_launch_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::launch\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::launch\0".as_ptr() as *const _,
transmute(notify_launch_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_launch_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::profiles\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::profiles\0".as_ptr() as *const _,
transmute(notify_profiles_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_profiles_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::protocols\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::protocols\0".as_ptr() as *const _,
transmute(notify_protocols_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_protocols_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::shared\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::shared\0".as_ptr() as *const _,
transmute(notify_shared_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_shared_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::stop-on-disconnect\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::stop-on-disconnect\0".as_ptr() as *const _,
transmute(notify_stop_on_disconnect_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_stop_on_disconnect_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::suspend-mode\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::suspend-mode\0".as_ptr() as *const _,
transmute(notify_suspend_mode_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_suspend_mode_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::transport-mode\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::transport-mode\0".as_ptr() as *const _,
transmute(notify_transport_mode_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_transport_mode_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn media_configure_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, object: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer) unsafe extern "C" fn media_configure_trampoline<P, F: Fn(&P, &RTSPMedia) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, object: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P, &RTSPMedia) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object)) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
} }
unsafe extern "C" fn media_constructed_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, object: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer) unsafe extern "C" fn media_constructed_trampoline<P, F: Fn(&P, &RTSPMedia) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, object: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P, &RTSPMedia) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object)) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
} }
unsafe extern "C" fn notify_buffer_size_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_buffer_size_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_clock_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_clock_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_eos_shutdown_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_eos_shutdown_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_latency_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_launch_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_launch_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_profiles_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_profiles_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_protocols_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_protocols_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_shared_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_shared_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_stop_on_disconnect_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_stop_on_disconnect_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_suspend_mode_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_suspend_mode_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_transport_mode_trampoline<P>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_transport_mode_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactory> { where P: IsA<RTSPMediaFactory> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactory::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -88,29 +88,29 @@ impl<O: IsA<RTSPMediaFactoryURI>> RTSPMediaFactoryURIExt for O {
fn connect_property_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::uri\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::uri\0".as_ptr() as *const _,
transmute(notify_uri_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_uri_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_use_gstpay_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_use_gstpay_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::use-gstpay\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::use-gstpay\0".as_ptr() as *const _,
transmute(notify_use_gstpay_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_use_gstpay_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_uri_trampoline<P>(this: *mut ffi::GstRTSPMediaFactoryURI, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_uri_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactoryURI, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactoryURI> { where P: IsA<RTSPMediaFactoryURI> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactoryURI::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactoryURI::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_use_gstpay_trampoline<P>(this: *mut ffi::GstRTSPMediaFactoryURI, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_use_gstpay_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPMediaFactoryURI, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPMediaFactoryURI> { where P: IsA<RTSPMediaFactoryURI> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPMediaFactoryURI::from_glib_borrow(this).unsafe_cast()) f(&RTSPMediaFactoryURI::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -58,7 +58,7 @@ unsafe impl Sync for RTSPServer {}
pub const NONE_RTSP_SERVER: Option<&RTSPServer> = None; pub const NONE_RTSP_SERVER: Option<&RTSPServer> = None;
pub trait RTSPServerExt: 'static { pub trait RTSPServerExt: 'static {
//fn client_filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPServerClientFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPClient>; //fn client_filter(&self, func: /*Unimplemented*/Fn(&RTSPServer, &RTSPClient) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPClient>;
fn create_socket<'a, P: IsA<gio::Cancellable> + 'a, Q: Into<Option<&'a P>>>(&self, cancellable: Q) -> Result<gio::Socket, Error>; fn create_socket<'a, P: IsA<gio::Cancellable> + 'a, Q: Into<Option<&'a P>>>(&self, cancellable: Q) -> Result<gio::Socket, Error>;
@ -112,7 +112,7 @@ pub trait RTSPServerExt: 'static {
} }
impl<O: IsA<RTSPServer>> RTSPServerExt for O { impl<O: IsA<RTSPServer>> RTSPServerExt for O {
//fn client_filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPServerClientFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPClient> { //fn client_filter(&self, func: /*Unimplemented*/Fn(&RTSPServer, &RTSPClient) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPClient> {
// unsafe { TODO: call ffi::gst_rtsp_server_client_filter() } // unsafe { TODO: call ffi::gst_rtsp_server_client_filter() }
//} //}
@ -237,99 +237,99 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn connect_client_connected<F: Fn(&Self, &RTSPClient) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_client_connected<F: Fn(&Self, &RTSPClient) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPClient) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"client-connected\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"client-connected\0".as_ptr() as *const _,
transmute(client_connected_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(client_connected_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_address_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_address_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::address\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::address\0".as_ptr() as *const _,
transmute(notify_address_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_address_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::backlog\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::backlog\0".as_ptr() as *const _,
transmute(notify_backlog_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_backlog_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_bound_port_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_bound_port_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::bound-port\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::bound-port\0".as_ptr() as *const _,
transmute(notify_bound_port_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_bound_port_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mount-points\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::mount-points\0".as_ptr() as *const _,
transmute(notify_mount_points_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_mount_points_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_service_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_service_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::service\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::service\0".as_ptr() as *const _,
transmute(notify_service_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_service_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::session-pool\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::session-pool\0".as_ptr() as *const _,
transmute(notify_session_pool_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_session_pool_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn client_connected_trampoline<P>(this: *mut ffi::GstRTSPServer, object: *mut ffi::GstRTSPClient, f: glib_ffi::gpointer) unsafe extern "C" fn client_connected_trampoline<P, F: Fn(&P, &RTSPClient) + Send + Sync + 'static>(this: *mut ffi::GstRTSPServer, object: *mut ffi::GstRTSPClient, f: glib_ffi::gpointer)
where P: IsA<RTSPServer> { where P: IsA<RTSPServer> {
let f: &&(Fn(&P, &RTSPClient) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPServer::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object)) f(&RTSPServer::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
} }
unsafe extern "C" fn notify_address_trampoline<P>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_address_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPServer> { where P: IsA<RTSPServer> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPServer::from_glib_borrow(this).unsafe_cast()) f(&RTSPServer::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_backlog_trampoline<P>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_backlog_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPServer> { where P: IsA<RTSPServer> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPServer::from_glib_borrow(this).unsafe_cast()) f(&RTSPServer::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_bound_port_trampoline<P>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_bound_port_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPServer> { where P: IsA<RTSPServer> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPServer::from_glib_borrow(this).unsafe_cast()) f(&RTSPServer::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_mount_points_trampoline<P>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_mount_points_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPServer> { where P: IsA<RTSPServer> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPServer::from_glib_borrow(this).unsafe_cast()) f(&RTSPServer::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_service_trampoline<P>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_service_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPServer> { where P: IsA<RTSPServer> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPServer::from_glib_borrow(this).unsafe_cast()) f(&RTSPServer::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_session_pool_trampoline<P>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_session_pool_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPServer> { where P: IsA<RTSPServer> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPServer::from_glib_borrow(this).unsafe_cast()) f(&RTSPServer::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -44,7 +44,7 @@ pub const NONE_RTSP_SESSION: Option<&RTSPSession> = None;
pub trait RTSPSessionExt: 'static { pub trait RTSPSessionExt: 'static {
fn allow_expire(&self); fn allow_expire(&self);
//fn filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPSessionFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPSessionMedia>; //fn filter(&self, func: /*Unimplemented*/Fn(&RTSPSession, &RTSPSessionMedia) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPSessionMedia>;
fn get_header(&self) -> Option<GString>; fn get_header(&self) -> Option<GString>;
@ -88,7 +88,7 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
} }
} }
//fn filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPSessionFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPSessionMedia> { //fn filter(&self, func: /*Unimplemented*/Fn(&RTSPSession, &RTSPSessionMedia) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPSessionMedia> {
// unsafe { TODO: call ffi::gst_rtsp_session_filter() } // unsafe { TODO: call ffi::gst_rtsp_session_filter() }
//} //}
@ -184,29 +184,29 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
fn connect_property_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::timeout\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::timeout\0".as_ptr() as *const _,
transmute(notify_timeout_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_timeout_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_timeout_always_visible_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_timeout_always_visible_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::timeout-always-visible\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::timeout-always-visible\0".as_ptr() as *const _,
transmute(notify_timeout_always_visible_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_timeout_always_visible_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_timeout_trampoline<P>(this: *mut ffi::GstRTSPSession, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_timeout_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPSession, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPSession> { where P: IsA<RTSPSession> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPSession::from_glib_borrow(this).unsafe_cast()) f(&RTSPSession::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_timeout_always_visible_trampoline<P>(this: *mut ffi::GstRTSPSession, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_timeout_always_visible_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPSession, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPSession> { where P: IsA<RTSPSession> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPSession::from_glib_borrow(this).unsafe_cast()) f(&RTSPSession::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -47,7 +47,7 @@ pub trait RTSPSessionPoolExt: 'static {
fn create(&self) -> Option<RTSPSession>; fn create(&self) -> Option<RTSPSession>;
//fn filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPSessionPoolFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPSession>; //fn filter(&self, func: /*Unimplemented*/Fn(&RTSPSessionPool, &RTSPSession) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPSession>;
fn find(&self, sessionid: &str) -> Option<RTSPSession>; fn find(&self, sessionid: &str) -> Option<RTSPSession>;
@ -77,7 +77,7 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
} }
} }
//fn filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPSessionPoolFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPSession> { //fn filter(&self, func: /*Unimplemented*/Fn(&RTSPSessionPool, &RTSPSession) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPSession> {
// unsafe { TODO: call ffi::gst_rtsp_session_pool_filter() } // unsafe { TODO: call ffi::gst_rtsp_session_pool_filter() }
//} //}
@ -113,29 +113,29 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
fn connect_session_removed<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_session_removed<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPSession) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"session-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"session-removed\0".as_ptr() as *const _,
transmute(session_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(session_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-sessions\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::max-sessions\0".as_ptr() as *const _,
transmute(notify_max_sessions_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_max_sessions_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn session_removed_trampoline<P>(this: *mut ffi::GstRTSPSessionPool, object: *mut ffi::GstRTSPSession, f: glib_ffi::gpointer) unsafe extern "C" fn session_removed_trampoline<P, F: Fn(&P, &RTSPSession) + Send + Sync + 'static>(this: *mut ffi::GstRTSPSessionPool, object: *mut ffi::GstRTSPSession, f: glib_ffi::gpointer)
where P: IsA<RTSPSessionPool> { where P: IsA<RTSPSessionPool> {
let f: &&(Fn(&P, &RTSPSession) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPSessionPool::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object)) f(&RTSPSessionPool::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
} }
unsafe extern "C" fn notify_max_sessions_trampoline<P>(this: *mut ffi::GstRTSPSessionPool, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_max_sessions_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPSessionPool, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPSessionPool> { where P: IsA<RTSPSessionPool> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPSessionPool::from_glib_borrow(this).unsafe_cast()) f(&RTSPSessionPool::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -164,7 +164,7 @@ pub trait RTSPStreamExt: 'static {
fn set_seqnum_offset(&self, seqnum: u16); fn set_seqnum_offset(&self, seqnum: u16);
//fn transport_filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPStreamTransportFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPStreamTransport>; //fn transport_filter(&self, func: /*Unimplemented*/Fn(&RTSPStream, &RTSPStreamTransport) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPStreamTransport>;
fn unblock_linked(&self) -> bool; fn unblock_linked(&self) -> bool;
@ -539,7 +539,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
} }
} }
//fn transport_filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPStreamTransportFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPStreamTransport> { //fn transport_filter(&self, func: /*Unimplemented*/Fn(&RTSPStream, &RTSPStreamTransport) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPStreamTransport> {
// unsafe { TODO: call ffi::gst_rtsp_stream_transport_filter() } // unsafe { TODO: call ffi::gst_rtsp_stream_transport_filter() }
//} //}
@ -558,71 +558,71 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn connect_new_rtcp_encoder<F: Fn(&Self, &gst::Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_new_rtcp_encoder<F: Fn(&Self, &gst::Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &gst::Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"new-rtcp-encoder\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"new-rtcp-encoder\0".as_ptr() as *const _,
transmute(new_rtcp_encoder_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(new_rtcp_encoder_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_new_rtp_encoder<F: Fn(&Self, &gst::Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_new_rtp_encoder<F: Fn(&Self, &gst::Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &gst::Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"new-rtp-encoder\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"new-rtp-encoder\0".as_ptr() as *const _,
transmute(new_rtp_encoder_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(new_rtp_encoder_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_control_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_control_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::control\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::control\0".as_ptr() as *const _,
transmute(notify_control_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_control_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::profiles\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::profiles\0".as_ptr() as *const _,
transmute(notify_profiles_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_profiles_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::protocols\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::protocols\0".as_ptr() as *const _,
transmute(notify_protocols_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_protocols_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn new_rtcp_encoder_trampoline<P>(this: *mut ffi::GstRTSPStream, object: *mut gst_ffi::GstElement, f: glib_ffi::gpointer) unsafe extern "C" fn new_rtcp_encoder_trampoline<P, F: Fn(&P, &gst::Element) + Send + Sync + 'static>(this: *mut ffi::GstRTSPStream, object: *mut gst_ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<RTSPStream> { where P: IsA<RTSPStream> {
let f: &&(Fn(&P, &gst::Element) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPStream::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object)) f(&RTSPStream::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
} }
unsafe extern "C" fn new_rtp_encoder_trampoline<P>(this: *mut ffi::GstRTSPStream, object: *mut gst_ffi::GstElement, f: glib_ffi::gpointer) unsafe extern "C" fn new_rtp_encoder_trampoline<P, F: Fn(&P, &gst::Element) + Send + Sync + 'static>(this: *mut ffi::GstRTSPStream, object: *mut gst_ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<RTSPStream> { where P: IsA<RTSPStream> {
let f: &&(Fn(&P, &gst::Element) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPStream::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object)) f(&RTSPStream::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
} }
unsafe extern "C" fn notify_control_trampoline<P>(this: *mut ffi::GstRTSPStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_control_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPStream> { where P: IsA<RTSPStream> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPStream::from_glib_borrow(this).unsafe_cast()) f(&RTSPStream::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_profiles_trampoline<P>(this: *mut ffi::GstRTSPStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_profiles_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPStream> { where P: IsA<RTSPStream> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPStream::from_glib_borrow(this).unsafe_cast()) f(&RTSPStream::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_protocols_trampoline<P>(this: *mut ffi::GstRTSPStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_protocols_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPStream> { where P: IsA<RTSPStream> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPStream::from_glib_borrow(this).unsafe_cast()) f(&RTSPStream::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -10,6 +10,7 @@ use glib::object::IsA;
use glib::translate::*; use glib::translate::*;
use gst; use gst;
use gst_rtsp; use gst_rtsp;
use std::boxed::Box as Box_;
glib_wrapper! { glib_wrapper! {
pub struct RTSPStreamTransport(Object<ffi::GstRTSPStreamTransport, ffi::GstRTSPStreamTransportClass, RTSPStreamTransportClass>); pub struct RTSPStreamTransport(Object<ffi::GstRTSPStreamTransport, ffi::GstRTSPStreamTransportClass, RTSPStreamTransportClass>);
@ -46,9 +47,9 @@ pub trait RTSPStreamTransportExt: 'static {
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError>; fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError>;
//fn set_callbacks<'a, P: Into<Option<&'a /*Ignored*/glib::DestroyNotify>>>(&self, send_rtp: /*Unknown conversion*//*Unimplemented*/RTSPSendFunc, send_rtcp: /*Unknown conversion*//*Unimplemented*/RTSPSendFunc, notify: P); //fn set_callbacks<P: Fn(&gst::Buffer, u8) -> bool + 'static, Q: Fn(&gst::Buffer, u8) -> bool + 'static>(&self, send_rtp: P, send_rtcp: Q);
//fn set_keepalive<'a, P: Into<Option<&'a /*Ignored*/glib::DestroyNotify>>>(&self, keep_alive: /*Unknown conversion*//*Unimplemented*/RTSPKeepAliveFunc, notify: P); fn set_keepalive<P: Fn() + 'static>(&self, keep_alive: P);
fn set_timed_out(&self, timedout: bool); fn set_timed_out(&self, timedout: bool);
@ -110,13 +111,26 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
} }
} }
//fn set_callbacks<'a, P: Into<Option<&'a /*Ignored*/glib::DestroyNotify>>>(&self, send_rtp: /*Unknown conversion*//*Unimplemented*/RTSPSendFunc, send_rtcp: /*Unknown conversion*//*Unimplemented*/RTSPSendFunc, notify: P) { //fn set_callbacks<P: Fn(&gst::Buffer, u8) -> bool + 'static, Q: Fn(&gst::Buffer, u8) -> bool + 'static>(&self, send_rtp: P, send_rtcp: Q) {
// unsafe { TODO: call ffi::gst_rtsp_stream_transport_set_callbacks() } // unsafe { TODO: call ffi::gst_rtsp_stream_transport_set_callbacks() }
//} //}
//fn set_keepalive<'a, P: Into<Option<&'a /*Ignored*/glib::DestroyNotify>>>(&self, keep_alive: /*Unknown conversion*//*Unimplemented*/RTSPKeepAliveFunc, notify: P) { fn set_keepalive<P: Fn() + 'static>(&self, keep_alive: P) {
// unsafe { TODO: call ffi::gst_rtsp_stream_transport_set_keepalive() } let keep_alive_data: Box_<P> = Box::new(keep_alive);
//} unsafe extern "C" fn keep_alive_func<P: Fn() + 'static>(user_data: glib_ffi::gpointer) {
let callback: &P = &*(user_data as *mut _);
(*callback)();
}
let keep_alive = Some(keep_alive_func::<P> as _);
unsafe extern "C" fn notify_func<P: Fn() + 'static>(data: glib_ffi::gpointer) {
let _callback: Box_<P> = Box_::from_raw(data as *mut _);
}
let destroy_call3 = Some(notify_func::<P> as _);
let super_callback0: Box_<P> = keep_alive_data;
unsafe {
ffi::gst_rtsp_stream_transport_set_keepalive(self.as_ref().to_glib_none().0, keep_alive, Box::into_raw(super_callback0) as *mut _, destroy_call3);
}
}
fn set_timed_out(&self, timedout: bool) { fn set_timed_out(&self, timedout: bool) {
unsafe { unsafe {

View file

@ -76,15 +76,15 @@ impl<O: IsA<RTSPThreadPool>> RTSPThreadPoolExt for O {
fn connect_property_max_threads_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_max_threads_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-threads\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::max-threads\0".as_ptr() as *const _,
transmute(notify_max_threads_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_max_threads_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_max_threads_trampoline<P>(this: *mut ffi::GstRTSPThreadPool, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_max_threads_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstRTSPThreadPool, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPThreadPool> { where P: IsA<RTSPThreadPool> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&RTSPThreadPool::from_glib_borrow(this).unsafe_cast()) f(&RTSPThreadPool::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -24,7 +24,7 @@ glib_wrapper! {
} }
impl MIKEYPayload { impl MIKEYPayload {
pub fn new(type_: MIKEYPayloadType) -> MIKEYPayload { pub fn new(type_: MIKEYPayloadType) -> Option<MIKEYPayload> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_full(ffi::gst_mikey_payload_new(type_.to_glib())) from_glib_full(ffi::gst_mikey_payload_new(type_.to_glib()))

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)

View file

@ -110,41 +110,41 @@ impl WebRTCDTLSTransport {
pub fn connect_property_certificate_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_certificate_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::certificate\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::certificate\0".as_ptr() as *const _,
transmute(notify_certificate_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_certificate_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_client_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_client_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::client\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::client\0".as_ptr() as *const _,
transmute(notify_client_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_client_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_remote_certificate_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_remote_certificate_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::remote-certificate\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::remote-certificate\0".as_ptr() as *const _,
transmute(notify_remote_certificate_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_remote_certificate_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_state_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_state_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::state\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::state\0".as_ptr() as *const _,
transmute(notify_state_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_state_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_transport_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_transport_notify<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::transport\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::transport\0".as_ptr() as *const _,
transmute(notify_transport_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_transport_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -152,27 +152,27 @@ impl WebRTCDTLSTransport {
unsafe impl Send for WebRTCDTLSTransport {} unsafe impl Send for WebRTCDTLSTransport {}
unsafe impl Sync for WebRTCDTLSTransport {} unsafe impl Sync for WebRTCDTLSTransport {}
unsafe extern "C" fn notify_certificate_trampoline(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_certificate_trampoline<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCDTLSTransport) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_client_trampoline(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_client_trampoline<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCDTLSTransport) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_remote_certificate_trampoline(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_remote_certificate_trampoline<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCDTLSTransport) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_state_trampoline(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_state_trampoline<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCDTLSTransport) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_transport_trampoline(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_transport_trampoline<F: Fn(&WebRTCDTLSTransport) + Send + Sync + 'static>(this: *mut ffi::GstWebRTCDTLSTransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCDTLSTransport) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -78,33 +78,33 @@ impl WebRTCICETransport {
pub fn connect_on_new_candidate<F: Fn(&WebRTCICETransport, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_on_new_candidate<F: Fn(&WebRTCICETransport, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&WebRTCICETransport, &str) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"on-new-candidate\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"on-new-candidate\0".as_ptr() as *const _,
transmute(on_new_candidate_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(on_new_candidate_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_on_selected_candidate_pair_change<F: Fn(&WebRTCICETransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_on_selected_candidate_pair_change<F: Fn(&WebRTCICETransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&WebRTCICETransport) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"on-selected-candidate-pair-change\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"on-selected-candidate-pair-change\0".as_ptr() as *const _,
transmute(on_selected_candidate_pair_change_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(on_selected_candidate_pair_change_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_gathering_state_notify<F: Fn(&WebRTCICETransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_gathering_state_notify<F: Fn(&WebRTCICETransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&WebRTCICETransport) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::gathering-state\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::gathering-state\0".as_ptr() as *const _,
transmute(notify_gathering_state_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_gathering_state_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_state_notify<F: Fn(&WebRTCICETransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_state_notify<F: Fn(&WebRTCICETransport) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&WebRTCICETransport) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::state\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::state\0".as_ptr() as *const _,
transmute(notify_state_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_state_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -112,22 +112,22 @@ impl WebRTCICETransport {
unsafe impl Send for WebRTCICETransport {} unsafe impl Send for WebRTCICETransport {}
unsafe impl Sync for WebRTCICETransport {} unsafe impl Sync for WebRTCICETransport {}
unsafe extern "C" fn on_new_candidate_trampoline(this: *mut ffi::GstWebRTCICETransport, object: *mut libc::c_char, f: glib_ffi::gpointer) { unsafe extern "C" fn on_new_candidate_trampoline<F: Fn(&WebRTCICETransport, &str) + Send + Sync + 'static>(this: *mut ffi::GstWebRTCICETransport, object: *mut libc::c_char, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCICETransport, &str) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &GString::from_glib_borrow(object)) f(&from_glib_borrow(this), &GString::from_glib_borrow(object))
} }
unsafe extern "C" fn on_selected_candidate_pair_change_trampoline(this: *mut ffi::GstWebRTCICETransport, f: glib_ffi::gpointer) { unsafe extern "C" fn on_selected_candidate_pair_change_trampoline<F: Fn(&WebRTCICETransport) + Send + Sync + 'static>(this: *mut ffi::GstWebRTCICETransport, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCICETransport) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_gathering_state_trampoline(this: *mut ffi::GstWebRTCICETransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_gathering_state_trampoline<F: Fn(&WebRTCICETransport) + Send + Sync + 'static>(this: *mut ffi::GstWebRTCICETransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCICETransport) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_state_trampoline(this: *mut ffi::GstWebRTCICETransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_state_trampoline<F: Fn(&WebRTCICETransport) + Send + Sync + 'static>(this: *mut ffi::GstWebRTCICETransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCICETransport) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -234,88 +234,88 @@ impl<O: IsA<Bin>> GstBinExt for O {
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]
fn connect_deep_element_added<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_deep_element_added<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Bin, &Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"deep-element-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"deep-element-added\0".as_ptr() as *const _,
transmute(deep_element_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(deep_element_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]
fn connect_deep_element_removed<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_deep_element_removed<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Bin, &Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"deep-element-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"deep-element-removed\0".as_ptr() as *const _,
transmute(deep_element_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(deep_element_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_element_added<F: Fn(&Self, &Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_element_added<F: Fn(&Self, &Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"element-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"element-added\0".as_ptr() as *const _,
transmute(element_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(element_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_element_removed<F: Fn(&Self, &Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_element_removed<F: Fn(&Self, &Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Element) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"element-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"element-removed\0".as_ptr() as *const _,
transmute(element_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(element_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_async_handling_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_async_handling_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::async-handling\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::async-handling\0".as_ptr() as *const _,
transmute(notify_async_handling_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_async_handling_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_message_forward_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_message_forward_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::message-forward\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::message-forward\0".as_ptr() as *const _,
transmute(notify_message_forward_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_message_forward_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]
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) unsafe extern "C" fn deep_element_added_trampoline<P, F: Fn(&P, &Bin, &Element) + Send + Sync + 'static>(this: *mut ffi::GstBin, sub_bin: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> { where P: IsA<Bin> {
let f: &&(Fn(&P, &Bin, &Element) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Bin::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(sub_bin), &from_glib_borrow(element)) f(&Bin::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(sub_bin), &from_glib_borrow(element))
} }
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]
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) unsafe extern "C" fn deep_element_removed_trampoline<P, F: Fn(&P, &Bin, &Element) + Send + Sync + 'static>(this: *mut ffi::GstBin, sub_bin: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> { where P: IsA<Bin> {
let f: &&(Fn(&P, &Bin, &Element) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Bin::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(sub_bin), &from_glib_borrow(element)) f(&Bin::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(sub_bin), &from_glib_borrow(element))
} }
unsafe extern "C" fn element_added_trampoline<P>(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer) unsafe extern "C" fn element_added_trampoline<P, F: Fn(&P, &Element) + Send + Sync + 'static>(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> { where P: IsA<Bin> {
let f: &&(Fn(&P, &Element) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Bin::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element)) f(&Bin::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element))
} }
unsafe extern "C" fn element_removed_trampoline<P>(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer) unsafe extern "C" fn element_removed_trampoline<P, F: Fn(&P, &Element) + Send + Sync + 'static>(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> { where P: IsA<Bin> {
let f: &&(Fn(&P, &Element) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Bin::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element)) f(&Bin::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element))
} }
unsafe extern "C" fn notify_async_handling_trampoline<P>(this: *mut ffi::GstBin, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_async_handling_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBin, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Bin> { where P: IsA<Bin> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Bin::from_glib_borrow(this).unsafe_cast()) f(&Bin::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_message_forward_trampoline<P>(this: *mut ffi::GstBin, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_message_forward_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstBin, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Bin> { where P: IsA<Bin> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Bin::from_glib_borrow(this).unsafe_cast()) f(&Bin::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -37,15 +37,7 @@ impl Bus {
} }
} }
//pub fn add_watch<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/BusFunc, user_data: P) -> u32 { //pub fn async_signal_func(&self, message: &Message, data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
// unsafe { TODO: call ffi::gst_bus_add_watch() }
//}
//pub fn add_watch_full(&self, priority: i32, func: /*Unknown conversion*//*Unimplemented*/BusFunc, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> u32 {
// unsafe { TODO: call ffi::gst_bus_add_watch_full() }
//}
//pub fn async_signal_func<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, message: &Message, data: P) -> bool {
// unsafe { TODO: call ffi::gst_bus_async_signal_func() } // unsafe { TODO: call ffi::gst_bus_async_signal_func() }
//} //}
@ -108,11 +100,7 @@ impl Bus {
} }
} }
//pub fn set_sync_handler<'a, P: Into<Option<&'a /*Unimplemented*/BusSyncHandler>>>(&self, func: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) { //pub fn sync_signal_handler(&self, message: &Message, data: /*Unimplemented*/Option<Fundamental: Pointer>) -> BusSyncReply {
// unsafe { TODO: call ffi::gst_bus_set_sync_handler() }
//}
//pub fn sync_signal_handler<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, message: &Message, data: P) -> BusSyncReply {
// unsafe { TODO: call ffi::gst_bus_sync_signal_handler() } // unsafe { TODO: call ffi::gst_bus_sync_signal_handler() }
//} //}
@ -124,17 +112,17 @@ impl Bus {
pub fn connect_message<F: Fn(&Bus, &Message) + Send + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_message<F: Fn(&Bus, &Message) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Bus, &Message) + Send + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"message\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"message\0".as_ptr() as *const _,
transmute(message_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(message_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_sync_message<F: Fn(&Bus, &Message) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_sync_message<F: Fn(&Bus, &Message) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Bus, &Message) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"sync-message\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"sync-message\0".as_ptr() as *const _,
transmute(sync_message_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(sync_message_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -148,12 +136,12 @@ impl Default for Bus {
unsafe impl Send for Bus {} unsafe impl Send for Bus {}
unsafe impl Sync for Bus {} unsafe impl Sync for Bus {}
unsafe extern "C" fn message_trampoline(this: *mut ffi::GstBus, message: *mut ffi::GstMessage, f: glib_ffi::gpointer) { unsafe extern "C" fn message_trampoline<F: Fn(&Bus, &Message) + Send + 'static>(this: *mut ffi::GstBus, message: *mut ffi::GstMessage, f: glib_ffi::gpointer) {
let f: &&(Fn(&Bus, &Message) + Send + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(message)) f(&from_glib_borrow(this), &from_glib_borrow(message))
} }
unsafe extern "C" fn sync_message_trampoline(this: *mut ffi::GstBus, message: *mut ffi::GstMessage, f: glib_ffi::gpointer) { unsafe extern "C" fn sync_message_trampoline<F: Fn(&Bus, &Message) + Send + Sync + 'static>(this: *mut ffi::GstBus, message: *mut ffi::GstMessage, f: glib_ffi::gpointer) {
let f: &&(Fn(&Bus, &Message) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(message)) f(&from_glib_borrow(this), &from_glib_borrow(message))
} }

View file

@ -120,29 +120,29 @@ impl<O: IsA<ChildProxy>> ChildProxyExt for O {
fn connect_child_added<F: Fn(&Self, &glib::Object, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_child_added<F: Fn(&Self, &glib::Object, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &glib::Object, &str) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"child-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"child-added\0".as_ptr() as *const _,
transmute(child_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(child_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_child_removed<F: Fn(&Self, &glib::Object, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_child_removed<F: Fn(&Self, &glib::Object, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &glib::Object, &str) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"child-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"child-removed\0".as_ptr() as *const _,
transmute(child_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(child_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn child_added_trampoline<P>(this: *mut ffi::GstChildProxy, object: *mut gobject_ffi::GObject, name: *mut libc::c_char, f: glib_ffi::gpointer) unsafe extern "C" fn child_added_trampoline<P, F: Fn(&P, &glib::Object, &str) + Send + Sync + 'static>(this: *mut ffi::GstChildProxy, object: *mut gobject_ffi::GObject, name: *mut libc::c_char, f: glib_ffi::gpointer)
where P: IsA<ChildProxy> { where P: IsA<ChildProxy> {
let f: &&(Fn(&P, &glib::Object, &str) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&ChildProxy::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object), &GString::from_glib_borrow(name)) f(&ChildProxy::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object), &GString::from_glib_borrow(name))
} }
unsafe extern "C" fn child_removed_trampoline<P>(this: *mut ffi::GstChildProxy, object: *mut gobject_ffi::GObject, name: *mut libc::c_char, f: glib_ffi::gpointer) unsafe extern "C" fn child_removed_trampoline<P, F: Fn(&P, &glib::Object, &str) + Send + Sync + 'static>(this: *mut ffi::GstChildProxy, object: *mut gobject_ffi::GObject, name: *mut libc::c_char, f: glib_ffi::gpointer)
where P: IsA<ChildProxy> { where P: IsA<ChildProxy> {
let f: &&(Fn(&P, &glib::Object, &str) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&ChildProxy::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object), &GString::from_glib_borrow(name)) f(&ChildProxy::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object), &GString::from_glib_borrow(name))
} }

View file

@ -28,7 +28,7 @@ glib_wrapper! {
} }
impl Clock { impl Clock {
//pub fn id_compare_func<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(id1: P, id2: Q) -> i32 { //pub fn id_compare_func(id1: /*Unimplemented*/Option<Fundamental: Pointer>, id2: /*Unimplemented*/Option<Fundamental: Pointer>) -> i32 {
// unsafe { TODO: call ffi::gst_clock_id_compare_func() } // unsafe { TODO: call ffi::gst_clock_id_compare_func() }
//} //}
@ -52,7 +52,7 @@ impl Clock {
// unsafe { TODO: call ffi::gst_clock_id_wait() } // unsafe { TODO: call ffi::gst_clock_id_wait() }
//} //}
//pub fn id_wait_async(id: /*Unimplemented*/ClockID, func: /*Unknown conversion*//*Unimplemented*/ClockCallback, destroy_data: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> ClockReturn { //pub fn id_wait_async(id: /*Unimplemented*/ClockID, func: /*Unimplemented*/Fn(&Clock, ClockTime, /*Unimplemented*/ClockID) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> ClockReturn {
// unsafe { TODO: call ffi::gst_clock_id_wait_async() } // unsafe { TODO: call ffi::gst_clock_id_wait_async() }
//} //}
} }
@ -285,57 +285,57 @@ impl<O: IsA<Clock>> ClockExt for O {
fn connect_synced<F: Fn(&Self, bool) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_synced<F: Fn(&Self, bool) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, bool) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"synced\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"synced\0".as_ptr() as *const _,
transmute(synced_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(synced_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::timeout\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::timeout\0".as_ptr() as *const _,
transmute(notify_timeout_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_timeout_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_window_size_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_window_size_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::window-size\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::window-size\0".as_ptr() as *const _,
transmute(notify_window_size_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_window_size_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_window_threshold_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_window_threshold_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::window-threshold\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::window-threshold\0".as_ptr() as *const _,
transmute(notify_window_threshold_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_window_threshold_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn synced_trampoline<P>(this: *mut ffi::GstClock, synced: glib_ffi::gboolean, f: glib_ffi::gpointer) unsafe extern "C" fn synced_trampoline<P, F: Fn(&P, bool) + Send + Sync + 'static>(this: *mut ffi::GstClock, synced: glib_ffi::gboolean, f: glib_ffi::gpointer)
where P: IsA<Clock> { where P: IsA<Clock> {
let f: &&(Fn(&P, bool) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Clock::from_glib_borrow(this).unsafe_cast(), from_glib(synced)) f(&Clock::from_glib_borrow(this).unsafe_cast(), from_glib(synced))
} }
unsafe extern "C" fn notify_timeout_trampoline<P>(this: *mut ffi::GstClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_timeout_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Clock> { where P: IsA<Clock> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Clock::from_glib_borrow(this).unsafe_cast()) f(&Clock::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_window_size_trampoline<P>(this: *mut ffi::GstClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_window_size_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Clock> { where P: IsA<Clock> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Clock::from_glib_borrow(this).unsafe_cast()) f(&Clock::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_window_threshold_trampoline<P>(this: *mut ffi::GstClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_window_threshold_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Clock> { where P: IsA<Clock> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Clock::from_glib_borrow(this).unsafe_cast()) f(&Clock::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -26,14 +26,14 @@ impl DateTime {
} }
} }
pub fn new_from_g_date_time(dt: &glib::DateTime) -> DateTime { pub fn new_from_g_date_time(dt: &glib::DateTime) -> Option<DateTime> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_full(ffi::gst_date_time_new_from_g_date_time(dt.to_glib_full())) from_glib_full(ffi::gst_date_time_new_from_g_date_time(dt.to_glib_full()))
} }
} }
pub fn new_from_iso8601_string(string: &str) -> DateTime { pub fn new_from_iso8601_string(string: &str) -> Option<DateTime> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_full(ffi::gst_date_time_new_from_iso8601_string(string.to_glib_none().0)) from_glib_full(ffi::gst_date_time_new_from_iso8601_string(string.to_glib_none().0))

View file

@ -103,15 +103,15 @@ impl<O: IsA<Device>> DeviceExt for O {
fn connect_removed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_removed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"removed\0".as_ptr() as *const _,
transmute(removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn removed_trampoline<P>(this: *mut ffi::GstDevice, f: glib_ffi::gpointer) unsafe extern "C" fn removed_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstDevice, f: glib_ffi::gpointer)
where P: IsA<Device> { where P: IsA<Device> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Device::from_glib_borrow(this).unsafe_cast()) f(&Device::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -114,15 +114,15 @@ impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
fn connect_property_show_all_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_show_all_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::show-all\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::show-all\0".as_ptr() as *const _,
transmute(notify_show_all_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_show_all_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_show_all_trampoline<P>(this: *mut ffi::GstDeviceMonitor, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_show_all_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstDeviceMonitor, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<DeviceMonitor> { where P: IsA<DeviceMonitor> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&DeviceMonitor::from_glib_borrow(this).unsafe_cast()) f(&DeviceMonitor::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -140,29 +140,29 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
fn connect_provider_hidden<F: Fn(&Self, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_provider_hidden<F: Fn(&Self, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &str) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"provider-hidden\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"provider-hidden\0".as_ptr() as *const _,
transmute(provider_hidden_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(provider_hidden_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_provider_unhidden<F: Fn(&Self, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_provider_unhidden<F: Fn(&Self, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &str) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"provider-unhidden\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"provider-unhidden\0".as_ptr() as *const _,
transmute(provider_unhidden_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(provider_unhidden_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn provider_hidden_trampoline<P>(this: *mut ffi::GstDeviceProvider, object: *mut libc::c_char, f: glib_ffi::gpointer) unsafe extern "C" fn provider_hidden_trampoline<P, F: Fn(&P, &str) + Send + Sync + 'static>(this: *mut ffi::GstDeviceProvider, object: *mut libc::c_char, f: glib_ffi::gpointer)
where P: IsA<DeviceProvider> { where P: IsA<DeviceProvider> {
let f: &&(Fn(&P, &str) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&DeviceProvider::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(object)) f(&DeviceProvider::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(object))
} }
unsafe extern "C" fn provider_unhidden_trampoline<P>(this: *mut ffi::GstDeviceProvider, object: *mut libc::c_char, f: glib_ffi::gpointer) unsafe extern "C" fn provider_unhidden_trampoline<P, F: Fn(&P, &str) + Send + Sync + 'static>(this: *mut ffi::GstDeviceProvider, object: *mut libc::c_char, f: glib_ffi::gpointer)
where P: IsA<DeviceProvider> { where P: IsA<DeviceProvider> {
let f: &&(Fn(&P, &str) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&DeviceProvider::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(object)) f(&DeviceProvider::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(object))
} }

View file

@ -66,19 +66,16 @@ pub trait ElementExt: 'static {
fn add_pad<P: IsA<Pad>>(&self, pad: &P) -> Result<(), glib::error::BoolError>; fn add_pad<P: IsA<Pad>>(&self, pad: &P) -> Result<(), glib::error::BoolError>;
//#[cfg(any(feature = "v1_10", feature = "dox"))]
//fn call_async(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
fn create_all_pads(&self); fn create_all_pads(&self);
//#[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg(any(feature = "v1_14", feature = "dox"))]
//fn foreach_pad<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementForeachPadFunc, user_data: P) -> bool; fn foreach_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool;
//#[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg(any(feature = "v1_14", feature = "dox"))]
//fn foreach_sink_pad<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementForeachPadFunc, user_data: P) -> bool; fn foreach_sink_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool;
//#[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg(any(feature = "v1_14", feature = "dox"))]
//fn foreach_src_pad<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementForeachPadFunc, user_data: P) -> bool; fn foreach_src_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool;
fn get_base_time(&self) -> ClockTime; fn get_base_time(&self) -> ClockTime;
@ -181,31 +178,62 @@ impl<O: IsA<Element>> ElementExt for O {
} }
} }
//#[cfg(any(feature = "v1_10", feature = "dox"))]
//fn call_async(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_element_call_async() }
//}
fn create_all_pads(&self) { fn create_all_pads(&self) {
unsafe { unsafe {
ffi::gst_element_create_all_pads(self.as_ref().to_glib_none().0); ffi::gst_element_create_all_pads(self.as_ref().to_glib_none().0);
} }
} }
//#[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg(any(feature = "v1_14", feature = "dox"))]
//fn foreach_pad<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementForeachPadFunc, user_data: P) -> bool { fn foreach_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool {
// unsafe { TODO: call ffi::gst_element_foreach_pad() } let func_data: P = func;
//} unsafe extern "C" fn func_func<P: FnMut(&Element, &Pad) -> bool>(element: *mut ffi::GstElement, pad: *mut ffi::GstPad, user_data: glib_ffi::gpointer) -> glib_ffi::gboolean {
let element = from_glib_borrow(element);
let pad = from_glib_borrow(pad);
let callback: *mut P = user_data as *const _ as usize as *mut P;
let res = (*callback)(&element, &pad);
res.to_glib()
}
let func = Some(func_func::<P> as _);
let super_callback0: &P = &func_data;
unsafe {
from_glib(ffi::gst_element_foreach_pad(self.as_ref().to_glib_none().0, func, super_callback0 as *const _ as usize as *mut _))
}
}
//#[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg(any(feature = "v1_14", feature = "dox"))]
//fn foreach_sink_pad<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementForeachPadFunc, user_data: P) -> bool { fn foreach_sink_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool {
// unsafe { TODO: call ffi::gst_element_foreach_sink_pad() } let func_data: P = func;
//} unsafe extern "C" fn func_func<P: FnMut(&Element, &Pad) -> bool>(element: *mut ffi::GstElement, pad: *mut ffi::GstPad, user_data: glib_ffi::gpointer) -> glib_ffi::gboolean {
let element = from_glib_borrow(element);
let pad = from_glib_borrow(pad);
let callback: *mut P = user_data as *const _ as usize as *mut P;
let res = (*callback)(&element, &pad);
res.to_glib()
}
let func = Some(func_func::<P> as _);
let super_callback0: &P = &func_data;
unsafe {
from_glib(ffi::gst_element_foreach_sink_pad(self.as_ref().to_glib_none().0, func, super_callback0 as *const _ as usize as *mut _))
}
}
//#[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg(any(feature = "v1_14", feature = "dox"))]
//fn foreach_src_pad<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementForeachPadFunc, user_data: P) -> bool { fn foreach_src_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool {
// unsafe { TODO: call ffi::gst_element_foreach_src_pad() } let func_data: P = func;
//} unsafe extern "C" fn func_func<P: FnMut(&Element, &Pad) -> bool>(element: *mut ffi::GstElement, pad: *mut ffi::GstPad, user_data: glib_ffi::gpointer) -> glib_ffi::gboolean {
let element = from_glib_borrow(element);
let pad = from_glib_borrow(pad);
let callback: *mut P = user_data as *const _ as usize as *mut P;
let res = (*callback)(&element, &pad);
res.to_glib()
}
let func = Some(func_func::<P> as _);
let super_callback0: &P = &func_data;
unsafe {
from_glib(ffi::gst_element_foreach_src_pad(self.as_ref().to_glib_none().0, func, super_callback0 as *const _ as usize as *mut _))
}
}
fn get_base_time(&self) -> ClockTime { fn get_base_time(&self) -> ClockTime {
unsafe { unsafe {
@ -449,43 +477,43 @@ impl<O: IsA<Element>> ElementExt for O {
fn connect_no_more_pads<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_no_more_pads<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"no-more-pads\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"no-more-pads\0".as_ptr() as *const _,
transmute(no_more_pads_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(no_more_pads_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_pad_added<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pad_added<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pad-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pad-added\0".as_ptr() as *const _,
transmute(pad_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pad_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_pad_removed<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_pad_removed<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pad-removed\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pad-removed\0".as_ptr() as *const _,
transmute(pad_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(pad_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn no_more_pads_trampoline<P>(this: *mut ffi::GstElement, f: glib_ffi::gpointer) unsafe extern "C" fn no_more_pads_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Element> { where P: IsA<Element> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Element::from_glib_borrow(this).unsafe_cast()) f(&Element::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn pad_added_trampoline<P>(this: *mut ffi::GstElement, new_pad: *mut ffi::GstPad, f: glib_ffi::gpointer) unsafe extern "C" fn pad_added_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(this: *mut ffi::GstElement, new_pad: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Element> { where P: IsA<Element> {
let f: &&(Fn(&P, &Pad) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Element::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(new_pad)) f(&Element::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(new_pad))
} }
unsafe extern "C" fn pad_removed_trampoline<P>(this: *mut ffi::GstElement, old_pad: *mut ffi::GstPad, f: glib_ffi::gpointer) unsafe extern "C" fn pad_removed_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(this: *mut ffi::GstElement, old_pad: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Element> { where P: IsA<Element> {
let f: &&(Fn(&P, &Pad) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Element::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(old_pad)) f(&Element::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(old_pad))
} }

View file

@ -22,19 +22,19 @@ glib_wrapper! {
} }
impl GhostPad { impl GhostPad {
pub fn new_no_target<'a, P: Into<Option<&'a str>>>(name: P, dir: PadDirection) -> GhostPad { pub fn new_no_target<'a, P: Into<Option<&'a str>>>(name: P, dir: PadDirection) -> Option<GhostPad> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
let name = name.into(); let name = name.into();
unsafe { unsafe {
Pad::from_glib_none(ffi::gst_ghost_pad_new_no_target(name.to_glib_none().0, dir.to_glib())).unsafe_cast() Option::<Pad>::from_glib_none(ffi::gst_ghost_pad_new_no_target(name.to_glib_none().0, dir.to_glib())).map(|o| o.unsafe_cast())
} }
} }
pub fn new_no_target_from_template<'a, P: Into<Option<&'a str>>>(name: P, templ: &PadTemplate) -> GhostPad { pub fn new_no_target_from_template<'a, P: Into<Option<&'a str>>>(name: P, templ: &PadTemplate) -> Option<GhostPad> {
skip_assert_initialized!(); skip_assert_initialized!();
let name = name.into(); let name = name.into();
unsafe { unsafe {
Pad::from_glib_none(ffi::gst_ghost_pad_new_no_target_from_template(name.to_glib_none().0, templ.to_glib_none().0)).unsafe_cast() Option::<Pad>::from_glib_none(ffi::gst_ghost_pad_new_no_target_from_template(name.to_glib_none().0, templ.to_glib_none().0)).map(|o| o.unsafe_cast())
} }
} }
} }

View file

@ -32,11 +32,11 @@ impl Object {
} }
} }
//pub fn default_deep_notify<P: IsA<glib::Object>, Q: IsA<Object>, R: IsA</*Ignored*/glib::ParamSpec>>(object: &P, orig: &Q, pspec: &R, excluded_props: &[&str]) { //pub fn default_deep_notify<P: IsA<glib::Object>, Q: IsA<Object>>(object: &P, orig: &Q, pspec: /*Ignored*/&glib::ParamSpec, excluded_props: &[&str]) {
// unsafe { TODO: call ffi::gst_object_default_deep_notify() } // unsafe { TODO: call ffi::gst_object_default_deep_notify() }
//} //}
//pub fn ref_sink<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(object: P) -> /*Unimplemented*/Option<Fundamental: Pointer> { //pub fn ref_sink(object: /*Unimplemented*/Option<Fundamental: Pointer>) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call ffi::gst_object_ref_sink() } // unsafe { TODO: call ffi::gst_object_ref_sink() }
//} //}
@ -51,7 +51,7 @@ unsafe impl Sync for Object {}
pub const NONE_OBJECT: Option<&Object> = None; pub const NONE_OBJECT: Option<&Object> = None;
pub trait GstObjectExt: 'static { pub trait GstObjectExt: 'static {
//fn add_control_binding<P: IsA</*Ignored*/ControlBinding>>(&self, binding: &P) -> bool; //fn add_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool;
fn default_error<'a, P: Into<Option<&'a str>>>(&self, error: &Error, debug: P); fn default_error<'a, P: Into<Option<&'a str>>>(&self, error: &Error, debug: P);
@ -69,7 +69,7 @@ pub trait GstObjectExt: 'static {
//fn get_value(&self, property_name: &str, timestamp: ClockTime) -> /*Ignored*/Option<glib::Value>; //fn get_value(&self, property_name: &str, timestamp: ClockTime) -> /*Ignored*/Option<glib::Value>;
//fn get_value_array<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: P) -> bool; //fn get_value_array(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool;
fn has_active_control_bindings(&self) -> bool; fn has_active_control_bindings(&self) -> bool;
@ -79,7 +79,7 @@ pub trait GstObjectExt: 'static {
fn has_as_parent<P: IsA<Object>>(&self, parent: &P) -> bool; fn has_as_parent<P: IsA<Object>>(&self, parent: &P) -> bool;
//fn remove_control_binding<P: IsA</*Ignored*/ControlBinding>>(&self, binding: &P) -> bool; //fn remove_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool;
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool); fn set_control_binding_disabled(&self, property_name: &str, disabled: bool);
@ -105,7 +105,7 @@ pub trait GstObjectExt: 'static {
} }
impl<O: IsA<Object>> GstObjectExt for O { impl<O: IsA<Object>> GstObjectExt for O {
//fn add_control_binding<P: IsA</*Ignored*/ControlBinding>>(&self, binding: &P) -> bool { //fn add_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool {
// unsafe { TODO: call ffi::gst_object_add_control_binding() } // unsafe { TODO: call ffi::gst_object_add_control_binding() }
//} //}
@ -152,7 +152,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
// unsafe { TODO: call ffi::gst_object_get_value() } // unsafe { TODO: call ffi::gst_object_get_value() }
//} //}
//fn get_value_array<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: P) -> bool { //fn get_value_array(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
// unsafe { TODO: call ffi::gst_object_get_value_array() } // unsafe { TODO: call ffi::gst_object_get_value_array() }
//} //}
@ -180,7 +180,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
} }
} }
//fn remove_control_binding<P: IsA</*Ignored*/ControlBinding>>(&self, binding: &P) -> bool { //fn remove_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool {
// unsafe { TODO: call ffi::gst_object_remove_control_binding() } // unsafe { TODO: call ffi::gst_object_remove_control_binding() }
//} //}
@ -238,29 +238,29 @@ impl<O: IsA<Object>> GstObjectExt for O {
fn connect_property_name_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_name_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _,
transmute(notify_name_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_name_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_parent_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_parent_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::parent\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::parent\0".as_ptr() as *const _,
transmute(notify_parent_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_parent_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_name_trampoline<P>(this: *mut ffi::GstObject, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_name_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstObject, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Object> { where P: IsA<Object> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Object::from_glib_borrow(this).unsafe_cast()) f(&Object::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_parent_trampoline<P>(this: *mut ffi::GstObject, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_parent_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstObject, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Object> { where P: IsA<Object> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Object::from_glib_borrow(this).unsafe_cast()) f(&Object::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -65,8 +65,6 @@ pub const NONE_PAD: Option<&Pad> = None;
pub trait PadExt: 'static { pub trait PadExt: 'static {
fn activate_mode(&self, mode: PadMode, active: bool) -> Result<(), glib::error::BoolError>; fn activate_mode(&self, mode: PadMode, active: bool) -> Result<(), glib::error::BoolError>;
//fn add_probe(&self, mask: PadProbeType, callback: /*Unknown conversion*//*Unimplemented*/PadProbeCallback, destroy_data: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> libc::c_ulong;
fn can_link<P: IsA<Pad>>(&self, sinkpad: &P) -> bool; fn can_link<P: IsA<Pad>>(&self, sinkpad: &P) -> bool;
fn check_reconfigure(&self) -> bool; fn check_reconfigure(&self) -> bool;
@ -77,7 +75,7 @@ pub trait PadExt: 'static {
//fn create_stream_id_printf_valist<'a, P: IsA<Element>, Q: Into<Option<&'a str>>>(&self, parent: &P, stream_id: Q, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> Option<GString>; //fn create_stream_id_printf_valist<'a, P: IsA<Element>, Q: Into<Option<&'a str>>>(&self, parent: &P, stream_id: Q, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> Option<GString>;
//fn forward<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, forward: /*Unknown conversion*//*Unimplemented*/PadForwardFunction, user_data: P) -> bool; fn forward<P: FnMut(&Pad) -> bool>(&self, forward: P) -> bool;
fn get_allowed_caps(&self) -> Option<Caps>; fn get_allowed_caps(&self) -> Option<Caps>;
@ -141,38 +139,12 @@ pub trait PadExt: 'static {
fn query_caps<'a, P: Into<Option<&'a Caps>>>(&self, filter: P) -> Option<Caps>; fn query_caps<'a, P: Into<Option<&'a Caps>>>(&self, filter: P) -> Option<Caps>;
//fn set_activate_function_full(&self, activate: /*Unknown conversion*//*Unimplemented*/PadActivateFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_activatemode_function_full(&self, activatemode: /*Unknown conversion*//*Unimplemented*/PadActivateModeFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError>; fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError>;
//fn set_chain_function_full(&self, chain: /*Unknown conversion*//*Unimplemented*/PadChainFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify); //fn set_element_private(&self, priv_: /*Unimplemented*/Option<Fundamental: Pointer>);
//fn set_chain_list_function_full(&self, chainlist: /*Unknown conversion*//*Unimplemented*/PadChainListFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_element_private<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, priv_: P);
//fn set_event_full_function_full(&self, event: /*Unknown conversion*//*Unimplemented*/PadEventFullFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_event_function_full(&self, event: /*Unknown conversion*//*Unimplemented*/PadEventFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_getrange_function_full(&self, get: /*Unknown conversion*//*Unimplemented*/PadGetRangeFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_iterate_internal_links_function_full(&self, iterintlink: /*Unknown conversion*//*Unimplemented*/PadIterIntLinkFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_link_function_full(&self, link: /*Unknown conversion*//*Unimplemented*/PadLinkFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
fn set_offset(&self, offset: i64); fn set_offset(&self, offset: i64);
//fn set_query_function_full(&self, query: /*Unknown conversion*//*Unimplemented*/PadQueryFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_unlink_function_full(&self, unlink: /*Unknown conversion*//*Unimplemented*/PadUnlinkFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn start_task(&self, func: /*Unknown conversion*//*Unimplemented*/TaskFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> bool;
//fn sticky_events_foreach<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, foreach_func: /*Unknown conversion*//*Unimplemented*/PadStickyEventsForeachFunction, user_data: P);
fn stop_task(&self) -> Result<(), glib::error::BoolError>; fn stop_task(&self) -> Result<(), glib::error::BoolError>;
fn unlink<P: IsA<Pad>>(&self, sinkpad: &P) -> Result<(), glib::error::BoolError>; fn unlink<P: IsA<Pad>>(&self, sinkpad: &P) -> Result<(), glib::error::BoolError>;
@ -203,10 +175,6 @@ impl<O: IsA<Pad>> PadExt for O {
} }
} }
//fn add_probe(&self, mask: PadProbeType, callback: /*Unknown conversion*//*Unimplemented*/PadProbeCallback, destroy_data: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> libc::c_ulong {
// unsafe { TODO: call ffi::gst_pad_add_probe() }
//}
fn can_link<P: IsA<Pad>>(&self, sinkpad: &P) -> bool { fn can_link<P: IsA<Pad>>(&self, sinkpad: &P) -> bool {
unsafe { unsafe {
from_glib(ffi::gst_pad_can_link(self.as_ref().to_glib_none().0, sinkpad.as_ref().to_glib_none().0)) from_glib(ffi::gst_pad_can_link(self.as_ref().to_glib_none().0, sinkpad.as_ref().to_glib_none().0))
@ -234,9 +202,20 @@ impl<O: IsA<Pad>> PadExt for O {
// unsafe { TODO: call ffi::gst_pad_create_stream_id_printf_valist() } // unsafe { TODO: call ffi::gst_pad_create_stream_id_printf_valist() }
//} //}
//fn forward<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, forward: /*Unknown conversion*//*Unimplemented*/PadForwardFunction, user_data: P) -> bool { fn forward<P: FnMut(&Pad) -> bool>(&self, forward: P) -> bool {
// unsafe { TODO: call ffi::gst_pad_forward() } let forward_data: P = forward;
//} unsafe extern "C" fn forward_func<P: FnMut(&Pad) -> bool>(pad: *mut ffi::GstPad, user_data: glib_ffi::gpointer) -> glib_ffi::gboolean {
let pad = from_glib_borrow(pad);
let callback: *mut P = user_data as *const _ as usize as *mut P;
let res = (*callback)(&pad);
res.to_glib()
}
let forward = Some(forward_func::<P> as _);
let super_callback0: &P = &forward_data;
unsafe {
from_glib(ffi::gst_pad_forward(self.as_ref().to_glib_none().0, forward, super_callback0 as *const _ as usize as *mut _))
}
}
fn get_allowed_caps(&self) -> Option<Caps> { fn get_allowed_caps(&self) -> Option<Caps> {
unsafe { unsafe {
@ -412,74 +391,22 @@ impl<O: IsA<Pad>> PadExt for O {
} }
} }
//fn set_activate_function_full(&self, activate: /*Unknown conversion*//*Unimplemented*/PadActivateFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_activate_function_full() }
//}
//fn set_activatemode_function_full(&self, activatemode: /*Unknown conversion*//*Unimplemented*/PadActivateModeFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_activatemode_function_full() }
//}
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> { fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!(ffi::gst_pad_set_active(self.as_ref().to_glib_none().0, active.to_glib()), "Failed to activate pad") glib_result_from_gboolean!(ffi::gst_pad_set_active(self.as_ref().to_glib_none().0, active.to_glib()), "Failed to activate pad")
} }
} }
//fn set_chain_function_full(&self, chain: /*Unknown conversion*//*Unimplemented*/PadChainFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) { //fn set_element_private(&self, priv_: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call ffi::gst_pad_set_chain_function_full() }
//}
//fn set_chain_list_function_full(&self, chainlist: /*Unknown conversion*//*Unimplemented*/PadChainListFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_chain_list_function_full() }
//}
//fn set_element_private<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, priv_: P) {
// unsafe { TODO: call ffi::gst_pad_set_element_private() } // unsafe { TODO: call ffi::gst_pad_set_element_private() }
//} //}
//fn set_event_full_function_full(&self, event: /*Unknown conversion*//*Unimplemented*/PadEventFullFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_event_full_function_full() }
//}
//fn set_event_function_full(&self, event: /*Unknown conversion*//*Unimplemented*/PadEventFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_event_function_full() }
//}
//fn set_getrange_function_full(&self, get: /*Unknown conversion*//*Unimplemented*/PadGetRangeFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_getrange_function_full() }
//}
//fn set_iterate_internal_links_function_full(&self, iterintlink: /*Unknown conversion*//*Unimplemented*/PadIterIntLinkFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_iterate_internal_links_function_full() }
//}
//fn set_link_function_full(&self, link: /*Unknown conversion*//*Unimplemented*/PadLinkFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_link_function_full() }
//}
fn set_offset(&self, offset: i64) { fn set_offset(&self, offset: i64) {
unsafe { unsafe {
ffi::gst_pad_set_offset(self.as_ref().to_glib_none().0, offset); ffi::gst_pad_set_offset(self.as_ref().to_glib_none().0, offset);
} }
} }
//fn set_query_function_full(&self, query: /*Unknown conversion*//*Unimplemented*/PadQueryFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_query_function_full() }
//}
//fn set_unlink_function_full(&self, unlink: /*Unknown conversion*//*Unimplemented*/PadUnlinkFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_unlink_function_full() }
//}
//fn start_task(&self, func: /*Unknown conversion*//*Unimplemented*/TaskFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> bool {
// unsafe { TODO: call ffi::gst_pad_start_task() }
//}
//fn sticky_events_foreach<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, foreach_func: /*Unknown conversion*//*Unimplemented*/PadStickyEventsForeachFunction, user_data: P) {
// unsafe { TODO: call ffi::gst_pad_sticky_events_foreach() }
//}
fn stop_task(&self) -> Result<(), glib::error::BoolError> { fn stop_task(&self) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!(ffi::gst_pad_stop_task(self.as_ref().to_glib_none().0), "Failed to stop pad task") glib_result_from_gboolean!(ffi::gst_pad_stop_task(self.as_ref().to_glib_none().0), "Failed to stop pad task")
@ -522,71 +449,71 @@ impl<O: IsA<Pad>> PadExt for O {
fn connect_linked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_linked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"linked\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"linked\0".as_ptr() as *const _,
transmute(linked_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(linked_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_unlinked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_unlinked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"unlinked\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"unlinked\0".as_ptr() as *const _,
transmute(unlinked_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(unlinked_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_caps_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_caps_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _,
transmute(notify_caps_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_caps_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::offset\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::offset\0".as_ptr() as *const _,
transmute(notify_offset_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_offset_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_template_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_template_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::template\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::template\0".as_ptr() as *const _,
transmute(notify_template_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_template_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn linked_trampoline<P>(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer) unsafe extern "C" fn linked_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Pad> { where P: IsA<Pad> {
let f: &&(Fn(&P, &Pad) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pad::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(peer)) f(&Pad::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(peer))
} }
unsafe extern "C" fn unlinked_trampoline<P>(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer) unsafe extern "C" fn unlinked_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Pad> { where P: IsA<Pad> {
let f: &&(Fn(&P, &Pad) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pad::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(peer)) f(&Pad::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(peer))
} }
unsafe extern "C" fn notify_caps_trampoline<P>(this: *mut ffi::GstPad, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_caps_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstPad, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pad> { where P: IsA<Pad> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pad::from_glib_borrow(this).unsafe_cast()) f(&Pad::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_offset_trampoline<P>(this: *mut ffi::GstPad, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_offset_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstPad, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pad> { where P: IsA<Pad> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pad::from_glib_borrow(this).unsafe_cast()) f(&Pad::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_template_trampoline<P>(this: *mut ffi::GstPad, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_template_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstPad, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pad> { where P: IsA<Pad> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pad::from_glib_borrow(this).unsafe_cast()) f(&Pad::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -32,7 +32,7 @@ glib_wrapper! {
} }
impl PadTemplate { impl PadTemplate {
pub fn new(name_template: &str, direction: PadDirection, presence: PadPresence, caps: &Caps) -> PadTemplate { pub fn new(name_template: &str, direction: PadDirection, presence: PadPresence, caps: &Caps) -> Option<PadTemplate> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_none(ffi::gst_pad_template_new(name_template.to_glib_none().0, direction.to_glib(), presence.to_glib(), caps.to_glib_none().0)) from_glib_none(ffi::gst_pad_template_new(name_template.to_glib_none().0, direction.to_glib(), presence.to_glib(), caps.to_glib_none().0))
@ -40,7 +40,7 @@ impl PadTemplate {
} }
#[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn new_with_gtype(name_template: &str, direction: PadDirection, presence: PadPresence, caps: &Caps, pad_type: glib::types::Type) -> PadTemplate { pub fn new_with_gtype(name_template: &str, direction: PadDirection, presence: PadPresence, caps: &Caps, pad_type: glib::types::Type) -> Option<PadTemplate> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_none(ffi::gst_pad_template_new_with_gtype(name_template.to_glib_none().0, direction.to_glib(), presence.to_glib(), caps.to_glib_none().0, pad_type.to_glib())) from_glib_none(ffi::gst_pad_template_new_with_gtype(name_template.to_glib_none().0, direction.to_glib(), presence.to_glib(), caps.to_glib_none().0, pad_type.to_glib()))
@ -94,9 +94,9 @@ impl PadTemplate {
pub fn connect_pad_created<F: Fn(&PadTemplate, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_pad_created<F: Fn(&PadTemplate, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&PadTemplate, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"pad-created\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"pad-created\0".as_ptr() as *const _,
transmute(pad_created_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(pad_created_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -104,7 +104,7 @@ impl PadTemplate {
unsafe impl Send for PadTemplate {} unsafe impl Send for PadTemplate {}
unsafe impl Sync for PadTemplate {} unsafe impl Sync for PadTemplate {}
unsafe extern "C" fn pad_created_trampoline(this: *mut ffi::GstPadTemplate, pad: *mut ffi::GstPad, f: glib_ffi::gpointer) { unsafe extern "C" fn pad_created_trampoline<F: Fn(&PadTemplate, &Pad) + Send + Sync + 'static>(this: *mut ffi::GstPadTemplate, pad: *mut ffi::GstPad, f: glib_ffi::gpointer) {
let f: &&(Fn(&PadTemplate, &Pad) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(pad)) f(&from_glib_borrow(this), &from_glib_borrow(pad))
} }

View file

@ -125,43 +125,43 @@ impl<O: IsA<Pipeline>> PipelineExt for O {
fn connect_property_auto_flush_bus_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_auto_flush_bus_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::auto-flush-bus\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::auto-flush-bus\0".as_ptr() as *const _,
transmute(notify_auto_flush_bus_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_auto_flush_bus_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::delay\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::delay\0".as_ptr() as *const _,
transmute(notify_delay_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_delay_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _,
transmute(notify_latency_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_latency_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_auto_flush_bus_trampoline<P>(this: *mut ffi::GstPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_auto_flush_bus_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pipeline> { where P: IsA<Pipeline> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pipeline::from_glib_borrow(this).unsafe_cast()) f(&Pipeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_delay_trampoline<P>(this: *mut ffi::GstPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_delay_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pipeline> { where P: IsA<Pipeline> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pipeline::from_glib_borrow(this).unsafe_cast()) f(&Pipeline::from_glib_borrow(this).unsafe_cast())
} }
unsafe extern "C" fn notify_latency_trampoline<P>(this: *mut ffi::GstPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Pipeline> { where P: IsA<Pipeline> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&Pipeline::from_glib_borrow(this).unsafe_cast()) f(&Pipeline::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -110,14 +110,6 @@ impl Plugin {
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
} }
} }
//pub fn register_static(major_version: i32, minor_version: i32, name: &str, description: &str, init_func: /*Unknown conversion*//*Unimplemented*/PluginInitFunc, version: &str, license: &str, source: &str, package: &str, origin: &str) -> bool {
// unsafe { TODO: call ffi::gst_plugin_register_static() }
//}
//pub fn register_static_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(major_version: i32, minor_version: i32, name: &str, description: &str, init_full_func: /*Unknown conversion*//*Unimplemented*/PluginInitFullFunc, version: &str, license: &str, source: &str, package: &str, origin: &str, user_data: P) -> bool {
// unsafe { TODO: call ffi::gst_plugin_register_static_full() }
//}
} }
unsafe impl Send for Plugin {} unsafe impl Send for Plugin {}

View file

@ -44,9 +44,20 @@ impl Registry {
} }
} }
//pub fn feature_filter<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, filter: /*Unknown conversion*//*Unimplemented*/PluginFeatureFilter, first: bool, user_data: P) -> Vec<PluginFeature> { pub fn feature_filter<P: FnMut(&PluginFeature) -> bool>(&self, filter: P, first: bool) -> Vec<PluginFeature> {
// unsafe { TODO: call ffi::gst_registry_feature_filter() } let filter_data: P = filter;
//} unsafe extern "C" fn filter_func<P: FnMut(&PluginFeature) -> bool>(feature: *mut ffi::GstPluginFeature, user_data: glib_ffi::gpointer) -> glib_ffi::gboolean {
let feature = from_glib_borrow(feature);
let callback: *mut P = user_data as *const _ as usize as *mut P;
let res = (*callback)(&feature);
res.to_glib()
}
let filter = Some(filter_func::<P> as _);
let super_callback0: &P = &filter_data;
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::gst_registry_feature_filter(self.to_glib_none().0, filter, first.to_glib(), super_callback0 as *const _ as usize as *mut _))
}
}
pub fn find_feature(&self, name: &str, type_: glib::types::Type) -> Option<PluginFeature> { pub fn find_feature(&self, name: &str, type_: glib::types::Type) -> Option<PluginFeature> {
unsafe { unsafe {
@ -96,9 +107,20 @@ impl Registry {
} }
} }
//pub fn plugin_filter<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, filter: /*Unknown conversion*//*Unimplemented*/PluginFilter, first: bool, user_data: P) -> Vec<Plugin> { pub fn plugin_filter<P: FnMut(&Plugin) -> bool>(&self, filter: P, first: bool) -> Vec<Plugin> {
// unsafe { TODO: call ffi::gst_registry_plugin_filter() } let filter_data: P = filter;
//} unsafe extern "C" fn filter_func<P: FnMut(&Plugin) -> bool>(plugin: *mut ffi::GstPlugin, user_data: glib_ffi::gpointer) -> glib_ffi::gboolean {
let plugin = from_glib_borrow(plugin);
let callback: *mut P = user_data as *const _ as usize as *mut P;
let res = (*callback)(&plugin);
res.to_glib()
}
let filter = Some(filter_func::<P> as _);
let super_callback0: &P = &filter_data;
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::gst_registry_plugin_filter(self.to_glib_none().0, filter, first.to_glib(), super_callback0 as *const _ as usize as *mut _))
}
}
pub fn remove_feature<P: IsA<PluginFeature>>(&self, feature: &P) { pub fn remove_feature<P: IsA<PluginFeature>>(&self, feature: &P) {
unsafe { unsafe {
@ -127,17 +149,17 @@ impl Registry {
pub fn connect_feature_added<F: Fn(&Registry, &PluginFeature) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_feature_added<F: Fn(&Registry, &PluginFeature) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Registry, &PluginFeature) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"feature-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"feature-added\0".as_ptr() as *const _,
transmute(feature_added_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(feature_added_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_plugin_added<F: Fn(&Registry, &Plugin) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_plugin_added<F: Fn(&Registry, &Plugin) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Registry, &Plugin) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"plugin-added\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"plugin-added\0".as_ptr() as *const _,
transmute(plugin_added_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(plugin_added_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -145,12 +167,12 @@ impl Registry {
unsafe impl Send for Registry {} unsafe impl Send for Registry {}
unsafe impl Sync for Registry {} unsafe impl Sync for Registry {}
unsafe extern "C" fn feature_added_trampoline(this: *mut ffi::GstRegistry, feature: *mut ffi::GstPluginFeature, f: glib_ffi::gpointer) { unsafe extern "C" fn feature_added_trampoline<F: Fn(&Registry, &PluginFeature) + Send + Sync + 'static>(this: *mut ffi::GstRegistry, feature: *mut ffi::GstPluginFeature, f: glib_ffi::gpointer) {
let f: &&(Fn(&Registry, &PluginFeature) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(feature)) f(&from_glib_borrow(this), &from_glib_borrow(feature))
} }
unsafe extern "C" fn plugin_added_trampoline(this: *mut ffi::GstRegistry, plugin: *mut ffi::GstPlugin, f: glib_ffi::gpointer) { unsafe extern "C" fn plugin_added_trampoline<F: Fn(&Registry, &Plugin) + Send + Sync + 'static>(this: *mut ffi::GstRegistry, plugin: *mut ffi::GstPlugin, f: glib_ffi::gpointer) {
let f: &&(Fn(&Registry, &Plugin) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this), &from_glib_borrow(plugin)) f(&from_glib_borrow(this), &from_glib_borrow(plugin))
} }

View file

@ -160,33 +160,33 @@ impl Stream {
pub fn connect_property_caps_notify<F: Fn(&Stream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_caps_notify<F: Fn(&Stream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Stream) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _,
transmute(notify_caps_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_caps_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_stream_flags_notify<F: Fn(&Stream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_stream_flags_notify<F: Fn(&Stream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Stream) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::stream-flags\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::stream-flags\0".as_ptr() as *const _,
transmute(notify_stream_flags_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_stream_flags_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_stream_type_notify<F: Fn(&Stream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_stream_type_notify<F: Fn(&Stream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Stream) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::stream-type\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::stream-type\0".as_ptr() as *const _,
transmute(notify_stream_type_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_stream_type_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
pub fn connect_property_tags_notify<F: Fn(&Stream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_tags_notify<F: Fn(&Stream) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Stream) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::tags\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::tags\0".as_ptr() as *const _,
transmute(notify_tags_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_tags_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -194,22 +194,22 @@ impl Stream {
unsafe impl Send for Stream {} unsafe impl Send for Stream {}
unsafe impl Sync for Stream {} unsafe impl Sync for Stream {}
unsafe extern "C" fn notify_caps_trampoline(this: *mut ffi::GstStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_caps_trampoline<F: Fn(&Stream) + Send + Sync + 'static>(this: *mut ffi::GstStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Stream) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_stream_flags_trampoline(this: *mut ffi::GstStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_stream_flags_trampoline<F: Fn(&Stream) + Send + Sync + 'static>(this: *mut ffi::GstStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Stream) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_stream_type_trampoline(this: *mut ffi::GstStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_stream_type_trampoline<F: Fn(&Stream) + Send + Sync + 'static>(this: *mut ffi::GstStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Stream) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }
unsafe extern "C" fn notify_tags_trampoline(this: *mut ffi::GstStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_tags_trampoline<F: Fn(&Stream) + Send + Sync + 'static>(this: *mut ffi::GstStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&Stream) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -69,9 +69,9 @@ impl StreamCollection {
pub fn connect_property_upstream_id_notify<F: Fn(&StreamCollection) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_upstream_id_notify<F: Fn(&StreamCollection) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&StreamCollection) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::upstream-id\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::upstream-id\0".as_ptr() as *const _,
transmute(notify_upstream_id_trampoline as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_upstream_id_trampoline::<F> as usize)), Box_::into_raw(f))
} }
} }
} }
@ -79,7 +79,7 @@ impl StreamCollection {
unsafe impl Send for StreamCollection {} unsafe impl Send for StreamCollection {}
unsafe impl Sync for StreamCollection {} unsafe impl Sync for StreamCollection {}
unsafe extern "C" fn notify_upstream_id_trampoline(this: *mut ffi::GstStreamCollection, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) { unsafe extern "C" fn notify_upstream_id_trampoline<F: Fn(&StreamCollection) + Send + Sync + 'static>(this: *mut ffi::GstStreamCollection, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&StreamCollection) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&from_glib_borrow(this)) f(&from_glib_borrow(this))
} }

View file

@ -73,15 +73,15 @@ impl<O: IsA<SystemClock>> SystemClockExt for O {
fn connect_property_clock_type_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_property_clock_type_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe { unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f)); let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::clock-type\0".as_ptr() as *const _, connect_raw(self.as_ptr() as *mut _, b"notify::clock-type\0".as_ptr() as *const _,
transmute(notify_clock_type_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) Some(transmute(notify_clock_type_trampoline::<Self, F> as usize)), Box_::into_raw(f))
} }
} }
} }
unsafe extern "C" fn notify_clock_type_trampoline<P>(this: *mut ffi::GstSystemClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) unsafe extern "C" fn notify_clock_type_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstSystemClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<SystemClock> { where P: IsA<SystemClock> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); let f: &F = transmute(f);
f(&SystemClock::from_glib_borrow(this).unsafe_cast()) f(&SystemClock::from_glib_borrow(this).unsafe_cast())
} }

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 4620f19) Generated by gir (https://github.com/gtk-rs/gir @ eb84608)
from gir-files (https://github.com/gtk-rs/gir-files @ ???) from gir-files (https://github.com/gtk-rs/gir-files @ ???)