2022-04-13 13:38:59 +00:00
|
|
|
use crate::RTPBaseDepayload;
|
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::translate::*;
|
|
|
|
|
|
|
|
pub trait RTPBaseDepayloadExtManual: 'static {
|
|
|
|
#[doc(alias = "gst_rtp_base_depayload_push")]
|
|
|
|
fn push(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError>;
|
|
|
|
|
|
|
|
#[doc(alias = "gst_rtp_base_depayload_push_list")]
|
|
|
|
fn push_list(&self, list: gst::BufferList) -> Result<gst::FlowSuccess, gst::FlowError>;
|
2022-05-03 22:04:08 +00:00
|
|
|
|
2022-05-05 10:24:46 +00:00
|
|
|
fn sink_pad(&self) -> &gst::Pad;
|
2022-05-03 22:04:08 +00:00
|
|
|
|
2022-05-05 10:24:46 +00:00
|
|
|
fn src_pad(&self) -> &gst::Pad;
|
2022-04-13 13:38:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<RTPBaseDepayload>> RTPBaseDepayloadExtManual for O {
|
|
|
|
fn push(&self, out_buf: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
|
|
|
|
unsafe {
|
|
|
|
try_from_glib(ffi::gst_rtp_base_depayload_push(
|
|
|
|
self.as_ref().to_glib_none().0,
|
2022-05-06 19:41:15 +00:00
|
|
|
out_buf.into_glib_ptr(),
|
2022-04-13 13:38:59 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn push_list(&self, out_list: gst::BufferList) -> Result<gst::FlowSuccess, gst::FlowError> {
|
|
|
|
unsafe {
|
|
|
|
try_from_glib(ffi::gst_rtp_base_depayload_push_list(
|
|
|
|
self.as_ref().to_glib_none().0,
|
2022-05-06 19:41:15 +00:00
|
|
|
out_list.into_glib_ptr(),
|
2022-04-13 13:38:59 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
2022-05-03 22:04:08 +00:00
|
|
|
|
2022-05-05 10:24:46 +00:00
|
|
|
fn sink_pad(&self) -> &gst::Pad {
|
2022-05-03 22:04:08 +00:00
|
|
|
unsafe {
|
2022-05-05 10:24:46 +00:00
|
|
|
let elt = &*(self.as_ptr() as *const ffi::GstRTPBaseDepayload);
|
|
|
|
&*(&elt.sinkpad as *const *mut gst::ffi::GstPad as *const gst::Pad)
|
2022-05-03 22:04:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-05 10:24:46 +00:00
|
|
|
fn src_pad(&self) -> &gst::Pad {
|
2022-05-03 22:04:08 +00:00
|
|
|
unsafe {
|
2022-05-05 10:24:46 +00:00
|
|
|
let elt = &*(self.as_ptr() as *const ffi::GstRTPBaseDepayload);
|
|
|
|
&*(&elt.srcpad as *const *mut gst::ffi::GstPad as *const gst::Pad)
|
2022-05-03 22:04:08 +00:00
|
|
|
}
|
|
|
|
}
|
2022-04-13 13:38:59 +00:00
|
|
|
}
|