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