From dc703cc6e9d42cc2307cb5fcbba8547b849175ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 14 Aug 2017 22:21:11 +0300 Subject: [PATCH] Add push_list/chain_list functions to Pad --- gstreamer/src/pad.rs | 11 +++++++++++ gstreamer/src/proxy_pad.rs | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index e620d02c6..85c952ed8 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -84,6 +84,9 @@ pub trait PadExtManual { fn chain(&self, buffer: Buffer) -> FlowReturn; fn push(&self, buffer: Buffer) -> FlowReturn; + fn chain_list(&self, list: BufferList) -> FlowReturn; + fn push_list(&self, list: BufferList) -> FlowReturn; + fn pull_range(&self, offset: u64, size: u32) -> Result; fn get_range(&self, offset: u64, size: u32) -> Result; @@ -140,6 +143,14 @@ impl> PadExtManual for O { unsafe { from_glib(ffi::gst_pad_push(self.to_glib_none().0, buffer.into_ptr())) } } + fn chain_list(&self, list: BufferList) -> FlowReturn { + unsafe { from_glib(ffi::gst_pad_chain_list(self.to_glib_none().0, list.into_ptr())) } + } + + fn push_list(&self, list: BufferList) -> FlowReturn { + unsafe { from_glib(ffi::gst_pad_push_list(self.to_glib_none().0, list.into_ptr())) } + } + fn get_range(&self, offset: u64, size: u32) -> Result { unsafe { let mut buffer = ptr::null_mut(); diff --git a/gstreamer/src/proxy_pad.rs b/gstreamer/src/proxy_pad.rs index c7fe46527..04d3f8481 100644 --- a/gstreamer/src/proxy_pad.rs +++ b/gstreamer/src/proxy_pad.rs @@ -12,6 +12,7 @@ use ProxyPad; use Object; use FlowReturn; use Buffer; +use BufferList; use glib::IsA; use glib::translate::{from_glib, from_glib_full, ToGlibPtr}; @@ -36,6 +37,23 @@ impl ProxyPad { } } + pub fn chain_list_default<'a, P: IsA, Q: IsA + 'a, R: Into>>( + pad: &P, + parent: R, + list: BufferList, + ) -> FlowReturn { + skip_assert_initialized!(); + let parent = parent.into(); + let parent = parent.to_glib_none(); + unsafe { + from_glib(ffi::gst_proxy_pad_chain_list_default( + pad.to_glib_none().0, + parent.0, + list.into_ptr(), + )) + } + } + pub fn getrange_default, Q: IsA>( pad: &P, parent: &Q,