mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-28 12:32:04 +00:00
gstreamer/proxypad: Convert default pad functions to plain functions on ProxyPad instead of a trait
This allows to use them properly when overriding these functions.
This commit is contained in:
parent
47cc80b1ef
commit
834b6d8d69
2 changed files with 13 additions and 41 deletions
|
@ -206,7 +206,6 @@ mod object;
|
||||||
mod pad;
|
mod pad;
|
||||||
mod parse_context;
|
mod parse_context;
|
||||||
mod proxy_pad;
|
mod proxy_pad;
|
||||||
pub use proxy_pad::ProxyPadExtManual;
|
|
||||||
mod tag_setter;
|
mod tag_setter;
|
||||||
pub use bin::GstBinExtManual;
|
pub use bin::GstBinExtManual;
|
||||||
pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId};
|
pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId};
|
||||||
|
@ -368,7 +367,6 @@ pub mod prelude {
|
||||||
pub use pipeline::GstPipelineExtManual;
|
pub use pipeline::GstPipelineExtManual;
|
||||||
pub use plugin::GstPluginExtManual;
|
pub use plugin::GstPluginExtManual;
|
||||||
pub use plugin_feature::PluginFeatureExtManual;
|
pub use plugin_feature::PluginFeatureExtManual;
|
||||||
pub use proxy_pad::ProxyPadExtManual;
|
|
||||||
pub use tag_setter::TagSetterExtManual;
|
pub use tag_setter::TagSetterExtManual;
|
||||||
pub use typefind::TypeFindImpl;
|
pub use typefind::TypeFindImpl;
|
||||||
pub use value::GstValueExt;
|
pub use value::GstValueExt;
|
||||||
|
|
|
@ -21,42 +21,16 @@ use glib::translate::{from_glib, from_glib_full, ToGlibPtr};
|
||||||
|
|
||||||
use gst_sys;
|
use gst_sys;
|
||||||
|
|
||||||
pub trait ProxyPadExtManual: 'static {
|
impl ProxyPad {
|
||||||
fn proxy_pad_chain_default<P: IsA<Object>>(
|
pub fn chain_default<O: IsA<ProxyPad>, P: IsA<Object>>(
|
||||||
&self,
|
pad: &O,
|
||||||
parent: Option<&P>,
|
|
||||||
buffer: Buffer,
|
|
||||||
) -> Result<FlowSuccess, FlowError>;
|
|
||||||
|
|
||||||
fn proxy_pad_chain_list_default<P: IsA<Object>>(
|
|
||||||
&self,
|
|
||||||
parent: Option<&P>,
|
|
||||||
list: BufferList,
|
|
||||||
) -> Result<FlowSuccess, FlowError>;
|
|
||||||
|
|
||||||
fn proxy_pad_getrange_default<P: IsA<Object>>(
|
|
||||||
&self,
|
|
||||||
parent: Option<&P>,
|
|
||||||
offset: u64,
|
|
||||||
size: u32,
|
|
||||||
) -> Result<Buffer, FlowError>;
|
|
||||||
|
|
||||||
fn proxy_pad_iterate_internal_links_default<P: IsA<Object>>(
|
|
||||||
&self,
|
|
||||||
parent: Option<&P>,
|
|
||||||
) -> Option<::Iterator<Pad>>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<O: IsA<ProxyPad>> ProxyPadExtManual for O {
|
|
||||||
fn proxy_pad_chain_default<P: IsA<Object>>(
|
|
||||||
&self,
|
|
||||||
parent: Option<&P>,
|
parent: Option<&P>,
|
||||||
buffer: Buffer,
|
buffer: Buffer,
|
||||||
) -> Result<FlowSuccess, FlowError> {
|
) -> Result<FlowSuccess, FlowError> {
|
||||||
skip_assert_initialized!();
|
skip_assert_initialized!();
|
||||||
let ret: FlowReturn = unsafe {
|
let ret: FlowReturn = unsafe {
|
||||||
from_glib(gst_sys::gst_proxy_pad_chain_default(
|
from_glib(gst_sys::gst_proxy_pad_chain_default(
|
||||||
self.as_ptr() as *mut gst_sys::GstPad,
|
pad.as_ptr() as *mut gst_sys::GstPad,
|
||||||
parent.map(|p| p.as_ref()).to_glib_none().0,
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
||||||
buffer.into_ptr(),
|
buffer.into_ptr(),
|
||||||
))
|
))
|
||||||
|
@ -64,15 +38,15 @@ impl<O: IsA<ProxyPad>> ProxyPadExtManual for O {
|
||||||
ret.into_result()
|
ret.into_result()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn proxy_pad_chain_list_default<P: IsA<Object>>(
|
pub fn chain_list_default<O: IsA<ProxyPad>, P: IsA<Object>>(
|
||||||
&self,
|
pad: &O,
|
||||||
parent: Option<&P>,
|
parent: Option<&P>,
|
||||||
list: BufferList,
|
list: BufferList,
|
||||||
) -> Result<FlowSuccess, FlowError> {
|
) -> Result<FlowSuccess, FlowError> {
|
||||||
skip_assert_initialized!();
|
skip_assert_initialized!();
|
||||||
let ret: FlowReturn = unsafe {
|
let ret: FlowReturn = unsafe {
|
||||||
from_glib(gst_sys::gst_proxy_pad_chain_list_default(
|
from_glib(gst_sys::gst_proxy_pad_chain_list_default(
|
||||||
self.as_ptr() as *mut gst_sys::GstPad,
|
pad.as_ptr() as *mut gst_sys::GstPad,
|
||||||
parent.map(|p| p.as_ref()).to_glib_none().0,
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
||||||
list.into_ptr(),
|
list.into_ptr(),
|
||||||
))
|
))
|
||||||
|
@ -80,8 +54,8 @@ impl<O: IsA<ProxyPad>> ProxyPadExtManual for O {
|
||||||
ret.into_result()
|
ret.into_result()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn proxy_pad_getrange_default<P: IsA<Object>>(
|
pub fn getrange_default<O: IsA<ProxyPad>, P: IsA<Object>>(
|
||||||
&self,
|
pad: &O,
|
||||||
parent: Option<&P>,
|
parent: Option<&P>,
|
||||||
offset: u64,
|
offset: u64,
|
||||||
size: u32,
|
size: u32,
|
||||||
|
@ -90,7 +64,7 @@ impl<O: IsA<ProxyPad>> ProxyPadExtManual for O {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut buffer = ptr::null_mut();
|
let mut buffer = ptr::null_mut();
|
||||||
let ret: FlowReturn = from_glib(gst_sys::gst_proxy_pad_getrange_default(
|
let ret: FlowReturn = from_glib(gst_sys::gst_proxy_pad_getrange_default(
|
||||||
self.as_ptr() as *mut gst_sys::GstPad,
|
pad.as_ptr() as *mut gst_sys::GstPad,
|
||||||
parent.map(|p| p.as_ref()).to_glib_none().0,
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
||||||
offset,
|
offset,
|
||||||
size,
|
size,
|
||||||
|
@ -100,14 +74,14 @@ impl<O: IsA<ProxyPad>> ProxyPadExtManual for O {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn proxy_pad_iterate_internal_links_default<P: IsA<Object>>(
|
pub fn iterate_internal_links_default<O: IsA<ProxyPad>, P: IsA<Object>>(
|
||||||
&self,
|
pad: &O,
|
||||||
parent: Option<&P>,
|
parent: Option<&P>,
|
||||||
) -> Option<::Iterator<Pad>> {
|
) -> Option<::Iterator<Pad>> {
|
||||||
skip_assert_initialized!();
|
skip_assert_initialized!();
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(gst_sys::gst_proxy_pad_iterate_internal_links_default(
|
from_glib_full(gst_sys::gst_proxy_pad_iterate_internal_links_default(
|
||||||
self.as_ptr() as *mut gst_sys::GstPad,
|
pad.as_ptr() as *mut gst_sys::GstPad,
|
||||||
parent.map(|p| p.as_ref()).to_glib_none().0,
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue