2023-01-03 19:08:39 +00:00
|
|
|
use glib::object::IsA;
|
2023-01-03 18:58:25 +00:00
|
|
|
|
2022-04-13 13:38:59 +00:00
|
|
|
use crate::RTPBaseDepayload;
|
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::IsA<super::RTPBaseDepayload>> Sealed for T {}
|
2022-04-13 13:38:59 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
pub trait RTPBaseDepayloadExtManual: sealed::Sealed + IsA<RTPBaseDepayload> + 'static {
|
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
|
|
|
}
|
2023-07-05 20:21:43 +00:00
|
|
|
|
|
|
|
impl<O: IsA<RTPBaseDepayload>> RTPBaseDepayloadExtManual for O {}
|