diff --git a/gstreamer/src/ghost_pad.rs b/gstreamer/src/ghost_pad.rs index 7ee4b0a07..a93aef4c9 100644 --- a/gstreamer/src/ghost_pad.rs +++ b/gstreamer/src/ghost_pad.rs @@ -5,7 +5,6 @@ use crate::FlowError; use crate::FlowSuccess; use crate::GhostPad; use crate::LoggableError; -use crate::Object; use crate::Pad; use crate::PadBuilder; use crate::PadFlags; @@ -16,9 +15,9 @@ use glib::translate::*; impl GhostPad { #[doc(alias = "gst_ghost_pad_activate_mode_default")] - pub fn activate_mode_default, Q: IsA>( + pub fn activate_mode_default>( pad: &P, - parent: Option<&Q>, + parent: Option<&impl IsA>, mode: PadMode, active: bool, ) -> Result<(), glib::BoolError> { @@ -37,9 +36,9 @@ impl GhostPad { } #[doc(alias = "gst_ghost_pad_internal_activate_mode_default")] - pub fn internal_activate_mode_default, Q: IsA>( + pub fn internal_activate_mode_default>( pad: &P, - parent: Option<&Q>, + parent: Option<&impl IsA>, mode: PadMode, active: bool, ) -> Result<(), glib::BoolError> { diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index 40f67a48f..98605a50d 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -324,7 +324,6 @@ pub mod prelude { pub use crate::pipeline::GstPipelineExtManual; pub use crate::plugin::GstPluginExtManual; pub use crate::plugin_feature::PluginFeatureExtManual; - pub use crate::proxy_pad::ProxyPadExtManual; pub use crate::tag_setter::TagSetterExtManual; pub use crate::task_pool::{TaskHandle, TaskPoolExtManual}; pub use crate::typefind::TypeFindImpl; diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 3b260fd0a..c18434a6f 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -143,22 +143,10 @@ pub trait PadExtManual: 'static { fn peer_query(&self, query: &mut QueryRef) -> bool; #[doc(alias = "gst_pad_query")] fn query(&self, query: &mut QueryRef) -> bool; - #[doc(alias = "gst_pad_query_default")] - fn query_default>( - &self, - parent: Option<&P>, - query: &mut QueryRef, - ) -> bool; fn proxy_query_caps(&self, query: &mut QueryRef) -> bool; #[doc(alias = "gst_pad_proxy_query_accept_caps")] fn proxy_query_accept_caps(&self, query: &mut QueryRef) -> bool; - #[doc(alias = "gst_pad_event_default")] - fn event_default>( - &self, - parent: Option<&P>, - event: impl Into, - ) -> bool; #[doc(alias = "gst_pad_push_event")] fn push_event(&self, event: impl Into) -> bool; #[doc(alias = "gst_pad_send_event")] @@ -166,11 +154,6 @@ pub trait PadExtManual: 'static { #[doc(alias = "gst_pad_iterate_internal_links")] fn iterate_internal_links(&self) -> crate::Iterator; - #[doc(alias = "gst_pad_iterate_internal_links_default")] - fn iterate_internal_links_default>( - &self, - parent: Option<&P>, - ) -> crate::Iterator; fn stream_lock(&self) -> StreamLock; @@ -502,21 +485,6 @@ impl> PadExtManual for O { } } - fn query_default>( - &self, - parent: Option<&P>, - query: &mut QueryRef, - ) -> bool { - skip_assert_initialized!(); - unsafe { - from_glib(ffi::gst_pad_query_default( - self.as_ref().to_glib_none().0, - parent.map(|p| p.as_ref()).to_glib_none().0, - query.as_mut_ptr(), - )) - } - } - fn proxy_query_accept_caps(&self, query: &mut QueryRef) -> bool { unsafe { from_glib(ffi::gst_pad_proxy_query_accept_caps( @@ -535,21 +503,6 @@ impl> PadExtManual for O { } } - fn event_default>( - &self, - parent: Option<&P>, - event: impl Into, - ) -> bool { - skip_assert_initialized!(); - unsafe { - from_glib(ffi::gst_pad_event_default( - self.as_ref().to_glib_none().0, - parent.map(|p| p.as_ref()).to_glib_none().0, - event.into().into_glib_ptr(), - )) - } - } - fn push_event(&self, event: impl Into) -> bool { unsafe { from_glib(ffi::gst_pad_push_event( @@ -576,18 +529,6 @@ impl> PadExtManual for O { } } - fn iterate_internal_links_default>( - &self, - parent: Option<&P>, - ) -> crate::Iterator { - unsafe { - from_glib_full(ffi::gst_pad_iterate_internal_links_default( - self.as_ref().to_glib_none().0, - parent.map(|p| p.as_ref()).to_glib_none().0, - )) - } - } - fn stream_lock(&self) -> StreamLock { unsafe { let ptr: &mut ffi::GstPad = &mut *(self.as_ptr() as *mut _); @@ -1652,6 +1593,52 @@ impl Pad { skip_assert_initialized!(); PadBuilder::from_template(templ, name) } + + #[doc(alias = "gst_pad_query_default")] + pub fn query_default>( + pad: &O, + parent: Option<&impl IsA>, + query: &mut QueryRef, + ) -> bool { + skip_assert_initialized!(); + unsafe { + from_glib(ffi::gst_pad_query_default( + pad.as_ref().to_glib_none().0, + parent.map(|p| p.as_ref()).to_glib_none().0, + query.as_mut_ptr(), + )) + } + } + + #[doc(alias = "gst_pad_event_default")] + pub fn event_default>( + pad: &O, + parent: Option<&impl IsA>, + event: impl Into, + ) -> bool { + skip_assert_initialized!(); + unsafe { + from_glib(ffi::gst_pad_event_default( + pad.as_ref().to_glib_none().0, + parent.map(|p| p.as_ref()).to_glib_none().0, + event.into().into_glib_ptr(), + )) + } + } + + #[doc(alias = "gst_pad_iterate_internal_links_default")] + pub fn iterate_internal_links_default>( + pad: &O, + parent: Option<&impl IsA>, + ) -> crate::Iterator { + skip_assert_initialized!(); + unsafe { + from_glib_full(ffi::gst_pad_iterate_internal_links_default( + pad.as_ref().to_glib_none().0, + parent.map(|p| p.as_ref()).to_glib_none().0, + )) + } + } } #[must_use = "The builder must be built to be used"] diff --git a/gstreamer/src/proxy_pad.rs b/gstreamer/src/proxy_pad.rs index 21b3a1c13..86bdc32e7 100644 --- a/gstreamer/src/proxy_pad.rs +++ b/gstreamer/src/proxy_pad.rs @@ -4,7 +4,6 @@ use crate::Buffer; use crate::BufferList; use crate::FlowError; use crate::FlowSuccess; -use crate::Object; use crate::Pad; use crate::ProxyPad; use std::ptr; @@ -12,70 +11,43 @@ use std::ptr; use glib::prelude::*; use glib::translate::*; -pub trait ProxyPadExtManual: 'static { +impl ProxyPad { #[doc(alias = "gst_proxy_pad_chain_default")] - fn chain_default>( - &self, - parent: Option<&P>, - buffer: Buffer, - ) -> Result; - - #[doc(alias = "gst_proxy_pad_chain_list_default")] - fn chain_list_default>( - &self, - parent: Option<&P>, - list: BufferList, - ) -> Result; - - #[doc(alias = "gst_proxy_pad_getrange_default")] - fn getrange_default>( - &self, - parent: Option<&P>, - offset: u64, - size: u32, - ) -> Result; - - #[doc(alias = "gst_proxy_pad_iterate_internal_links_default")] - fn iterate_internal_links_default>( - &self, - parent: Option<&P>, - ) -> Option>; -} - -impl> ProxyPadExtManual for O { - fn chain_default>( - &self, - parent: Option<&P>, + pub fn chain_default>( + pad: &O, + parent: Option<&impl IsA>, buffer: Buffer, ) -> Result { skip_assert_initialized!(); unsafe { try_from_glib(ffi::gst_proxy_pad_chain_default( - self.as_ptr() as *mut ffi::GstPad, + pad.as_ptr() as *mut ffi::GstPad, parent.map(|p| p.as_ref()).to_glib_none().0, buffer.into_glib_ptr(), )) } } - fn chain_list_default>( - &self, - parent: Option<&P>, + #[doc(alias = "gst_proxy_pad_chain_list_default")] + pub fn chain_list_default>( + pad: &O, + parent: Option<&impl IsA>, list: BufferList, ) -> Result { skip_assert_initialized!(); unsafe { try_from_glib(ffi::gst_proxy_pad_chain_list_default( - self.as_ptr() as *mut ffi::GstPad, + pad.as_ptr() as *mut ffi::GstPad, parent.map(|p| p.as_ref()).to_glib_none().0, list.into_glib_ptr(), )) } } - fn getrange_default>( - &self, - parent: Option<&P>, + #[doc(alias = "gst_proxy_pad_getrange_default")] + pub fn getrange_default>( + pad: &O, + parent: Option<&impl IsA>, offset: u64, size: u32, ) -> Result { @@ -83,7 +55,7 @@ impl> ProxyPadExtManual for O { unsafe { let mut buffer = ptr::null_mut(); FlowSuccess::try_from_glib(ffi::gst_proxy_pad_getrange_default( - self.as_ptr() as *mut ffi::GstPad, + pad.as_ptr() as *mut ffi::GstPad, parent.map(|p| p.as_ref()).to_glib_none().0, offset, size, @@ -93,14 +65,15 @@ impl> ProxyPadExtManual for O { } } - fn iterate_internal_links_default>( - &self, - parent: Option<&P>, + #[doc(alias = "gst_proxy_pad_iterate_internal_links_default")] + pub fn iterate_internal_links_default>( + pad: &O, + parent: Option<&impl IsA>, ) -> Option> { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gst_proxy_pad_iterate_internal_links_default( - self.as_ptr() as *mut ffi::GstPad, + pad.as_ptr() as *mut ffi::GstPad, parent.map(|p| p.as_ref()).to_glib_none().0, )) }