Add push_list/chain_list functions to Pad

This commit is contained in:
Sebastian Dröge 2017-08-14 22:21:11 +03:00
parent de98b8039e
commit dc703cc6e9
2 changed files with 29 additions and 0 deletions

View file

@ -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<Buffer, FlowReturn>;
fn get_range(&self, offset: u64, size: u32) -> Result<Buffer, FlowReturn>;
@ -140,6 +143,14 @@ impl<O: IsA<Pad>> 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<Buffer, FlowReturn> {
unsafe {
let mut buffer = ptr::null_mut();

View file

@ -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<Pad>, Q: IsA<Object> + 'a, R: Into<Option<&'a Q>>>(
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<P: IsA<Pad>, Q: IsA<Object>>(
pad: &P,
parent: &Q,