aggregator: Mark src_pad() return type as an AggregatorPad

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1236>
This commit is contained in:
Arun Raghavan 2023-03-09 22:56:01 -05:00
parent 368e1cacb6
commit 273f084c06

View file

@ -15,6 +15,7 @@ use glib::{prelude::*, translate::*};
use gst::{format::FormattedValue, prelude::*};
use crate::Aggregator;
use crate::AggregatorPad;
pub trait AggregatorExtManual: 'static {
#[doc(alias = "get_allocator")]
@ -77,7 +78,7 @@ pub trait AggregatorExtManual: 'static {
f: F,
) -> SignalHandlerId;
fn src_pad(&self) -> &gst::Pad;
fn src_pad(&self) -> &AggregatorPad;
}
impl<O: IsA<Aggregator>> AggregatorExtManual for O {
@ -242,10 +243,10 @@ impl<O: IsA<Aggregator>> AggregatorExtManual for O {
}
}
fn src_pad(&self) -> &gst::Pad {
fn src_pad(&self) -> &AggregatorPad {
unsafe {
let elt = &*(self.as_ptr() as *const ffi::GstAggregator);
&*(&elt.srcpad as *const *mut gst::ffi::GstPad as *const gst::Pad)
&*(&elt.srcpad as *const *mut gst::ffi::GstPad as *const AggregatorPad)
}
}
}