gstreamer-audio/video: Make allocator optional in get_allocator() functions for encoder/decoder base classes

They can be and are often None.
This commit is contained in:
Sebastian Dröge 2020-03-29 22:37:01 +03:00
parent 0b0544da63
commit 0651bfb51b
4 changed files with 8 additions and 8 deletions

View file

@ -49,7 +49,7 @@ pub trait AudioDecoderExtManual: 'static {
fn set_output_format(&self, info: &AudioInfo) -> Result<(), gst::FlowError>;
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams);
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
#[allow(clippy::too_many_arguments)]
fn error<T: gst::MessageErrorDomain>(
@ -136,7 +136,7 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExtManual for O {
}
}
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams) {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe {
let mut allocator = ptr::null_mut();
let mut params = mem::zeroed();

View file

@ -25,7 +25,7 @@ pub trait AudioEncoderExtManual: 'static {
fn set_output_format(&self, caps: &gst::Caps) -> Result<(), gst::FlowError>;
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams);
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime);
}
@ -73,7 +73,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExtManual for O {
}
}
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams) {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe {
let mut allocator = ptr::null_mut();
let mut params = mem::zeroed();

View file

@ -47,7 +47,7 @@ pub trait VideoDecoderExtManual: 'static {
fn get_frames(&self) -> Vec<VideoCodecFrame>;
fn get_oldest_frame(&self) -> Option<VideoCodecFrame>;
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams);
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn have_frame(&self) -> Result<gst::FlowSuccess, gst::FlowError>;
fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
@ -113,7 +113,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
ret.into_result()
}
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams) {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe {
let mut allocator = ptr::null_mut();
let mut params = mem::zeroed();

View file

@ -31,7 +31,7 @@ pub trait VideoEncoderExtManual: 'static {
fn get_frames(&self) -> Vec<VideoCodecFrame>;
fn get_oldest_frame(&self) -> Option<VideoCodecFrame>;
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams);
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn finish_frame(
&self,
@ -71,7 +71,7 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
ret.into_result()
}
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams) {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe {
let mut allocator = ptr::null_mut();
let mut params = mem::zeroed();