mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 17:41:05 +00:00
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:
parent
0b0544da63
commit
0651bfb51b
4 changed files with 8 additions and 8 deletions
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue