diff --git a/gstreamer-app/Gir.toml b/gstreamer-app/Gir.toml index c064123bc..a80119daf 100644 --- a/gstreamer-app/Gir.toml +++ b/gstreamer-app/Gir.toml @@ -159,16 +159,6 @@ name = "GstApp.AppSrc" status = "generate" final_type = true - [[object.function]] - name = "push_buffer" - # Pass by value - manual = true - - [[object.function]] - name = "push_buffer_list" - # Pass by value - manual = true - [[object.signal]] name = "end-of-stream" # Action signal diff --git a/gstreamer-app/src/app_src.rs b/gstreamer-app/src/app_src.rs index f06ee131d..2b04f179c 100644 --- a/gstreamer-app/src/app_src.rs +++ b/gstreamer-app/src/app_src.rs @@ -219,29 +219,6 @@ impl AppSrc { AppSrcBuilder::default() } - #[doc(alias = "gst_app_src_push_buffer")] - pub fn push_buffer(&self, buffer: gst::Buffer) -> Result { - unsafe { - try_from_glib(ffi::gst_app_src_push_buffer( - self.to_glib_none().0, - buffer.into_glib_ptr(), - )) - } - } - - #[doc(alias = "gst_app_src_push_buffer_list")] - pub fn push_buffer_list( - &self, - list: gst::BufferList, - ) -> Result { - unsafe { - try_from_glib(ffi::gst_app_src_push_buffer_list( - self.to_glib_none().0, - list.into_glib_ptr(), - )) - } - } - #[doc(alias = "gst_app_src_set_callbacks")] pub fn set_callbacks(&self, callbacks: AppSrcCallbacks) { use once_cell::sync::Lazy; diff --git a/gstreamer-app/src/auto/app_src.rs b/gstreamer-app/src/auto/app_src.rs index e7e7d9f67..ea22769e0 100644 --- a/gstreamer-app/src/auto/app_src.rs +++ b/gstreamer-app/src/auto/app_src.rs @@ -109,6 +109,29 @@ impl AppSrc { unsafe { from_glib(ffi::gst_app_src_get_stream_type(self.to_glib_none().0)) } } + #[doc(alias = "gst_app_src_push_buffer")] + pub fn push_buffer(&self, buffer: gst::Buffer) -> Result { + unsafe { + try_from_glib(ffi::gst_app_src_push_buffer( + self.to_glib_none().0, + buffer.into_glib_ptr(), + )) + } + } + + #[doc(alias = "gst_app_src_push_buffer_list")] + pub fn push_buffer_list( + &self, + buffer_list: gst::BufferList, + ) -> Result { + unsafe { + try_from_glib(ffi::gst_app_src_push_buffer_list( + self.to_glib_none().0, + buffer_list.into_glib_ptr(), + )) + } + } + #[doc(alias = "gst_app_src_push_sample")] pub fn push_sample(&self, sample: &gst::Sample) -> Result { unsafe { diff --git a/gstreamer-audio/Gir.toml b/gstreamer-audio/Gir.toml index babf9a029..2c88bcd38 100644 --- a/gstreamer-audio/Gir.toml +++ b/gstreamer-audio/Gir.toml @@ -72,6 +72,15 @@ name = "Gst.ClockTime" status = "manual" conversion_type = "Option" +[[object]] +name = "Gst.FlowReturn" +status = "manual" +must_use = true + [object.conversion_type] + variant = "Result" + ok_type = "gst::FlowSuccess" + err_type = "gst::FlowError" + [[object]] name = "Gst.Object" # For renaming the trait... @@ -142,14 +151,6 @@ name = "GstAudio.AudioDecoder" status = "generate" manual_traits = ["AudioDecoderExtManual"] - [[object.function]] - name = "finish_frame" - manual = true - - [[object.function]] - name = "finish_subframe" - manual = true - [[object.function]] name = "get_latency" [[object.function.parameter]] @@ -204,11 +205,6 @@ manual_traits = ["AudioDecoderExtManual"] name = "GstAudio.AudioEncoder" status = "generate" manual_traits = ["AudioEncoderExtManual"] - - [[object.function]] - name = "finish_frame" - manual = true - [[object.function]] name = "negotiate" manual = true diff --git a/gstreamer-audio/src/audio_decoder.rs b/gstreamer-audio/src/audio_decoder.rs index 811fa21e7..003f34a93 100644 --- a/gstreamer-audio/src/audio_decoder.rs +++ b/gstreamer-audio/src/audio_decoder.rs @@ -21,19 +21,6 @@ extern "C" { } pub trait AudioDecoderExtManual: 'static { - fn finish_frame( - &self, - buffer: Option, - frames: i32, - ) -> Result; - - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] - fn finish_subframe( - &self, - buffer: Option, - ) -> Result; - fn negotiate(&self) -> Result<(), gst::FlowError>; #[cfg(any(feature = "v1_16", feature = "dox"))] @@ -63,35 +50,6 @@ pub trait AudioDecoderExtManual: 'static { } impl> AudioDecoderExtManual for O { - fn finish_frame( - &self, - buffer: Option, - frames: i32, - ) -> Result { - unsafe { - try_from_glib(ffi::gst_audio_decoder_finish_frame( - self.as_ref().to_glib_none().0, - buffer.map(|b| b.into_glib_ptr()).unwrap_or(ptr::null_mut()), - frames, - )) - } - } - - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] - #[doc(alias = "gst_audio_decoder_finish_subframe")] - fn finish_subframe( - &self, - buffer: Option, - ) -> Result { - unsafe { - try_from_glib(ffi::gst_audio_decoder_finish_subframe( - self.as_ref().to_glib_none().0, - buffer.map(|b| b.into_glib_ptr()).unwrap_or(ptr::null_mut()), - )) - } - } - #[doc(alias = "gst_audio_decoder_negotiate")] fn negotiate(&self) -> Result<(), gst::FlowError> { unsafe { diff --git a/gstreamer-audio/src/audio_encoder.rs b/gstreamer-audio/src/audio_encoder.rs index 9992211c9..db2e53705 100644 --- a/gstreamer-audio/src/audio_encoder.rs +++ b/gstreamer-audio/src/audio_encoder.rs @@ -7,13 +7,6 @@ use glib::{prelude::*, translate::*}; use crate::AudioEncoder; pub trait AudioEncoderExtManual: 'static { - #[doc(alias = "gst_audio_encoder_finish_frame")] - fn finish_frame( - &self, - buffer: Option, - frames: i32, - ) -> Result; - #[doc(alias = "gst_audio_encoder_negotiate")] fn negotiate(&self) -> Result<(), gst::FlowError>; @@ -33,20 +26,6 @@ pub trait AudioEncoderExtManual: 'static { } impl> AudioEncoderExtManual for O { - fn finish_frame( - &self, - buffer: Option, - frames: i32, - ) -> Result { - unsafe { - try_from_glib(ffi::gst_audio_encoder_finish_frame( - self.as_ref().to_glib_none().0, - buffer.map(|b| b.into_glib_ptr()).unwrap_or(ptr::null_mut()), - frames, - )) - } - } - fn negotiate(&self) -> Result<(), gst::FlowError> { unsafe { let ret = from_glib(ffi::gst_audio_encoder_negotiate( diff --git a/gstreamer-audio/src/auto/audio_decoder.rs b/gstreamer-audio/src/auto/audio_decoder.rs index 1e7da14b2..8d5ff4a9e 100644 --- a/gstreamer-audio/src/auto/audio_decoder.rs +++ b/gstreamer-audio/src/auto/audio_decoder.rs @@ -31,6 +31,19 @@ pub trait AudioDecoderExt: 'static { #[doc(alias = "gst_audio_decoder_allocate_output_buffer")] fn allocate_output_buffer(&self, size: usize) -> gst::Buffer; + #[doc(alias = "gst_audio_decoder_finish_frame")] + fn finish_frame( + &self, + buf: Option, + frames: i32, + ) -> Result; + + #[cfg(any(feature = "v1_16", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[doc(alias = "gst_audio_decoder_finish_subframe")] + fn finish_subframe(&self, buf: Option) + -> Result; + #[doc(alias = "gst_audio_decoder_get_audio_info")] #[doc(alias = "get_audio_info")] fn audio_info(&self) -> AudioInfo; @@ -152,6 +165,34 @@ impl> AudioDecoderExt for O { } } + fn finish_frame( + &self, + buf: Option, + frames: i32, + ) -> Result { + unsafe { + try_from_glib(ffi::gst_audio_decoder_finish_frame( + self.as_ref().to_glib_none().0, + buf.into_glib_ptr(), + frames, + )) + } + } + + #[cfg(any(feature = "v1_16", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + fn finish_subframe( + &self, + buf: Option, + ) -> Result { + unsafe { + try_from_glib(ffi::gst_audio_decoder_finish_subframe( + self.as_ref().to_glib_none().0, + buf.into_glib_ptr(), + )) + } + } + fn audio_info(&self) -> AudioInfo { unsafe { from_glib_none(ffi::gst_audio_decoder_get_audio_info( diff --git a/gstreamer-audio/src/auto/audio_encoder.rs b/gstreamer-audio/src/auto/audio_encoder.rs index ebf022d6d..cbb9887dc 100644 --- a/gstreamer-audio/src/auto/audio_encoder.rs +++ b/gstreamer-audio/src/auto/audio_encoder.rs @@ -31,6 +31,13 @@ pub trait AudioEncoderExt: 'static { #[doc(alias = "gst_audio_encoder_allocate_output_buffer")] fn allocate_output_buffer(&self, size: usize) -> gst::Buffer; + #[doc(alias = "gst_audio_encoder_finish_frame")] + fn finish_frame( + &self, + buffer: Option, + samples: i32, + ) -> Result; + #[doc(alias = "gst_audio_encoder_get_audio_info")] #[doc(alias = "get_audio_info")] fn audio_info(&self) -> AudioInfo; @@ -156,6 +163,20 @@ impl> AudioEncoderExt for O { } } + fn finish_frame( + &self, + buffer: Option, + samples: i32, + ) -> Result { + unsafe { + try_from_glib(ffi::gst_audio_encoder_finish_frame( + self.as_ref().to_glib_none().0, + buffer.into_glib_ptr(), + samples, + )) + } + } + fn audio_info(&self) -> AudioInfo { unsafe { from_glib_none(ffi::gst_audio_encoder_get_audio_info( diff --git a/gstreamer-base/Gir.toml b/gstreamer-base/Gir.toml index a75e7a64b..657c82d89 100644 --- a/gstreamer-base/Gir.toml +++ b/gstreamer-base/Gir.toml @@ -208,16 +208,6 @@ manual_traits = ["AggregatorExtManual"] name = "get_allocator" manual = true - [[object.function]] - name = "finish_buffer" - # Takes ownership - manual = true - - [[object.function]] - name = "finish_buffer_list" - # Takes ownership - manual = true - [[object.function]] name = "selected_samples" # Info parameter diff --git a/gstreamer-base/src/aggregator.rs b/gstreamer-base/src/aggregator.rs index 1f00239e6..e0cc13c9e 100644 --- a/gstreamer-base/src/aggregator.rs +++ b/gstreamer-base/src/aggregator.rs @@ -21,17 +21,6 @@ pub trait AggregatorExtManual: 'static { #[doc(alias = "gst_aggregator_get_allocator")] fn allocator(&self) -> (Option, gst::AllocationParams); - #[doc(alias = "gst_aggregator_finish_buffer")] - fn finish_buffer(&self, buffer: gst::Buffer) -> Result; - - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - #[doc(alias = "gst_aggregator_finish_buffer_list")] - fn finish_buffer_list( - &self, - bufferlist: gst::BufferList, - ) -> Result; - #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[doc(alias = "min-upstream-latency")] @@ -105,29 +94,6 @@ impl> AggregatorExtManual for O { } } - fn finish_buffer(&self, buffer: gst::Buffer) -> Result { - unsafe { - try_from_glib(ffi::gst_aggregator_finish_buffer( - self.as_ref().to_glib_none().0, - buffer.into_glib_ptr(), - )) - } - } - - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - fn finish_buffer_list( - &self, - bufferlist: gst::BufferList, - ) -> Result { - unsafe { - try_from_glib(ffi::gst_aggregator_finish_buffer_list( - self.as_ref().to_glib_none().0, - bufferlist.into_glib_ptr(), - )) - } - } - #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] fn min_upstream_latency(&self) -> gst::ClockTime { diff --git a/gstreamer-base/src/auto/aggregator.rs b/gstreamer-base/src/auto/aggregator.rs index 55ee3e577..378e9b6e7 100644 --- a/gstreamer-base/src/auto/aggregator.rs +++ b/gstreamer-base/src/auto/aggregator.rs @@ -30,6 +30,17 @@ unsafe impl Send for Aggregator {} unsafe impl Sync for Aggregator {} pub trait AggregatorExt: 'static { + #[doc(alias = "gst_aggregator_finish_buffer")] + fn finish_buffer(&self, buffer: gst::Buffer) -> Result; + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "gst_aggregator_finish_buffer_list")] + fn finish_buffer_list( + &self, + bufferlist: gst::BufferList, + ) -> Result; + #[doc(alias = "gst_aggregator_get_buffer_pool")] #[doc(alias = "get_buffer_pool")] fn buffer_pool(&self) -> Option; @@ -139,6 +150,29 @@ pub trait AggregatorExt: 'static { } impl> AggregatorExt for O { + fn finish_buffer(&self, buffer: gst::Buffer) -> Result { + unsafe { + try_from_glib(ffi::gst_aggregator_finish_buffer( + self.as_ref().to_glib_none().0, + buffer.into_glib_ptr(), + )) + } + } + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + fn finish_buffer_list( + &self, + bufferlist: gst::BufferList, + ) -> Result { + unsafe { + try_from_glib(ffi::gst_aggregator_finish_buffer_list( + self.as_ref().to_glib_none().0, + bufferlist.into_glib_ptr(), + )) + } + } + fn buffer_pool(&self) -> Option { unsafe { from_glib_full(ffi::gst_aggregator_get_buffer_pool( diff --git a/gstreamer-rtp/Gir.toml b/gstreamer-rtp/Gir.toml index bb0d45489..4b53d7b33 100644 --- a/gstreamer-rtp/Gir.toml +++ b/gstreamer-rtp/Gir.toml @@ -21,6 +21,7 @@ generate = [ "GstRtp.RTCPSDESType", "GstRtp.RTCPType", "GstRtp.RTCPXRType", + "GstRtp.RTPBaseDepayload", "GstRtp.RTPHeaderExtensionDirection", "GstRtp.RTPHeaderExtensionFlags", "GstRtp.RTPPayload", @@ -80,20 +81,6 @@ status = "generate" name = "rtp_source_meta_api_get_type" ignore = true -[[object]] -name = "GstRtp.RTPBaseDepayload" -status = "generate" - - [[object.function]] - name = "push" - # Move buffer - manual = true - - [[object.function]] - name = "push_list" - # Move buffer list - manual = true - [[object]] name = "GstRtp.RTPBasePayload" status = "generate" @@ -104,16 +91,6 @@ manual_traits = ["RTPHeaderExtensionExtManual"] # varargs function ignore = true - [[object.function]] - name = "push" - # Move buffer - manual = true - - [[object.function]] - name = "push_list" - # Move buffer list - manual = true - [[object.function]] name = "set_outcaps_structure" # StructureRef instead of Structure diff --git a/gstreamer-rtp/src/auto/rtp_base_depayload.rs b/gstreamer-rtp/src/auto/rtp_base_depayload.rs index 4137cc705..f1efb25ac 100644 --- a/gstreamer-rtp/src/auto/rtp_base_depayload.rs +++ b/gstreamer-rtp/src/auto/rtp_base_depayload.rs @@ -35,6 +35,12 @@ pub trait RTPBaseDepayloadExt: 'static { #[doc(alias = "gst_rtp_base_depayload_is_source_info_enabled")] fn is_source_info_enabled(&self) -> bool; + #[doc(alias = "gst_rtp_base_depayload_push")] + fn push(&self, out_buf: gst::Buffer) -> Result; + + #[doc(alias = "gst_rtp_base_depayload_push_list")] + fn push_list(&self, out_list: gst::BufferList) -> Result; + #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[doc(alias = "gst_rtp_base_depayload_set_source_info_enabled")] @@ -145,6 +151,24 @@ impl> RTPBaseDepayloadExt for O { } } + fn push(&self, out_buf: gst::Buffer) -> Result { + unsafe { + try_from_glib(ffi::gst_rtp_base_depayload_push( + self.as_ref().to_glib_none().0, + out_buf.into_glib_ptr(), + )) + } + } + + fn push_list(&self, out_list: gst::BufferList) -> Result { + unsafe { + try_from_glib(ffi::gst_rtp_base_depayload_push_list( + self.as_ref().to_glib_none().0, + out_list.into_glib_ptr(), + )) + } + } + #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] fn set_source_info_enabled(&self, enable: bool) { diff --git a/gstreamer-rtp/src/auto/rtp_base_payload.rs b/gstreamer-rtp/src/auto/rtp_base_payload.rs index 0f280e9b4..bb5149142 100644 --- a/gstreamer-rtp/src/auto/rtp_base_payload.rs +++ b/gstreamer-rtp/src/auto/rtp_base_payload.rs @@ -49,6 +49,12 @@ pub trait RTPBasePayloadExt: 'static { #[doc(alias = "gst_rtp_base_payload_is_source_info_enabled")] fn is_source_info_enabled(&self) -> bool; + #[doc(alias = "gst_rtp_base_payload_push")] + fn push(&self, buffer: gst::Buffer) -> Result; + + #[doc(alias = "gst_rtp_base_payload_push_list")] + fn push_list(&self, list: gst::BufferList) -> Result; + #[doc(alias = "gst_rtp_base_payload_set_options")] fn set_options(&self, media: &str, dynamic: bool, encoding_name: &str, clock_rate: u32); @@ -320,6 +326,24 @@ impl> RTPBasePayloadExt for O { } } + fn push(&self, buffer: gst::Buffer) -> Result { + unsafe { + try_from_glib(ffi::gst_rtp_base_payload_push( + self.as_ref().to_glib_none().0, + buffer.into_glib_ptr(), + )) + } + } + + fn push_list(&self, list: gst::BufferList) -> Result { + unsafe { + try_from_glib(ffi::gst_rtp_base_payload_push_list( + self.as_ref().to_glib_none().0, + list.into_glib_ptr(), + )) + } + } + fn set_options(&self, media: &str, dynamic: bool, encoding_name: &str, clock_rate: u32) { unsafe { ffi::gst_rtp_base_payload_set_options( diff --git a/gstreamer-rtp/src/rtp_base_depayload.rs b/gstreamer-rtp/src/rtp_base_depayload.rs index 42c876df5..1ed72030e 100644 --- a/gstreamer-rtp/src/rtp_base_depayload.rs +++ b/gstreamer-rtp/src/rtp_base_depayload.rs @@ -1,38 +1,14 @@ -use glib::{object::IsA, translate::*}; +use glib::object::IsA; use crate::RTPBaseDepayload; pub trait RTPBaseDepayloadExtManual: 'static { - #[doc(alias = "gst_rtp_base_depayload_push")] - fn push(&self, buffer: gst::Buffer) -> Result; - - #[doc(alias = "gst_rtp_base_depayload_push_list")] - fn push_list(&self, list: gst::BufferList) -> Result; - fn sink_pad(&self) -> &gst::Pad; fn src_pad(&self) -> &gst::Pad; } impl> RTPBaseDepayloadExtManual for O { - fn push(&self, out_buf: gst::Buffer) -> Result { - unsafe { - try_from_glib(ffi::gst_rtp_base_depayload_push( - self.as_ref().to_glib_none().0, - out_buf.into_glib_ptr(), - )) - } - } - - fn push_list(&self, out_list: gst::BufferList) -> Result { - unsafe { - try_from_glib(ffi::gst_rtp_base_depayload_push_list( - self.as_ref().to_glib_none().0, - out_list.into_glib_ptr(), - )) - } - } - fn sink_pad(&self) -> &gst::Pad { unsafe { let elt = &*(self.as_ptr() as *const ffi::GstRTPBaseDepayload); diff --git a/gstreamer-rtp/src/rtp_base_payload.rs b/gstreamer-rtp/src/rtp_base_payload.rs index a9df66cc3..372fa1bfc 100644 --- a/gstreamer-rtp/src/rtp_base_payload.rs +++ b/gstreamer-rtp/src/rtp_base_payload.rs @@ -11,12 +11,6 @@ pub trait RTPBasePayloadExtManual: 'static { #[doc(alias = "gst_rtp_base_payload_set_outcaps")] fn set_outcaps(&self, s: Option<&gst::StructureRef>) -> Result<(), glib::error::BoolError>; - #[doc(alias = "gst_rtp_base_payload_push")] - fn push(&self, buffer: gst::Buffer) -> Result; - - #[doc(alias = "gst_rtp_base_payload_push_list")] - fn push_list(&self, list: gst::BufferList) -> Result; - fn sink_pad(&self) -> &gst::Pad; fn src_pad(&self) -> &gst::Pad; @@ -39,24 +33,6 @@ impl> RTPBasePayloadExtManual for O { } } - fn push(&self, buffer: gst::Buffer) -> Result { - unsafe { - try_from_glib(ffi::gst_rtp_base_payload_push( - self.as_ref().to_glib_none().0, - buffer.into_glib_ptr(), - )) - } - } - - fn push_list(&self, list: gst::BufferList) -> Result { - unsafe { - try_from_glib(ffi::gst_rtp_base_payload_push_list( - self.as_ref().to_glib_none().0, - list.into_glib_ptr(), - )) - } - } - fn sink_pad(&self) -> &gst::Pad { unsafe { let elt = &*(self.as_ptr() as *const ffi::GstRTPBasePayload); diff --git a/gstreamer-video/Gir.toml b/gstreamer-video/Gir.toml index 3d7858ae3..541c86c3e 100644 --- a/gstreamer-video/Gir.toml +++ b/gstreamer-video/Gir.toml @@ -54,7 +54,6 @@ manual = [ "Gst.BufferPoolAcquireParams", "Gst.ClockTimeDiff", "Gst.Element", - "Gst.FlowReturn", "Gst.Format", "Gst.Memory", "Gst.Message", @@ -94,13 +93,22 @@ name = "Gst.Event" status = "manual" ref_mode = "ref" +[[object]] +name = "Gst.FlowReturn" +status = "manual" +must_use = true + [object.conversion_type] + variant = "Result" + ok_type = "gst::FlowSuccess" + err_type = "gst::FlowError" + [[object]] name = "Gst.Query" status = "manual" ref_mode = "ref" [[object]] -name = "gst.Structure" +name = "Gst.Structure" status = "manual" ref_mode = "ref" @@ -201,11 +209,9 @@ status = "generate" [[object.function]] name = "send_event" - manual = true - - [[object.function]] - name = "send_event_simple" - manual = true + [[object.function.parameter]] + name = "structure" + move = true [[object.function]] name = "send_key_event" @@ -439,18 +445,6 @@ manual_traits = ["VideoDecoderExtManual"] name = "allocate_output_frame_with_params" ignore = true - [[object.function]] - name = "finish_frame" - manual = true - - [[object.function]] - name = "release_frame" - manual = true - - [[object.function]] - name = "drop_frame" - manual = true - [[object.function]] name = "finish_subframe" manual = true @@ -529,10 +523,6 @@ manual_traits = ["VideoEncoderExtManual"] name = "allocate_output_frame_with_params" ignore = true - [[object.function]] - name = "finish_frame" - manual = true - [[object.function]] name = "finish_subframe" manual = true diff --git a/gstreamer-video/src/auto/navigation.rs b/gstreamer-video/src/auto/navigation.rs index cacbd4760..a46a01b15 100644 --- a/gstreamer-video/src/auto/navigation.rs +++ b/gstreamer-video/src/auto/navigation.rs @@ -36,6 +36,14 @@ pub trait NavigationExt: 'static { #[doc(alias = "gst_navigation_send_command")] fn send_command(&self, command: NavigationCommand); + #[doc(alias = "gst_navigation_send_event")] + fn send_event(&self, structure: gst::Structure); + + #[cfg(any(feature = "v1_22", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))] + #[doc(alias = "gst_navigation_send_event_simple")] + fn send_event_simple(&self, event: gst::Event); + #[doc(alias = "gst_navigation_send_key_event")] fn send_key_event(&self, event: &str, key: &str); @@ -55,6 +63,26 @@ impl> NavigationExt for O { } } + fn send_event(&self, structure: gst::Structure) { + unsafe { + ffi::gst_navigation_send_event( + self.as_ref().to_glib_none().0, + structure.into_glib_ptr(), + ); + } + } + + #[cfg(any(feature = "v1_22", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))] + fn send_event_simple(&self, event: gst::Event) { + unsafe { + ffi::gst_navigation_send_event_simple( + self.as_ref().to_glib_none().0, + event.into_glib_ptr(), + ); + } + } + fn send_key_event(&self, event: &str, key: &str) { unsafe { ffi::gst_navigation_send_key_event( diff --git a/gstreamer-video/src/auto/video_decoder.rs b/gstreamer-video/src/auto/video_decoder.rs index 9b86c4288..b3db0dcf2 100644 --- a/gstreamer-video/src/auto/video_decoder.rs +++ b/gstreamer-video/src/auto/video_decoder.rs @@ -38,6 +38,12 @@ pub trait VideoDecoderExt: 'static { #[doc(alias = "gst_video_decoder_allocate_output_buffer")] fn allocate_output_buffer(&self) -> Result; + #[doc(alias = "gst_video_decoder_drop_frame")] + fn drop_frame(&self, frame: VideoCodecFrame) -> Result; + + #[doc(alias = "gst_video_decoder_finish_frame")] + fn finish_frame(&self, frame: VideoCodecFrame) -> Result; + #[doc(alias = "gst_video_decoder_get_buffer_pool")] #[doc(alias = "get_buffer_pool")] fn buffer_pool(&self) -> Option; @@ -83,7 +89,7 @@ pub trait VideoDecoderExt: 'static { fn is_subframe_mode(&self) -> bool; #[doc(alias = "gst_video_decoder_have_frame")] - fn have_frame(&self) -> gst::FlowReturn; + fn have_frame(&self) -> Result; #[doc(alias = "gst_video_decoder_merge_tags")] fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode); @@ -91,6 +97,9 @@ pub trait VideoDecoderExt: 'static { #[doc(alias = "gst_video_decoder_proxy_getcaps")] fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps; + #[doc(alias = "gst_video_decoder_release_frame")] + fn release_frame(&self, frame: VideoCodecFrame); + #[cfg(any(feature = "v1_20", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] #[doc(alias = "gst_video_decoder_request_sync_point")] @@ -234,6 +243,24 @@ impl> VideoDecoderExt for O { } } + fn drop_frame(&self, frame: VideoCodecFrame) -> Result { + unsafe { + try_from_glib(ffi::gst_video_decoder_drop_frame( + self.as_ref().to_glib_none().0, + frame.into_glib_ptr(), + )) + } + } + + fn finish_frame(&self, frame: VideoCodecFrame) -> Result { + unsafe { + try_from_glib(ffi::gst_video_decoder_finish_frame( + self.as_ref().to_glib_none().0, + frame.into_glib_ptr(), + )) + } + } + fn buffer_pool(&self) -> Option { unsafe { from_glib_full(ffi::gst_video_decoder_get_buffer_pool( @@ -303,9 +330,9 @@ impl> VideoDecoderExt for O { } } - fn have_frame(&self) -> gst::FlowReturn { + fn have_frame(&self) -> Result { unsafe { - from_glib(ffi::gst_video_decoder_have_frame( + try_from_glib(ffi::gst_video_decoder_have_frame( self.as_ref().to_glib_none().0, )) } @@ -331,6 +358,15 @@ impl> VideoDecoderExt for O { } } + fn release_frame(&self, frame: VideoCodecFrame) { + unsafe { + ffi::gst_video_decoder_release_frame( + self.as_ref().to_glib_none().0, + frame.into_glib_ptr(), + ); + } + } + #[cfg(any(feature = "v1_20", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] fn request_sync_point( diff --git a/gstreamer-video/src/auto/video_encoder.rs b/gstreamer-video/src/auto/video_encoder.rs index 62de8544d..6116517cb 100644 --- a/gstreamer-video/src/auto/video_encoder.rs +++ b/gstreamer-video/src/auto/video_encoder.rs @@ -31,6 +31,9 @@ pub trait VideoEncoderExt: 'static { #[doc(alias = "gst_video_encoder_allocate_output_buffer")] fn allocate_output_buffer(&self, size: usize) -> gst::Buffer; + #[doc(alias = "gst_video_encoder_finish_frame")] + fn finish_frame(&self, frame: VideoCodecFrame) -> Result; + #[doc(alias = "gst_video_encoder_get_max_encode_time")] #[doc(alias = "get_max_encode_time")] fn max_encode_time(&self, frame: &VideoCodecFrame) -> gst::ClockTimeDiff; @@ -87,6 +90,15 @@ impl> VideoEncoderExt for O { } } + fn finish_frame(&self, frame: VideoCodecFrame) -> Result { + unsafe { + try_from_glib(ffi::gst_video_encoder_finish_frame( + self.as_ref().to_glib_none().0, + frame.into_glib_ptr(), + )) + } + } + fn max_encode_time(&self, frame: &VideoCodecFrame) -> gst::ClockTimeDiff { unsafe { ffi::gst_video_encoder_get_max_encode_time( diff --git a/gstreamer-video/src/lib.rs b/gstreamer-video/src/lib.rs index 922e2c56f..cca87157e 100644 --- a/gstreamer-video/src/lib.rs +++ b/gstreamer-video/src/lib.rs @@ -41,8 +41,6 @@ mod enums; #[cfg(feature = "serde")] mod flag_serde; -mod navigation; - mod caps; pub use crate::caps::VideoCapsBuilder; @@ -159,7 +157,7 @@ pub mod prelude { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] pub use crate::video_aggregator_pad::VideoAggregatorPadExtManual; pub use crate::{ - auto::traits::*, navigation::NavigationExtManual, video_buffer_pool::VideoBufferPoolConfig, + auto::traits::*, video_buffer_pool::VideoBufferPoolConfig, video_decoder::VideoDecoderExtManual, video_encoder::VideoEncoderExtManual, video_format::VideoFormatIteratorExt, video_frame::VideoBufferExt, video_overlay::VideoOverlayExtManual, diff --git a/gstreamer-video/src/navigation.rs b/gstreamer-video/src/navigation.rs deleted file mode 100644 index 10b50e617..000000000 --- a/gstreamer-video/src/navigation.rs +++ /dev/null @@ -1,38 +0,0 @@ -use glib::{ - object::IsA, - translate::{IntoGlibPtr, ToGlibPtr}, -}; - -use crate::auto::Navigation; - -pub trait NavigationExtManual: 'static { - #[doc(alias = "gst_navigation_send_event")] - fn send_event(&self, structure: gst::Structure); - - #[cfg(any(feature = "v1_22", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))] - #[doc(alias = "gst_navigation_send_event_simple")] - fn send_event_simple(&self, event: gst::Event); -} - -impl> NavigationExtManual for O { - fn send_event(&self, structure: gst::Structure) { - unsafe { - ffi::gst_navigation_send_event( - self.as_ref().to_glib_none().0, - structure.into_glib_ptr(), - ); - } - } - - #[cfg(any(feature = "v1_22", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))] - fn send_event_simple(&self, event: gst::Event) { - unsafe { - ffi::gst_navigation_send_event_simple( - self.as_ref().to_glib_none().0, - event.into_glib_ptr(), - ); - } - } -} diff --git a/gstreamer-video/src/video_decoder.rs b/gstreamer-video/src/video_decoder.rs index b0ef83665..d417c99b5 100644 --- a/gstreamer-video/src/video_decoder.rs +++ b/gstreamer-video/src/video_decoder.rs @@ -45,10 +45,6 @@ pub trait VideoDecoderExtManual: 'static { #[doc(alias = "get_allocator")] fn allocator(&self) -> (Option, gst::AllocationParams); - fn finish_frame(&self, frame: VideoCodecFrame) -> Result; - fn release_frame(&self, frame: VideoCodecFrame); - fn drop_frame(&self, frame: VideoCodecFrame) -> Result; - #[cfg(any(feature = "v1_20", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] #[doc(alias = "gst_video_decoder_finish_subframe")] @@ -146,36 +142,6 @@ impl> VideoDecoderExtManual for O { } } - #[doc(alias = "gst_video_decoder_finish_frame")] - fn finish_frame(&self, frame: VideoCodecFrame) -> Result { - unsafe { - try_from_glib(ffi::gst_video_decoder_finish_frame( - self.as_ref().to_glib_none().0, - frame.into_glib_ptr(), - )) - } - } - - #[doc(alias = "gst_video_decoder_release_frame")] - fn release_frame(&self, frame: VideoCodecFrame) { - unsafe { - ffi::gst_video_decoder_release_frame( - self.as_ref().to_glib_none().0, - frame.into_glib_ptr(), - ) - } - } - - #[doc(alias = "gst_video_decoder_drop_frame")] - fn drop_frame(&self, frame: VideoCodecFrame) -> Result { - unsafe { - try_from_glib(ffi::gst_video_decoder_drop_frame( - self.as_ref().to_glib_none().0, - frame.into_glib_ptr(), - )) - } - } - #[doc(alias = "gst_video_decoder_get_latency")] fn latency(&self) -> (gst::ClockTime, Option) { let mut min_latency = gst::ffi::GST_CLOCK_TIME_NONE; diff --git a/gstreamer-video/src/video_encoder.rs b/gstreamer-video/src/video_encoder.rs index 9e86cf961..72469a005 100644 --- a/gstreamer-video/src/video_encoder.rs +++ b/gstreamer-video/src/video_encoder.rs @@ -32,12 +32,6 @@ pub trait VideoEncoderExtManual: 'static { #[doc(alias = "gst_video_encoder_get_allocator")] fn allocator(&self) -> (Option, gst::AllocationParams); - #[doc(alias = "gst_video_encoder_finish_frame")] - fn finish_frame( - &self, - frame: Option, - ) -> Result; - #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[doc(alias = "gst_video_encoder_finish_subframe")] @@ -105,18 +99,6 @@ impl> VideoEncoderExtManual for O { } } - fn finish_frame( - &self, - frame: Option, - ) -> Result { - unsafe { - try_from_glib(ffi::gst_video_encoder_finish_frame( - self.as_ref().to_glib_none().0, - frame.map(|f| f.into_glib_ptr()).unwrap_or(ptr::null_mut()), - )) - } - } - #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result { diff --git a/gstreamer/Gir.toml b/gstreamer/Gir.toml index 896e90ff0..e930f2ad9 100644 --- a/gstreamer/Gir.toml +++ b/gstreamer/Gir.toml @@ -532,11 +532,6 @@ manual_traits = ["BufferPoolExtManual"] # Params and return value manual = true - [[object.function]] - name = "release_buffer" - # Takes ownership - manual = true - [[object.function]] name = "set_active" [object.function.return] @@ -605,8 +600,8 @@ final_type = true [[object.function]] name = "post" - # transfer ownership of the message - manual = true + [object.function.return] + bool_return_is_error = "Failed to post message" [[object]] name = "Gst.Caps" @@ -1085,8 +1080,8 @@ manual_traits = ["ElementExtManual"] [[object.function]] name = "post_message" - # takes ownership of message - manual = true + [object.function.return] + bool_return_is_error = "Failed to post message" [[object.function]] name = "add_pad" @@ -1604,26 +1599,6 @@ manual_traits = ["PadExtManual"] # Don't use a ulong manual = true - [[object.function]] - name = "chain" - # Move buffer - manual = true - - [[object.function]] - name = "push" - # Move buffer - manual = true - - [[object.function]] - name = "chain_list" - # Move buffer - manual = true - - [[object.function]] - name = "push_list" - # Move buffer - manual = true - [[object.function]] name = "pull_range" # Buffer can be NULL @@ -1926,11 +1901,6 @@ final_type = true # useless and unsafe ignore = true - [[object.function]] - name = "set_cache_data" - # pass by value - manual = true - [[object.function]] name = "get_cache_data" # structure ref diff --git a/gstreamer/src/auto/buffer_pool.rs b/gstreamer/src/auto/buffer_pool.rs index 6c07e7dc0..623d1ac4f 100644 --- a/gstreamer/src/auto/buffer_pool.rs +++ b/gstreamer/src/auto/buffer_pool.rs @@ -3,7 +3,7 @@ // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT -use crate::Object; +use crate::{Buffer, Object}; use glib::{prelude::*, translate::*}; glib::wrapper! { @@ -45,6 +45,9 @@ pub trait BufferPoolExt: 'static { #[doc(alias = "gst_buffer_pool_is_active")] fn is_active(&self) -> bool; + #[doc(alias = "gst_buffer_pool_release_buffer")] + fn release_buffer(&self, buffer: Buffer); + #[doc(alias = "gst_buffer_pool_set_active")] fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError>; @@ -78,6 +81,15 @@ impl> BufferPoolExt for O { } } + fn release_buffer(&self, buffer: Buffer) { + unsafe { + ffi::gst_buffer_pool_release_buffer( + self.as_ref().to_glib_none().0, + buffer.into_glib_ptr(), + ); + } + } + fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( diff --git a/gstreamer/src/auto/bus.rs b/gstreamer/src/auto/bus.rs index c38369228..03f5ac47c 100644 --- a/gstreamer/src/auto/bus.rs +++ b/gstreamer/src/auto/bus.rs @@ -74,6 +74,16 @@ impl Bus { unsafe { from_glib_full(ffi::gst_bus_pop(self.to_glib_none().0)) } } + #[doc(alias = "gst_bus_post")] + pub fn post(&self, message: Message) -> Result<(), glib::error::BoolError> { + unsafe { + glib::result_from_gboolean!( + ffi::gst_bus_post(self.to_glib_none().0, message.into_glib_ptr()), + "Failed to post message" + ) + } + } + #[doc(alias = "gst_bus_remove_signal_watch")] pub fn remove_signal_watch(&self) { unsafe { diff --git a/gstreamer/src/auto/element.rs b/gstreamer/src/auto/element.rs index 80bfb8e62..587ad844b 100644 --- a/gstreamer/src/auto/element.rs +++ b/gstreamer/src/auto/element.rs @@ -5,7 +5,7 @@ #![allow(deprecated)] use crate::{ - Bus, Caps, Clock, ClockTime, Context, ElementFactory, Object, Pad, PadTemplate, State, + Bus, Caps, Clock, ClockTime, Context, ElementFactory, Message, Object, Pad, PadTemplate, State, StateChange, StateChangeError, StateChangeReturn, StateChangeSuccess, URIType, }; use glib::{ @@ -139,6 +139,9 @@ pub trait ElementExt: 'static { #[doc(alias = "gst_element_no_more_pads")] fn no_more_pads(&self); + #[doc(alias = "gst_element_post_message")] + fn post_message(&self, message: Message) -> Result<(), glib::error::BoolError>; + #[doc(alias = "gst_element_provide_clock")] fn provide_clock(&self) -> Option; @@ -437,6 +440,18 @@ impl> ElementExt for O { } } + fn post_message(&self, message: Message) -> Result<(), glib::error::BoolError> { + unsafe { + glib::result_from_gboolean!( + ffi::gst_element_post_message( + self.as_ref().to_glib_none().0, + message.into_glib_ptr() + ), + "Failed to post message" + ) + } + } + fn provide_clock(&self) -> Option { unsafe { from_glib_full(ffi::gst_element_provide_clock( diff --git a/gstreamer/src/auto/pad.rs b/gstreamer/src/auto/pad.rs index 25e64601a..672d344c7 100644 --- a/gstreamer/src/auto/pad.rs +++ b/gstreamer/src/auto/pad.rs @@ -4,8 +4,8 @@ // DO NOT EDIT use crate::{ - Caps, Element, Event, FlowError, FlowSuccess, Object, PadDirection, PadLinkCheck, PadLinkError, - PadLinkSuccess, PadMode, PadTemplate, Stream, TaskState, + Buffer, BufferList, Caps, Element, Event, FlowError, FlowSuccess, Object, PadDirection, + PadLinkCheck, PadLinkError, PadLinkSuccess, PadMode, PadTemplate, Stream, TaskState, }; use glib::{ prelude::*, @@ -37,6 +37,12 @@ pub trait PadExt: 'static { #[doc(alias = "gst_pad_can_link")] fn can_link(&self, sinkpad: &impl IsA) -> bool; + #[doc(alias = "gst_pad_chain")] + fn chain(&self, buffer: Buffer) -> Result; + + #[doc(alias = "gst_pad_chain_list")] + fn chain_list(&self, list: BufferList) -> Result; + #[doc(alias = "gst_pad_check_reconfigure")] fn check_reconfigure(&self) -> bool; @@ -172,6 +178,12 @@ pub trait PadExt: 'static { #[doc(alias = "gst_pad_peer_query_caps")] fn peer_query_caps(&self, filter: Option<&Caps>) -> Caps; + #[doc(alias = "gst_pad_push")] + fn push(&self, buffer: Buffer) -> Result; + + #[doc(alias = "gst_pad_push_list")] + fn push_list(&self, list: BufferList) -> Result; + #[doc(alias = "gst_pad_query_accept_caps")] fn query_accept_caps(&self, caps: &Caps) -> bool; @@ -238,6 +250,24 @@ impl> PadExt for O { } } + fn chain(&self, buffer: Buffer) -> Result { + unsafe { + try_from_glib(ffi::gst_pad_chain( + self.as_ref().to_glib_none().0, + buffer.into_glib_ptr(), + )) + } + } + + fn chain_list(&self, list: BufferList) -> Result { + unsafe { + try_from_glib(ffi::gst_pad_chain_list( + self.as_ref().to_glib_none().0, + list.into_glib_ptr(), + )) + } + } + fn check_reconfigure(&self) -> bool { unsafe { from_glib(ffi::gst_pad_check_reconfigure( @@ -501,6 +531,24 @@ impl> PadExt for O { } } + fn push(&self, buffer: Buffer) -> Result { + unsafe { + try_from_glib(ffi::gst_pad_push( + self.as_ref().to_glib_none().0, + buffer.into_glib_ptr(), + )) + } + } + + fn push_list(&self, list: BufferList) -> Result { + unsafe { + try_from_glib(ffi::gst_pad_push_list( + self.as_ref().to_glib_none().0, + list.into_glib_ptr(), + )) + } + } + fn query_accept_caps(&self, caps: &Caps) -> bool { unsafe { from_glib(ffi::gst_pad_query_accept_caps( diff --git a/gstreamer/src/auto/plugin.rs b/gstreamer/src/auto/plugin.rs index 0966b8cc0..b6c0e4d69 100644 --- a/gstreamer/src/auto/plugin.rs +++ b/gstreamer/src/auto/plugin.rs @@ -3,8 +3,8 @@ // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT -use crate::{Object, PluginDependencyFlags}; -use glib::translate::*; +use crate::{Object, PluginDependencyFlags, Structure}; +use glib::{prelude::*, translate::*}; use std::{fmt, ptr}; glib::wrapper! { @@ -126,6 +126,13 @@ impl Plugin { } } + #[doc(alias = "gst_plugin_set_cache_data")] + pub fn set_cache_data(&self, cache_data: Structure) { + unsafe { + ffi::gst_plugin_set_cache_data(self.to_glib_none().0, cache_data.into_glib_ptr()); + } + } + #[doc(alias = "gst_plugin_load_by_name")] pub fn load_by_name(name: &str) -> Result { assert_initialized_main_thread!(); diff --git a/gstreamer/src/buffer_pool.rs b/gstreamer/src/buffer_pool.rs index 4723de517..04f34b11e 100644 --- a/gstreamer/src/buffer_pool.rs +++ b/gstreamer/src/buffer_pool.rs @@ -344,8 +344,6 @@ pub trait BufferPoolExtManual: 'static { &self, params: Option<&BufferPoolAcquireParams>, ) -> Result; - #[doc(alias = "gst_buffer_pool_release_buffer")] - fn release_buffer(&self, buffer: crate::Buffer); } impl> BufferPoolExtManual for O { @@ -393,15 +391,6 @@ impl> BufferPoolExtManual for O { .map(|_| from_glib_full(buffer)) } } - - fn release_buffer(&self, buffer: crate::Buffer) { - unsafe { - ffi::gst_buffer_pool_release_buffer( - self.as_ref().to_glib_none().0, - buffer.into_glib_ptr(), - ); - } - } } #[cfg(test)] diff --git a/gstreamer/src/bus.rs b/gstreamer/src/bus.rs index 742a4f788..0edca388e 100644 --- a/gstreamer/src/bus.rs +++ b/gstreamer/src/bus.rs @@ -304,16 +304,6 @@ impl Bus { future::ready(message_types.contains(&message_type)) }) } - - #[doc(alias = "gst_bus_post")] - pub fn post(&self, message: crate::Message) -> Result<(), glib::error::BoolError> { - unsafe { - glib::result_from_gboolean!( - ffi::gst_bus_post(self.to_glib_none().0, message.into_glib_ptr()), - "Failed to post message" - ) - } - } } #[derive(Debug)] diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index 439750976..42a882c43 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -155,8 +155,6 @@ pub trait ElementExtManual: 'static { structure: crate::Structure, ); - #[doc(alias = "gst_element_post_message")] - fn post_message(&self, message: crate::Message) -> Result<(), glib::error::BoolError>; fn post_error_message(&self, msg: crate::ErrorMessage); #[doc(alias = "gst_element_iterate_pads")] @@ -430,18 +428,6 @@ impl> ElementExtManual for O { } } - fn post_message(&self, message: crate::Message) -> Result<(), glib::error::BoolError> { - unsafe { - glib::result_from_gboolean!( - ffi::gst_element_post_message( - self.as_ref().to_glib_none().0, - message.into_glib_ptr() - ), - "Failed to post message" - ) - } - } - fn post_error_message(&self, msg: crate::ErrorMessage) { let crate::ErrorMessage { error_domain, diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index de48995ae..b2109feee 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -11,9 +11,8 @@ use std::{ use glib::{ffi::gpointer, prelude::*, translate::*}; use crate::{ - element::ElementExtManual, format::{FormattedValue, SpecificFormattedValueFullRange, SpecificFormattedValueIntrinsic}, - prelude::PadExt, + prelude::*, Buffer, BufferList, Event, FlowError, FlowReturn, FlowSuccess, Format, GenericFormattedValue, LoggableError, Pad, PadFlags, PadProbeReturn, PadProbeType, Query, QueryRef, StaticPadTemplate, }; @@ -100,16 +99,6 @@ pub trait PadExtManual: 'static { #[doc(alias = "gst_pad_remove_probe")] fn remove_probe(&self, id: PadProbeId); - #[doc(alias = "gst_pad_chain")] - fn chain(&self, buffer: Buffer) -> Result; - #[doc(alias = "gst_pad_push")] - fn push(&self, buffer: Buffer) -> Result; - - #[doc(alias = "gst_pad_chain_list")] - fn chain_list(&self, list: BufferList) -> Result; - #[doc(alias = "gst_pad_push_list")] - fn push_list(&self, list: BufferList) -> Result; - #[doc(alias = "gst_pad_pull_range")] fn pull_range(&self, offset: u64, size: u32) -> Result; fn pull_range_fill( @@ -341,42 +330,6 @@ impl> PadExtManual for O { } } - fn chain(&self, buffer: Buffer) -> Result { - unsafe { - try_from_glib(ffi::gst_pad_chain( - self.as_ref().to_glib_none().0, - buffer.into_glib_ptr(), - )) - } - } - - fn push(&self, buffer: Buffer) -> Result { - unsafe { - try_from_glib(ffi::gst_pad_push( - self.as_ref().to_glib_none().0, - buffer.into_glib_ptr(), - )) - } - } - - fn chain_list(&self, list: BufferList) -> Result { - unsafe { - try_from_glib(ffi::gst_pad_chain_list( - self.as_ref().to_glib_none().0, - list.into_glib_ptr(), - )) - } - } - - fn push_list(&self, list: BufferList) -> Result { - unsafe { - try_from_glib(ffi::gst_pad_push_list( - self.as_ref().to_glib_none().0, - list.into_glib_ptr(), - )) - } - } - fn range(&self, offset: u64, size: u32) -> Result { unsafe { let mut buffer = ptr::null_mut(); @@ -1918,7 +1871,6 @@ mod tests { use std::sync::{atomic::AtomicUsize, mpsc::channel, Arc, Mutex}; use super::*; - use crate::prelude::*; #[test] fn test_event_chain_functions() { diff --git a/gstreamer/src/plugin.rs b/gstreamer/src/plugin.rs index 48105df09..d0af1a36c 100644 --- a/gstreamer/src/plugin.rs +++ b/gstreamer/src/plugin.rs @@ -2,7 +2,7 @@ use glib::{prelude::*, translate::*}; -use crate::{Plugin, PluginFlags, Structure, StructureRef}; +use crate::{Plugin, PluginFlags, StructureRef}; impl Plugin { #[doc(alias = "get_cache_data")] @@ -17,13 +17,6 @@ impl Plugin { } } } - - #[doc(alias = "gst_plugin_set_cache_data")] - pub fn set_cache_data(&self, cache_data: Structure) { - unsafe { - ffi::gst_plugin_set_cache_data(self.to_glib_none().0, cache_data.into_glib_ptr()); - } - } } pub trait GstPluginExtManual: 'static {