From 1348127ca8f928ec00acc71b8f801379caaf67e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 14 Sep 2019 11:05:55 +0300 Subject: [PATCH] audio/video: proxy_getcaps() can't return None and get_caps() vfuncs must not return None --- Gir_GstAudio.toml | 10 ++++++++++ Gir_GstVideo.toml | 10 ++++++++++ gstreamer-audio/src/auto/audio_decoder.rs | 12 ++---------- gstreamer-audio/src/auto/audio_encoder.rs | 12 ++---------- gstreamer-audio/src/subclass/audio_decoder.rs | 16 ++++------------ gstreamer-audio/src/subclass/audio_encoder.rs | 16 ++++------------ gstreamer-video/src/auto/video_decoder.rs | 12 ++---------- gstreamer-video/src/auto/video_encoder.rs | 12 ++---------- gstreamer-video/src/subclass/video_decoder.rs | 16 ++++------------ gstreamer-video/src/subclass/video_encoder.rs | 16 ++++------------ 10 files changed, 44 insertions(+), 88 deletions(-) diff --git a/Gir_GstAudio.toml b/Gir_GstAudio.toml index c18f6a029..607e2c572 100644 --- a/Gir_GstAudio.toml +++ b/Gir_GstAudio.toml @@ -163,6 +163,11 @@ status = "generate" name = "get_allocator" ignore = true + [[object.function]] + name = "proxy_getcaps" + [object.function.return] + nullable = false + [[object]] name = "GstAudio.AudioEncoder" status = "generate" @@ -186,3 +191,8 @@ status = "generate" [[object.function]] name = "get_latency" ignore = true + + [[object.function]] + name = "proxy_getcaps" + [object.function.return] + nullable = false diff --git a/Gir_GstVideo.toml b/Gir_GstVideo.toml index 9c6b3724d..ab1da807a 100644 --- a/Gir_GstVideo.toml +++ b/Gir_GstVideo.toml @@ -155,6 +155,11 @@ status = "generate" name = "get_allocator" ignore = true + [[object.function]] + name = "proxy_getcaps" + [object.function.return] + nullable = false + [[object]] name = "GstVideo.VideoEncoder" status = "generate" @@ -206,3 +211,8 @@ status = "generate" [[object.function]] name = "get_allocator" ignore = true + + [[object.function]] + name = "proxy_getcaps" + [object.function.return] + nullable = false diff --git a/gstreamer-audio/src/auto/audio_decoder.rs b/gstreamer-audio/src/auto/audio_decoder.rs index b056aea75..3ef670638 100644 --- a/gstreamer-audio/src/auto/audio_decoder.rs +++ b/gstreamer-audio/src/auto/audio_decoder.rs @@ -57,11 +57,7 @@ pub trait AudioDecoderExt: 'static { fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode); - fn proxy_getcaps( - &self, - caps: Option<&gst::Caps>, - filter: Option<&gst::Caps>, - ) -> Option; + fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps; #[cfg(any(feature = "v1_10", feature = "dox"))] fn set_allocation_caps(&self, allocation_caps: Option<&gst::Caps>); @@ -218,11 +214,7 @@ impl> AudioDecoderExt for O { } } - fn proxy_getcaps( - &self, - caps: Option<&gst::Caps>, - filter: Option<&gst::Caps>, - ) -> Option { + fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { from_glib_full(gst_audio_sys::gst_audio_decoder_proxy_getcaps( self.as_ref().to_glib_none().0, diff --git a/gstreamer-audio/src/auto/audio_encoder.rs b/gstreamer-audio/src/auto/audio_encoder.rs index 082c3d7d9..7b4b0c098 100644 --- a/gstreamer-audio/src/auto/audio_encoder.rs +++ b/gstreamer-audio/src/auto/audio_encoder.rs @@ -54,11 +54,7 @@ pub trait AudioEncoderExt: 'static { fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode); - fn proxy_getcaps( - &self, - caps: Option<&gst::Caps>, - filter: Option<&gst::Caps>, - ) -> Option; + fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps; #[cfg(any(feature = "v1_10", feature = "dox"))] fn set_allocation_caps(&self, allocation_caps: Option<&gst::Caps>); @@ -204,11 +200,7 @@ impl> AudioEncoderExt for O { } } - fn proxy_getcaps( - &self, - caps: Option<&gst::Caps>, - filter: Option<&gst::Caps>, - ) -> Option { + fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { from_glib_full(gst_audio_sys::gst_audio_encoder_proxy_getcaps( self.as_ref().to_glib_none().0, diff --git a/gstreamer-audio/src/subclass/audio_decoder.rs b/gstreamer-audio/src/subclass/audio_decoder.rs index 3a6bff281..e2da09ea7 100644 --- a/gstreamer-audio/src/subclass/audio_decoder.rs +++ b/gstreamer-audio/src/subclass/audio_decoder.rs @@ -83,7 +83,7 @@ pub trait AudioDecoderImpl: AudioDecoderImplExt + ElementImpl + Send + Sync + 's self.parent_negotiate(element) } - fn get_caps(&self, element: &AudioDecoder, filter: Option<&gst::Caps>) -> Option { + fn get_caps(&self, element: &AudioDecoder, filter: Option<&gst::Caps>) -> gst::Caps { self.parent_get_caps(element, filter) } @@ -157,11 +157,7 @@ pub trait AudioDecoderImplExt { fn parent_negotiate(&self, element: &AudioDecoder) -> Result<(), gst::LoggableError>; - fn parent_get_caps( - &self, - element: &AudioDecoder, - filter: Option<&gst::Caps>, - ) -> Option; + fn parent_get_caps(&self, element: &AudioDecoder, filter: Option<&gst::Caps>) -> gst::Caps; fn parent_sink_event(&self, element: &AudioDecoder, event: gst::Event) -> bool; @@ -404,11 +400,7 @@ impl AudioDecoderImplExt for T { } } - fn parent_get_caps( - &self, - element: &AudioDecoder, - filter: Option<&gst::Caps>, - ) -> Option { + fn parent_get_caps(&self, element: &AudioDecoder, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { let data = self.get_type_data(); let parent_class = @@ -809,7 +801,7 @@ where let imp = instance.get_impl(); let wrap: AudioDecoder = from_glib_borrow(ptr); - gst_panic_to_error!(&wrap, &instance.panicked(), None, { + gst_panic_to_error!(&wrap, &instance.panicked(), gst::Caps::new_empty(), { AudioDecoderImpl::get_caps( imp, &wrap, diff --git a/gstreamer-audio/src/subclass/audio_encoder.rs b/gstreamer-audio/src/subclass/audio_encoder.rs index 056a46e2f..ebe24bc89 100644 --- a/gstreamer-audio/src/subclass/audio_encoder.rs +++ b/gstreamer-audio/src/subclass/audio_encoder.rs @@ -74,7 +74,7 @@ pub trait AudioEncoderImpl: AudioEncoderImplExt + ElementImpl + Send + Sync + 's self.parent_negotiate(element) } - fn get_caps(&self, element: &AudioEncoder, filter: Option<&gst::Caps>) -> Option { + fn get_caps(&self, element: &AudioEncoder, filter: Option<&gst::Caps>) -> gst::Caps { self.parent_get_caps(element, filter) } @@ -142,11 +142,7 @@ pub trait AudioEncoderImplExt { fn parent_negotiate(&self, element: &AudioEncoder) -> Result<(), gst::LoggableError>; - fn parent_get_caps( - &self, - element: &AudioEncoder, - filter: Option<&gst::Caps>, - ) -> Option; + fn parent_get_caps(&self, element: &AudioEncoder, filter: Option<&gst::Caps>) -> gst::Caps; fn parent_sink_event(&self, element: &AudioEncoder, event: gst::Event) -> bool; @@ -353,11 +349,7 @@ impl AudioEncoderImplExt for T { } } - fn parent_get_caps( - &self, - element: &AudioEncoder, - filter: Option<&gst::Caps>, - ) -> Option { + fn parent_get_caps(&self, element: &AudioEncoder, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { let data = self.get_type_data(); let parent_class = @@ -725,7 +717,7 @@ where let imp = instance.get_impl(); let wrap: AudioEncoder = from_glib_borrow(ptr); - gst_panic_to_error!(&wrap, &instance.panicked(), None, { + gst_panic_to_error!(&wrap, &instance.panicked(), gst::Caps::new_empty(), { AudioEncoderImpl::get_caps( imp, &wrap, diff --git a/gstreamer-video/src/auto/video_decoder.rs b/gstreamer-video/src/auto/video_decoder.rs index d36cc4429..8534f61b8 100644 --- a/gstreamer-video/src/auto/video_decoder.rs +++ b/gstreamer-video/src/auto/video_decoder.rs @@ -44,11 +44,7 @@ pub trait VideoDecoderExt: 'static { fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode); - fn proxy_getcaps( - &self, - caps: Option<&gst::Caps>, - filter: Option<&gst::Caps>, - ) -> Option; + fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps; fn set_estimate_rate(&self, enabled: bool); @@ -141,11 +137,7 @@ impl> VideoDecoderExt for O { } } - fn proxy_getcaps( - &self, - caps: Option<&gst::Caps>, - filter: Option<&gst::Caps>, - ) -> Option { + fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { from_glib_full(gst_video_sys::gst_video_decoder_proxy_getcaps( self.as_ref().to_glib_none().0, diff --git a/gstreamer-video/src/auto/video_encoder.rs b/gstreamer-video/src/auto/video_encoder.rs index 99f1e7fb8..65810d46e 100644 --- a/gstreamer-video/src/auto/video_encoder.rs +++ b/gstreamer-video/src/auto/video_encoder.rs @@ -42,11 +42,7 @@ pub trait VideoEncoderExt: 'static { fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode); - fn proxy_getcaps( - &self, - caps: Option<&gst::Caps>, - filter: Option<&gst::Caps>, - ) -> Option; + fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps; fn set_headers(&self, headers: &[&gst::Buffer]); @@ -104,11 +100,7 @@ impl> VideoEncoderExt for O { } } - fn proxy_getcaps( - &self, - caps: Option<&gst::Caps>, - filter: Option<&gst::Caps>, - ) -> Option { + fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { from_glib_full(gst_video_sys::gst_video_encoder_proxy_getcaps( self.as_ref().to_glib_none().0, diff --git a/gstreamer-video/src/subclass/video_decoder.rs b/gstreamer-video/src/subclass/video_decoder.rs index cb8984d31..76fb49d06 100644 --- a/gstreamer-video/src/subclass/video_decoder.rs +++ b/gstreamer-video/src/subclass/video_decoder.rs @@ -84,7 +84,7 @@ pub trait VideoDecoderImpl: VideoDecoderImplExt + ElementImpl + Send + Sync + 's self.parent_negotiate(element) } - fn get_caps(&self, element: &VideoDecoder, filter: Option<&gst::Caps>) -> Option { + fn get_caps(&self, element: &VideoDecoder, filter: Option<&gst::Caps>) -> gst::Caps { self.parent_get_caps(element, filter) } @@ -158,11 +158,7 @@ pub trait VideoDecoderImplExt { fn parent_negotiate(&self, element: &VideoDecoder) -> Result<(), gst::LoggableError>; - fn parent_get_caps( - &self, - element: &VideoDecoder, - filter: Option<&gst::Caps>, - ) -> Option; + fn parent_get_caps(&self, element: &VideoDecoder, filter: Option<&gst::Caps>) -> gst::Caps; fn parent_sink_event(&self, element: &VideoDecoder, event: gst::Event) -> bool; @@ -393,11 +389,7 @@ impl VideoDecoderImplExt for T { } } - fn parent_get_caps( - &self, - element: &VideoDecoder, - filter: Option<&gst::Caps>, - ) -> Option { + fn parent_get_caps(&self, element: &VideoDecoder, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { let data = self.get_type_data(); let parent_class = @@ -797,7 +789,7 @@ where let imp = instance.get_impl(); let wrap: VideoDecoder = from_glib_borrow(ptr); - gst_panic_to_error!(&wrap, &instance.panicked(), None, { + gst_panic_to_error!(&wrap, &instance.panicked(), gst::Caps::new_empty(), { VideoDecoderImpl::get_caps( imp, &wrap, diff --git a/gstreamer-video/src/subclass/video_encoder.rs b/gstreamer-video/src/subclass/video_encoder.rs index f4c9cb731..be69e572f 100644 --- a/gstreamer-video/src/subclass/video_encoder.rs +++ b/gstreamer-video/src/subclass/video_encoder.rs @@ -69,7 +69,7 @@ pub trait VideoEncoderImpl: VideoEncoderImplExt + ElementImpl + Send + Sync + 's self.parent_negotiate(element) } - fn get_caps(&self, element: &VideoEncoder, filter: Option<&gst::Caps>) -> Option { + fn get_caps(&self, element: &VideoEncoder, filter: Option<&gst::Caps>) -> gst::Caps { self.parent_get_caps(element, filter) } @@ -133,11 +133,7 @@ pub trait VideoEncoderImplExt { fn parent_negotiate(&self, element: &VideoEncoder) -> Result<(), gst::LoggableError>; - fn parent_get_caps( - &self, - element: &VideoEncoder, - filter: Option<&gst::Caps>, - ) -> Option; + fn parent_get_caps(&self, element: &VideoEncoder, filter: Option<&gst::Caps>) -> gst::Caps; fn parent_sink_event(&self, element: &VideoEncoder, event: gst::Event) -> bool; @@ -329,11 +325,7 @@ impl VideoEncoderImplExt for T { } } - fn parent_get_caps( - &self, - element: &VideoEncoder, - filter: Option<&gst::Caps>, - ) -> Option { + fn parent_get_caps(&self, element: &VideoEncoder, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { let data = self.get_type_data(); let parent_class = @@ -688,7 +680,7 @@ where let imp = instance.get_impl(); let wrap: VideoEncoder = from_glib_borrow(ptr); - gst_panic_to_error!(&wrap, &instance.panicked(), None, { + gst_panic_to_error!(&wrap, &instance.panicked(), gst::Caps::new_empty(), { VideoEncoderImpl::get_caps( imp, &wrap,