2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
2017-07-29 13:19:15 +00:00
|
|
|
|
2020-11-21 13:46:48 +00:00
|
|
|
use crate::Buffer;
|
|
|
|
use crate::BufferList;
|
|
|
|
use crate::FlowError;
|
|
|
|
use crate::FlowReturn;
|
|
|
|
use crate::FlowSuccess;
|
|
|
|
use crate::Object;
|
|
|
|
use crate::Pad;
|
|
|
|
use crate::ProxyPad;
|
2018-04-25 08:10:06 +00:00
|
|
|
use std::ptr;
|
2017-07-29 13:19:15 +00:00
|
|
|
|
2019-01-16 11:32:58 +00:00
|
|
|
use glib::object::IsA;
|
2017-07-31 11:16:42 +00:00
|
|
|
use glib::translate::{from_glib, from_glib_full, ToGlibPtr};
|
2017-07-29 13:19:15 +00:00
|
|
|
|
2020-11-17 15:26:48 +00:00
|
|
|
pub trait ProxyPadExtManual: 'static {
|
|
|
|
fn chain_default<P: IsA<Object>>(
|
|
|
|
&self,
|
|
|
|
parent: Option<&P>,
|
|
|
|
buffer: Buffer,
|
|
|
|
) -> Result<FlowSuccess, FlowError>;
|
|
|
|
|
|
|
|
fn chain_list_default<P: IsA<Object>>(
|
|
|
|
&self,
|
|
|
|
parent: Option<&P>,
|
|
|
|
list: BufferList,
|
|
|
|
) -> Result<FlowSuccess, FlowError>;
|
|
|
|
|
|
|
|
fn getrange_default<P: IsA<Object>>(
|
|
|
|
&self,
|
|
|
|
parent: Option<&P>,
|
|
|
|
offset: u64,
|
|
|
|
size: u32,
|
|
|
|
) -> Result<Buffer, FlowError>;
|
|
|
|
|
|
|
|
fn iterate_internal_links_default<P: IsA<Object>>(
|
|
|
|
&self,
|
|
|
|
parent: Option<&P>,
|
2020-11-21 13:46:48 +00:00
|
|
|
) -> Option<crate::Iterator<Pad>>;
|
2020-11-17 15:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<ProxyPad>> ProxyPadExtManual for O {
|
|
|
|
fn chain_default<P: IsA<Object>>(
|
|
|
|
&self,
|
2019-05-23 20:28:07 +00:00
|
|
|
parent: Option<&P>,
|
2017-07-31 11:16:42 +00:00
|
|
|
buffer: Buffer,
|
2019-01-08 16:13:37 +00:00
|
|
|
) -> Result<FlowSuccess, FlowError> {
|
2017-07-29 13:19:15 +00:00
|
|
|
skip_assert_initialized!();
|
2019-01-08 16:13:37 +00:00
|
|
|
let ret: FlowReturn = unsafe {
|
2020-11-21 13:46:48 +00:00
|
|
|
from_glib(ffi::gst_proxy_pad_chain_default(
|
|
|
|
self.as_ptr() as *mut ffi::GstPad,
|
2019-01-16 11:32:58 +00:00
|
|
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
2017-07-31 11:16:42 +00:00
|
|
|
buffer.into_ptr(),
|
|
|
|
))
|
2019-01-08 16:13:37 +00:00
|
|
|
};
|
|
|
|
ret.into_result()
|
2017-07-29 13:19:15 +00:00
|
|
|
}
|
|
|
|
|
2020-11-17 15:26:48 +00:00
|
|
|
fn chain_list_default<P: IsA<Object>>(
|
|
|
|
&self,
|
2019-05-23 20:28:07 +00:00
|
|
|
parent: Option<&P>,
|
2017-08-14 19:21:11 +00:00
|
|
|
list: BufferList,
|
2019-01-08 16:13:37 +00:00
|
|
|
) -> Result<FlowSuccess, FlowError> {
|
2017-08-14 19:21:11 +00:00
|
|
|
skip_assert_initialized!();
|
2019-01-08 16:13:37 +00:00
|
|
|
let ret: FlowReturn = unsafe {
|
2020-11-21 13:46:48 +00:00
|
|
|
from_glib(ffi::gst_proxy_pad_chain_list_default(
|
|
|
|
self.as_ptr() as *mut ffi::GstPad,
|
2019-01-16 11:32:58 +00:00
|
|
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
2017-08-14 19:21:11 +00:00
|
|
|
list.into_ptr(),
|
|
|
|
))
|
2019-01-08 16:13:37 +00:00
|
|
|
};
|
|
|
|
ret.into_result()
|
2017-08-14 19:21:11 +00:00
|
|
|
}
|
|
|
|
|
2020-11-17 15:26:48 +00:00
|
|
|
fn getrange_default<P: IsA<Object>>(
|
|
|
|
&self,
|
2019-05-23 20:28:07 +00:00
|
|
|
parent: Option<&P>,
|
2017-07-31 11:16:42 +00:00
|
|
|
offset: u64,
|
|
|
|
size: u32,
|
2018-10-28 22:57:21 +00:00
|
|
|
) -> Result<Buffer, FlowError> {
|
2017-07-29 13:19:15 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
unsafe {
|
|
|
|
let mut buffer = ptr::null_mut();
|
2020-11-21 13:46:48 +00:00
|
|
|
let ret: FlowReturn = from_glib(ffi::gst_proxy_pad_getrange_default(
|
|
|
|
self.as_ptr() as *mut ffi::GstPad,
|
2019-05-23 20:28:07 +00:00
|
|
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
2017-07-31 11:16:42 +00:00
|
|
|
offset,
|
|
|
|
size,
|
|
|
|
&mut buffer,
|
|
|
|
));
|
2018-10-28 22:57:21 +00:00
|
|
|
ret.into_result_value(|| from_glib_full(buffer))
|
2017-07-29 13:19:15 +00:00
|
|
|
}
|
|
|
|
}
|
2017-09-17 15:41:02 +00:00
|
|
|
|
2020-11-17 15:26:48 +00:00
|
|
|
fn iterate_internal_links_default<P: IsA<Object>>(
|
|
|
|
&self,
|
2019-05-23 20:28:07 +00:00
|
|
|
parent: Option<&P>,
|
2020-11-21 13:46:48 +00:00
|
|
|
) -> Option<crate::Iterator<Pad>> {
|
2017-09-17 15:41:02 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
unsafe {
|
2020-11-21 13:46:48 +00:00
|
|
|
from_glib_full(ffi::gst_proxy_pad_iterate_internal_links_default(
|
|
|
|
self.as_ptr() as *mut ffi::GstPad,
|
2019-01-16 11:32:58 +00:00
|
|
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
2017-10-17 09:06:51 +00:00
|
|
|
))
|
2017-09-17 15:41:02 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-29 13:19:15 +00:00
|
|
|
}
|