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
|
|
|
|
2018-04-25 08:10:06 +00:00
|
|
|
use std::ptr;
|
2017-07-29 13:19:15 +00:00
|
|
|
|
2023-01-03 18:58:25 +00:00
|
|
|
use glib::{prelude::*, translate::*};
|
|
|
|
|
|
|
|
use crate::{Buffer, BufferList, FlowError, FlowSuccess, Pad, ProxyPad};
|
2017-07-29 13:19:15 +00:00
|
|
|
|
2022-10-12 14:27:04 +00:00
|
|
|
impl ProxyPad {
|
2021-05-19 20:35:47 +00:00
|
|
|
#[doc(alias = "gst_proxy_pad_chain_default")]
|
2022-10-12 14:27:04 +00:00
|
|
|
pub fn chain_default<O: IsA<ProxyPad>>(
|
|
|
|
pad: &O,
|
|
|
|
parent: Option<&impl IsA<crate::Object>>,
|
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!();
|
2021-04-28 12:34:56 +00:00
|
|
|
unsafe {
|
2021-05-13 12:54:41 +00:00
|
|
|
try_from_glib(ffi::gst_proxy_pad_chain_default(
|
2022-10-12 14:27:04 +00:00
|
|
|
pad.as_ptr() as *mut ffi::GstPad,
|
2019-01-16 11:32:58 +00:00
|
|
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
2022-05-06 19:41:15 +00:00
|
|
|
buffer.into_glib_ptr(),
|
2017-07-31 11:16:42 +00:00
|
|
|
))
|
2021-04-28 12:34:56 +00:00
|
|
|
}
|
2017-07-29 13:19:15 +00:00
|
|
|
}
|
|
|
|
|
2022-10-12 14:27:04 +00:00
|
|
|
#[doc(alias = "gst_proxy_pad_chain_list_default")]
|
|
|
|
pub fn chain_list_default<O: IsA<ProxyPad>>(
|
|
|
|
pad: &O,
|
|
|
|
parent: Option<&impl IsA<crate::Object>>,
|
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!();
|
2021-04-28 12:34:56 +00:00
|
|
|
unsafe {
|
2021-05-13 12:54:41 +00:00
|
|
|
try_from_glib(ffi::gst_proxy_pad_chain_list_default(
|
2022-10-12 14:27:04 +00:00
|
|
|
pad.as_ptr() as *mut ffi::GstPad,
|
2019-01-16 11:32:58 +00:00
|
|
|
parent.map(|p| p.as_ref()).to_glib_none().0,
|
2022-05-06 19:41:15 +00:00
|
|
|
list.into_glib_ptr(),
|
2017-08-14 19:21:11 +00:00
|
|
|
))
|
2021-04-28 12:34:56 +00:00
|
|
|
}
|
2017-08-14 19:21:11 +00:00
|
|
|
}
|
|
|
|
|
2022-10-12 14:27:04 +00:00
|
|
|
#[doc(alias = "gst_proxy_pad_getrange_default")]
|
|
|
|
pub fn getrange_default<O: IsA<ProxyPad>>(
|
|
|
|
pad: &O,
|
|
|
|
parent: Option<&impl IsA<crate::Object>>,
|
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();
|
2021-04-28 12:34:56 +00:00
|
|
|
FlowSuccess::try_from_glib(ffi::gst_proxy_pad_getrange_default(
|
2022-10-12 14:27:04 +00:00
|
|
|
pad.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,
|
2021-04-28 12:34:56 +00:00
|
|
|
))
|
|
|
|
.map(|_| from_glib_full(buffer))
|
2017-07-29 13:19:15 +00:00
|
|
|
}
|
|
|
|
}
|
2017-09-17 15:41:02 +00:00
|
|
|
|
2022-10-12 14:27:04 +00:00
|
|
|
#[doc(alias = "gst_proxy_pad_iterate_internal_links_default")]
|
|
|
|
pub fn iterate_internal_links_default<O: IsA<ProxyPad>>(
|
|
|
|
pad: &O,
|
|
|
|
parent: Option<&impl IsA<crate::Object>>,
|
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(
|
2022-10-12 14:27:04 +00:00
|
|
|
pad.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
|
|
|
}
|