Call the parent impl of various vfuncs if not overridden

This was forgotten for a few types and would require each subclass to
implement them, even if a parent class already provided an
implementation.
This commit is contained in:
Sebastian Dröge 2020-06-30 23:43:13 +03:00
parent dbc76f1053
commit cc866b53d0
4 changed files with 12 additions and 4 deletions

View file

@ -37,7 +37,9 @@ pub trait AudioSinkImpl: AudioSinkImplExt + BaseSinkImpl + Send + Sync + 'static
self.parent_unprepare(sink) self.parent_unprepare(sink)
} }
fn write(&self, sink: &AudioSink, audio_data: &[u8]) -> Result<i32, LoggableError>; fn write(&self, sink: &AudioSink, audio_data: &[u8]) -> Result<i32, LoggableError> {
self.parent_write(sink, audio_data)
}
} }
pub trait AudioSinkImplExt { pub trait AudioSinkImplExt {

View file

@ -39,7 +39,9 @@ pub trait AudioSrcImpl: AudioSrcImplExt + BaseSrcImpl + Send + Sync + 'static {
&self, &self,
src: &AudioSrc, src: &AudioSrc,
audio_data: &mut [u8], audio_data: &mut [u8],
) -> Result<(u32, gst::ClockTime), LoggableError>; ) -> Result<(u32, gst::ClockTime), LoggableError> {
self.parent_read(src, audio_data)
}
} }
pub trait AudioSrcImplExt { pub trait AudioSrcImplExt {

View file

@ -103,7 +103,9 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl + Send + Sync + 'stati
&self, &self,
aggregator: &Aggregator, aggregator: &Aggregator,
timeout: bool, timeout: bool,
) -> Result<gst::FlowSuccess, gst::FlowError>; ) -> Result<gst::FlowSuccess, gst::FlowError> {
self.parent_aggregate(aggregator, timeout)
}
fn start(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> { fn start(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> {
self.parent_start(aggregator) self.parent_start(aggregator)

View file

@ -49,7 +49,9 @@ pub trait BaseParseImpl: BaseParseImplExt + ElementImpl + Send + Sync + 'static
element: &BaseParse, element: &BaseParse,
src_val: V, src_val: V,
dest_format: gst::Format, dest_format: gst::Format,
) -> Option<gst::GenericFormattedValue>; ) -> Option<gst::GenericFormattedValue> {
self.parent_convert(element, src_val, dest_format)
}
} }
pub trait BaseParseImplExt { pub trait BaseParseImplExt {