From ffb5869dd1fb25534be700763723b75d5a9111d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 17 Dec 2017 11:24:03 +0200 Subject: [PATCH] Use the correct pad type for the proxy/ghost pad default pad functions --- Gir_Gst.toml | 10 +++++++ gstreamer/src/auto/ghost_pad.rs | 19 ------------- gstreamer/src/ghost_pad.rs | 50 +++++++++++++++++++++++++++++++++ gstreamer/src/proxy_pad.rs | 16 +++++------ 4 files changed, 68 insertions(+), 27 deletions(-) diff --git a/Gir_Gst.toml b/Gir_Gst.toml index 62c40290c..360b3fe8b 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -550,6 +550,16 @@ status = "generate" name = "construct" ignore = true + [[object.function]] + name = "activate_mode_default" + # wrong instance type + ignore = true + + [[object.function]] + name = "internal_activate_mode_default" + # wrong instance type + ignore = true + [[object]] name = "Gst.ProxyPad" status = "generate" diff --git a/gstreamer/src/auto/ghost_pad.rs b/gstreamer/src/auto/ghost_pad.rs index 470d3efeb..0a5a32675 100644 --- a/gstreamer/src/auto/ghost_pad.rs +++ b/gstreamer/src/auto/ghost_pad.rs @@ -4,7 +4,6 @@ use Object; use Pad; use PadDirection; -use PadMode; use PadTemplate; use ProxyPad; use ffi; @@ -43,24 +42,6 @@ impl GhostPad { Pad::from_glib_none(ffi::gst_ghost_pad_new_no_target_from_template(name.0, templ.to_glib_none().0)).downcast_unchecked() } } - - pub fn activate_mode_default<'a, P: IsA, Q: IsA + 'a, R: Into>>(pad: &P, parent: R, mode: PadMode, active: bool) -> bool { - skip_assert_initialized!(); - let parent = parent.into(); - let parent = parent.to_glib_none(); - unsafe { - from_glib(ffi::gst_ghost_pad_activate_mode_default(pad.to_glib_none().0, parent.0, mode.to_glib(), active.to_glib())) - } - } - - pub fn internal_activate_mode_default<'a, P: IsA, Q: IsA + 'a, R: Into>>(pad: &P, parent: R, mode: PadMode, active: bool) -> bool { - skip_assert_initialized!(); - let parent = parent.into(); - let parent = parent.to_glib_none(); - unsafe { - from_glib(ffi::gst_ghost_pad_internal_activate_mode_default(pad.to_glib_none().0, parent.0, mode.to_glib(), active.to_glib())) - } - } } unsafe impl Send for GhostPad {} diff --git a/gstreamer/src/ghost_pad.rs b/gstreamer/src/ghost_pad.rs index 7ec5de9b4..a2f2fb635 100644 --- a/gstreamer/src/ghost_pad.rs +++ b/gstreamer/src/ghost_pad.rs @@ -8,6 +8,8 @@ use Pad; use PadTemplate; +use Object; +use PadMode; use GhostPad; use ffi; use glib::object::Downcast; @@ -41,4 +43,52 @@ impl GhostPad { )).map(|o| Downcast::downcast_unchecked(o)) } } + + pub fn activate_mode_default< + 'a, + P: IsA, + Q: IsA + 'a, + R: Into>, + >( + pad: &P, + parent: R, + mode: PadMode, + active: bool, + ) -> bool { + skip_assert_initialized!(); + let parent = parent.into(); + let parent = parent.to_glib_none(); + unsafe { + from_glib(ffi::gst_ghost_pad_activate_mode_default( + pad.to_glib_none().0 as *mut ffi::GstPad, + parent.0, + mode.to_glib(), + active.to_glib(), + )) + } + } + + pub fn internal_activate_mode_default< + 'a, + P: IsA, + Q: IsA + 'a, + R: Into>, + >( + pad: &P, + parent: R, + mode: PadMode, + active: bool, + ) -> bool { + skip_assert_initialized!(); + let parent = parent.into(); + let parent = parent.to_glib_none(); + unsafe { + from_glib(ffi::gst_ghost_pad_internal_activate_mode_default( + pad.to_glib_none().0 as *mut ffi::GstPad, + parent.0, + mode.to_glib(), + active.to_glib(), + )) + } + } } diff --git a/gstreamer/src/proxy_pad.rs b/gstreamer/src/proxy_pad.rs index 5c15fadcb..52a1a9bfa 100644 --- a/gstreamer/src/proxy_pad.rs +++ b/gstreamer/src/proxy_pad.rs @@ -20,7 +20,7 @@ use glib::translate::{from_glib, from_glib_full, ToGlibPtr}; use ffi; impl ProxyPad { - pub fn chain_default<'a, P: IsA, Q: IsA + 'a, R: Into>>( + pub fn chain_default<'a, P: IsA, Q: IsA + 'a, R: Into>>( pad: &P, parent: R, buffer: Buffer, @@ -30,14 +30,14 @@ impl ProxyPad { let parent = parent.to_glib_none(); unsafe { from_glib(ffi::gst_proxy_pad_chain_default( - pad.to_glib_none().0, + pad.to_glib_none().0 as *mut ffi::GstPad, parent.0, buffer.into_ptr(), )) } } - pub fn chain_list_default<'a, P: IsA, Q: IsA + 'a, R: Into>>( + pub fn chain_list_default<'a, P: IsA, Q: IsA + 'a, R: Into>>( pad: &P, parent: R, list: BufferList, @@ -47,14 +47,14 @@ impl ProxyPad { let parent = parent.to_glib_none(); unsafe { from_glib(ffi::gst_proxy_pad_chain_list_default( - pad.to_glib_none().0, + pad.to_glib_none().0 as *mut ffi::GstPad, parent.0, list.into_ptr(), )) } } - pub fn getrange_default, Q: IsA>( + pub fn getrange_default, Q: IsA>( pad: &P, parent: &Q, offset: u64, @@ -64,7 +64,7 @@ impl ProxyPad { unsafe { let mut buffer = ptr::null_mut(); let ret = from_glib(ffi::gst_proxy_pad_getrange_default( - pad.to_glib_none().0, + pad.to_glib_none().0 as *mut ffi::GstPad, parent.to_glib_none().0, offset, size, @@ -80,7 +80,7 @@ impl ProxyPad { pub fn iterate_internal_links_default< 'a, - P: IsA, + P: IsA, Q: IsA + 'a, R: Into>, >( @@ -92,7 +92,7 @@ impl ProxyPad { let parent = parent.to_glib_none(); unsafe { from_glib_full(ffi::gst_proxy_pad_iterate_internal_links_default( - pad.to_glib_none().0, + pad.to_glib_none().0 as *mut ffi::GstPad, parent.0, )) }