From b8b944b72bd2b96d50a4a73c2463759a97a446a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= Date: Wed, 14 Apr 2021 22:30:38 +0200 Subject: [PATCH] subclass: remove get prefix where applicable --- gstreamer-audio/src/subclass/audio_decoder.rs | 8 ++-- gstreamer-audio/src/subclass/audio_encoder.rs | 8 ++-- gstreamer-base/src/aggregator.rs | 10 ++--- gstreamer-base/src/flow_combiner.rs | 2 +- gstreamer-base/src/subclass/aggregator.rs | 10 ++--- gstreamer-base/src/subclass/base_sink.rs | 16 ++----- gstreamer-base/src/subclass/base_src.rs | 32 ++++++-------- gstreamer-base/src/subclass/base_transform.rs | 8 ++-- gstreamer-controller/src/control_point.rs | 2 +- .../src/subclass/player_video_renderer.rs | 4 +- .../src/subclass/rtsp_client.rs | 8 ++-- gstreamer-sdp/src/sdp_message.rs | 2 +- gstreamer-video/src/subclass/video_decoder.rs | 8 ++-- gstreamer-video/src/subclass/video_encoder.rs | 8 ++-- gstreamer/src/parse_context.rs | 2 +- gstreamer/src/promise.rs | 2 +- gstreamer/src/subclass/child_proxy.rs | 42 +++++++++---------- gstreamer/src/subclass/clock.rs | 22 +++++----- gstreamer/src/subclass/element.rs | 6 +-- gstreamer/src/subclass/uri_handler.rs | 28 ++++++------- 20 files changed, 105 insertions(+), 123 deletions(-) diff --git a/gstreamer-audio/src/subclass/audio_decoder.rs b/gstreamer-audio/src/subclass/audio_decoder.rs index e12f0b4ab..22d631da6 100644 --- a/gstreamer-audio/src/subclass/audio_decoder.rs +++ b/gstreamer-audio/src/subclass/audio_decoder.rs @@ -65,8 +65,8 @@ pub trait AudioDecoderImpl: AudioDecoderImplExt + ElementImpl { self.parent_negotiate(element) } - fn get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { - self.parent_get_caps(element, filter) + fn caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { + self.parent_caps(element, filter) } fn sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { @@ -139,7 +139,7 @@ pub trait AudioDecoderImplExt: ObjectSubclass { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError>; - fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps; + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps; fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool; @@ -399,7 +399,7 @@ impl AudioDecoderImplExt for T { } } - fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; diff --git a/gstreamer-audio/src/subclass/audio_encoder.rs b/gstreamer-audio/src/subclass/audio_encoder.rs index 87c9bafa9..3173fa0fa 100644 --- a/gstreamer-audio/src/subclass/audio_encoder.rs +++ b/gstreamer-audio/src/subclass/audio_encoder.rs @@ -57,8 +57,8 @@ pub trait AudioEncoderImpl: AudioEncoderImplExt + ElementImpl { self.parent_negotiate(element) } - fn get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { - self.parent_get_caps(element, filter) + fn caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { + self.parent_caps(element, filter) } fn sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { @@ -125,7 +125,7 @@ pub trait AudioEncoderImplExt: ObjectSubclass { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError>; - fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps; + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps; fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool; @@ -345,7 +345,7 @@ impl AudioEncoderImplExt for T { } } - fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; diff --git a/gstreamer-base/src/aggregator.rs b/gstreamer-base/src/aggregator.rs index d1d5424fc..f332d0b7b 100644 --- a/gstreamer-base/src/aggregator.rs +++ b/gstreamer-base/src/aggregator.rs @@ -35,11 +35,11 @@ pub trait AggregatorExtManual: 'static { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] - fn property_min_upstream_latency(&self) -> gst::ClockTime; + fn min_upstream_latency(&self) -> gst::ClockTime; #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] - fn set_property_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime); + fn set_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime); #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] @@ -124,7 +124,7 @@ impl> AggregatorExtManual for O { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] - fn property_min_upstream_latency(&self) -> gst::ClockTime { + fn min_upstream_latency(&self) -> gst::ClockTime { unsafe { let mut value = Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( @@ -134,14 +134,14 @@ impl> AggregatorExtManual for O { ); value .get() - .expect("AggregatorExtManual::get_property_min_upstream_latency") + .expect("AggregatorExtManual::min_upstream_latency") .unwrap() } } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] - fn set_property_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime) { + fn set_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, diff --git a/gstreamer-base/src/flow_combiner.rs b/gstreamer-base/src/flow_combiner.rs index 2a7aea635..9727ce8f0 100644 --- a/gstreamer-base/src/flow_combiner.rs +++ b/gstreamer-base/src/flow_combiner.rs @@ -26,7 +26,7 @@ glib::wrapper! { } } }, - get_type => || ffi::gst_flow_combiner_get_type(), + type_ => || ffi::gst_flow_combiner_get_type(), } } diff --git a/gstreamer-base/src/subclass/aggregator.rs b/gstreamer-base/src/subclass/aggregator.rs index 043fcc80a..e94c782b3 100644 --- a/gstreamer-base/src/subclass/aggregator.rs +++ b/gstreamer-base/src/subclass/aggregator.rs @@ -116,8 +116,8 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl { self.parent_stop(aggregator) } - fn get_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime { - self.parent_get_next_time(aggregator) + fn next_time(&self, aggregator: &Self::Type) -> gst::ClockTime { + self.parent_next_time(aggregator) } fn create_new_pad( @@ -244,7 +244,7 @@ pub trait AggregatorImplExt: ObjectSubclass { fn parent_stop(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage>; - fn parent_get_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime; + fn parent_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime; fn parent_create_new_pad( &self, @@ -563,7 +563,7 @@ impl AggregatorImplExt for T { } } - fn parent_get_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime { + fn parent_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; @@ -994,7 +994,7 @@ unsafe extern "C" fn aggregator_get_next_time( let wrap: Borrowed = from_glib_borrow(ptr); gst::panic_to_error!(&wrap, &imp.panicked(), gst::CLOCK_TIME_NONE, { - imp.get_next_time(wrap.unsafe_cast_ref()) + imp.next_time(wrap.unsafe_cast_ref()) }) .to_glib() } diff --git a/gstreamer-base/src/subclass/base_sink.rs b/gstreamer-base/src/subclass/base_sink.rs index d389411ad..0b9be40bb 100644 --- a/gstreamer-base/src/subclass/base_sink.rs +++ b/gstreamer-base/src/subclass/base_sink.rs @@ -59,8 +59,8 @@ pub trait BaseSinkImpl: BaseSinkImplExt + ElementImpl { self.parent_event(element, event) } - fn get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option { - self.parent_get_caps(element, filter) + fn caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option { + self.parent_caps(element, filter) } fn set_caps(&self, element: &Self::Type, caps: &gst::Caps) -> Result<(), gst::LoggableError> { @@ -113,11 +113,7 @@ pub trait BaseSinkImplExt: ObjectSubclass { fn parent_event(&self, element: &Self::Type, event: gst::Event) -> bool; - fn parent_get_caps( - &self, - element: &Self::Type, - filter: Option<&gst::Caps>, - ) -> Option; + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option; fn parent_set_caps( &self, @@ -299,11 +295,7 @@ impl BaseSinkImplExt for T { } } - fn parent_get_caps( - &self, - element: &Self::Type, - filter: Option<&gst::Caps>, - ) -> Option { + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; diff --git a/gstreamer-base/src/subclass/base_src.rs b/gstreamer-base/src/subclass/base_src.rs index 4def87e5b..c62d45b23 100644 --- a/gstreamer-base/src/subclass/base_src.rs +++ b/gstreamer-base/src/subclass/base_src.rs @@ -31,8 +31,8 @@ pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl { self.parent_is_seekable(element) } - fn get_size(&self, element: &Self::Type) -> Option { - self.parent_get_size(element) + fn size(&self, element: &Self::Type) -> Option { + self.parent_size(element) } fn get_times( @@ -40,7 +40,7 @@ pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl { element: &Self::Type, buffer: &gst::BufferRef, ) -> (gst::ClockTime, gst::ClockTime) { - self.parent_get_times(element, buffer) + self.parent_times(element, buffer) } fn fill( @@ -84,8 +84,8 @@ pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl { self.parent_event(element, event) } - fn get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option { - self.parent_get_caps(element, filter) + fn caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option { + self.parent_caps(element, filter) } fn negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { @@ -116,9 +116,9 @@ pub trait BaseSrcImplExt: ObjectSubclass { fn parent_is_seekable(&self, element: &Self::Type) -> bool; - fn parent_get_size(&self, element: &Self::Type) -> Option; + fn parent_size(&self, element: &Self::Type) -> Option; - fn parent_get_times( + fn parent_times( &self, element: &Self::Type, buffer: &gst::BufferRef, @@ -153,11 +153,7 @@ pub trait BaseSrcImplExt: ObjectSubclass { fn parent_event(&self, element: &Self::Type, event: &gst::Event) -> bool; - fn parent_get_caps( - &self, - element: &Self::Type, - filter: Option<&gst::Caps>, - ) -> Option; + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option; fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError>; @@ -226,7 +222,7 @@ impl BaseSrcImplExt for T { } } - fn parent_get_size(&self, element: &Self::Type) -> Option { + fn parent_size(&self, element: &Self::Type) -> Option { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; @@ -247,7 +243,7 @@ impl BaseSrcImplExt for T { } } - fn parent_get_times( + fn parent_times( &self, element: &Self::Type, buffer: &gst::BufferRef, @@ -462,11 +458,7 @@ impl BaseSrcImplExt for T { } } - fn parent_get_caps( - &self, - element: &Self::Type, - filter: Option<&gst::Caps>, - ) -> Option { + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; @@ -668,7 +660,7 @@ unsafe extern "C" fn base_src_get_size( let wrap: Borrowed = from_glib_borrow(ptr); gst::panic_to_error!(&wrap, &imp.panicked(), false, { - match imp.get_size(wrap.unsafe_cast_ref()) { + match imp.size(wrap.unsafe_cast_ref()) { Some(s) => { *size = s; true diff --git a/gstreamer-base/src/subclass/base_transform.rs b/gstreamer-base/src/subclass/base_transform.rs index 30306f12a..72849c3e4 100644 --- a/gstreamer-base/src/subclass/base_transform.rs +++ b/gstreamer-base/src/subclass/base_transform.rs @@ -91,8 +91,8 @@ pub trait BaseTransformImpl: BaseTransformImplExt + ElementImpl { self.parent_transform_size(element, direction, caps, size, othercaps) } - fn get_unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option { - self.parent_get_unit_size(element, caps) + fn unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option { + self.parent_unit_size(element, caps) } fn sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { @@ -227,7 +227,7 @@ pub trait BaseTransformImplExt: ObjectSubclass { othercaps: &gst::Caps, ) -> Option; - fn parent_get_unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option; + fn parent_unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option; fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool; @@ -496,7 +496,7 @@ impl BaseTransformImplExt for T { } } - fn parent_get_unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option { + fn parent_unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; diff --git a/gstreamer-controller/src/control_point.rs b/gstreamer-controller/src/control_point.rs index fa7646bf6..44ce0ac0d 100644 --- a/gstreamer-controller/src/control_point.rs +++ b/gstreamer-controller/src/control_point.rs @@ -9,7 +9,7 @@ glib::wrapper! { match fn { copy => |ptr| ffi::gst_control_point_copy(mut_override(ptr)), free => |ptr| ffi::gst_control_point_free(ptr), - get_type => || ffi::gst_control_point_get_type(), + type_ => || ffi::gst_control_point_get_type(), } } diff --git a/gstreamer-player/src/subclass/player_video_renderer.rs b/gstreamer-player/src/subclass/player_video_renderer.rs index 6add17fbd..47f8af835 100644 --- a/gstreamer-player/src/subclass/player_video_renderer.rs +++ b/gstreamer-player/src/subclass/player_video_renderer.rs @@ -36,9 +36,7 @@ impl PlayerVideoRendererImplExt for T { ) -> gst::Element { unsafe { let type_data = Self::type_data(); - let parent_iface = type_data - .as_ref() - .get_parent_interface::() + let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstPlayerVideoRendererInterface; let func = (*parent_iface) diff --git a/gstreamer-rtsp-server/src/subclass/rtsp_client.rs b/gstreamer-rtsp-server/src/subclass/rtsp_client.rs index 500ab2cae..e16485b82 100644 --- a/gstreamer-rtsp-server/src/subclass/rtsp_client.rs +++ b/gstreamer-rtsp-server/src/subclass/rtsp_client.rs @@ -81,8 +81,8 @@ pub trait RTSPClientImpl: RTSPClientImplExt + ObjectImpl + Send + Sync { self.parent_set_parameter_request(client, ctx); } - fn get_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { - self.parent_get_parameter_request(client, ctx); + fn parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { + self.parent_parameter_request(client, ctx); } fn announce_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { @@ -253,7 +253,7 @@ pub trait RTSPClientImplExt: ObjectSubclass { fn parent_set_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext); - fn parent_get_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext); + fn parent_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext); fn parent_announce_request(&self, client: &Self::Type, ctx: &crate::RTSPContext); @@ -560,7 +560,7 @@ impl RTSPClientImplExt for T { } } - fn parent_get_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { + fn parent_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; diff --git a/gstreamer-sdp/src/sdp_message.rs b/gstreamer-sdp/src/sdp_message.rs index 99ed878b5..21d08153e 100644 --- a/gstreamer-sdp/src/sdp_message.rs +++ b/gstreamer-sdp/src/sdp_message.rs @@ -30,7 +30,7 @@ glib::wrapper! { copy }, free => |ptr| assert_eq!(ffi::gst_sdp_message_free(ptr), ffi::GST_SDP_OK), - get_type => || ffi::gst_sdp_message_get_type(), + type_ => || ffi::gst_sdp_message_get_type(), } } diff --git a/gstreamer-video/src/subclass/video_decoder.rs b/gstreamer-video/src/subclass/video_decoder.rs index 734715040..4b28351a7 100644 --- a/gstreamer-video/src/subclass/video_decoder.rs +++ b/gstreamer-video/src/subclass/video_decoder.rs @@ -70,8 +70,8 @@ pub trait VideoDecoderImpl: VideoDecoderImplExt + ElementImpl { self.parent_negotiate(element) } - fn get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { - self.parent_get_caps(element, filter) + fn caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { + self.parent_caps(element, filter) } fn sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { @@ -144,7 +144,7 @@ pub trait VideoDecoderImplExt: ObjectSubclass { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError>; - fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps; + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps; fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool; @@ -401,7 +401,7 @@ impl VideoDecoderImplExt for T { } } - fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; diff --git a/gstreamer-video/src/subclass/video_encoder.rs b/gstreamer-video/src/subclass/video_encoder.rs index 67e4bc54a..d870e5d71 100644 --- a/gstreamer-video/src/subclass/video_encoder.rs +++ b/gstreamer-video/src/subclass/video_encoder.rs @@ -56,8 +56,8 @@ pub trait VideoEncoderImpl: VideoEncoderImplExt + ElementImpl { self.parent_negotiate(element) } - fn get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { - self.parent_get_caps(element, filter) + fn caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { + self.parent_caps(element, filter) } fn sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { @@ -120,7 +120,7 @@ pub trait VideoEncoderImplExt: ObjectSubclass { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError>; - fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps; + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps; fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool; @@ -335,7 +335,7 @@ impl VideoEncoderImplExt for T { } } - fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { + fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; diff --git a/gstreamer/src/parse_context.rs b/gstreamer/src/parse_context.rs index bc22057d1..2902e605f 100644 --- a/gstreamer/src/parse_context.rs +++ b/gstreamer/src/parse_context.rs @@ -17,7 +17,7 @@ glib::wrapper! { } }, free => |ptr| ffi::gst_parse_context_free(ptr), - get_type => || ffi::gst_parse_context_get_type(), + type_ => || ffi::gst_parse_context_get_type(), } } diff --git a/gstreamer/src/promise.rs b/gstreamer/src/promise.rs index 5b345c798..b0c880ad7 100644 --- a/gstreamer/src/promise.rs +++ b/gstreamer/src/promise.rs @@ -17,7 +17,7 @@ glib::wrapper! { match fn { ref => |ptr| ffi::gst_mini_object_ref(ptr as *mut _), unref => |ptr| ffi::gst_mini_object_unref(ptr as *mut _), - get_type => || ffi::gst_promise_get_type(), + type_ => || ffi::gst_promise_get_type(), } } diff --git a/gstreamer/src/subclass/child_proxy.rs b/gstreamer/src/subclass/child_proxy.rs index d5a642cd3..684accee7 100644 --- a/gstreamer/src/subclass/child_proxy.rs +++ b/gstreamer/src/subclass/child_proxy.rs @@ -7,12 +7,12 @@ use glib::translate::*; use crate::ChildProxy; pub trait ChildProxyImpl: ObjectImpl + Send + Sync { - fn get_child_by_name(&self, object: &Self::Type, name: &str) -> Option { - self.parent_get_child_by_name(object, name) + fn child_by_name(&self, object: &Self::Type, name: &str) -> Option { + self.parent_child_by_name(object, name) } - fn get_child_by_index(&self, object: &Self::Type, index: u32) -> Option; - fn get_children_count(&self, object: &Self::Type) -> u32; + fn child_by_index(&self, object: &Self::Type, index: u32) -> Option; + fn children_count(&self, object: &Self::Type) -> u32; fn child_added(&self, object: &Self::Type, child: &glib::Object, name: &str) { self.parent_child_added(object, child, name); @@ -23,25 +23,25 @@ pub trait ChildProxyImpl: ObjectImpl + Send + Sync { } pub trait ChildProxyImplExt: ObjectSubclass { - fn parent_get_child_by_name(&self, object: &Self::Type, name: &str) -> Option; + fn parent_child_by_name(&self, object: &Self::Type, name: &str) -> Option; - fn parent_get_child_by_index(&self, object: &Self::Type, index: u32) -> Option; - fn parent_get_children_count(&self, object: &Self::Type) -> u32; + fn parent_child_by_index(&self, object: &Self::Type, index: u32) -> Option; + fn parent_children_count(&self, object: &Self::Type) -> u32; fn parent_child_added(&self, _object: &Self::Type, _child: &glib::Object, _name: &str); fn parent_child_removed(&self, _object: &Self::Type, _child: &glib::Object, _name: &str); } impl ChildProxyImplExt for T { - fn parent_get_child_by_name(&self, object: &Self::Type, name: &str) -> Option { + fn parent_child_by_name(&self, object: &Self::Type, name: &str) -> Option { unsafe { let type_data = Self::type_data(); - let parent_iface = type_data.as_ref().get_parent_interface::() + let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstChildProxyInterface; let func = (*parent_iface) .get_child_by_name - .expect("no parent \"get_child_by_name\" implementation"); + .expect("no parent \"child_by_name\" implementation"); let ret = func( object.unsafe_cast_ref::().to_glib_none().0, name.to_glib_none().0, @@ -50,15 +50,15 @@ impl ChildProxyImplExt for T { } } - fn parent_get_child_by_index(&self, object: &Self::Type, index: u32) -> Option { + fn parent_child_by_index(&self, object: &Self::Type, index: u32) -> Option { unsafe { let type_data = Self::type_data(); - let parent_iface = type_data.as_ref().get_parent_interface::() + let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstChildProxyInterface; let func = (*parent_iface) .get_child_by_index - .expect("no parent \"get_child_by_index\" implementation"); + .expect("no parent \"child_by_index\" implementation"); let ret = func( object.unsafe_cast_ref::().to_glib_none().0, index, @@ -67,15 +67,15 @@ impl ChildProxyImplExt for T { } } - fn parent_get_children_count(&self, object: &Self::Type) -> u32 { + fn parent_children_count(&self, object: &Self::Type) -> u32 { unsafe { let type_data = Self::type_data(); - let parent_iface = type_data.as_ref().get_parent_interface::() + let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstChildProxyInterface; let func = (*parent_iface) .get_children_count - .expect("no parent \"get_children_count\" implementation"); + .expect("no parent \"children_count\" implementation"); func(object.unsafe_cast_ref::().to_glib_none().0) } } @@ -83,7 +83,7 @@ impl ChildProxyImplExt for T { fn parent_child_added(&self, object: &Self::Type, child: &glib::Object, name: &str) { unsafe { let type_data = Self::type_data(); - let parent_iface = type_data.as_ref().get_parent_interface::() + let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstChildProxyInterface; if let Some(func) = (*parent_iface).child_added { @@ -99,7 +99,7 @@ impl ChildProxyImplExt for T { fn parent_child_removed(&self, object: &Self::Type, child: &glib::Object, name: &str) { unsafe { let type_data = Self::type_data(); - let parent_iface = type_data.as_ref().get_parent_interface::() + let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstChildProxyInterface; if let Some(func) = (*parent_iface).child_removed { @@ -134,7 +134,7 @@ unsafe extern "C" fn child_proxy_get_child_by_name( let instance = &*(child_proxy as *mut T::Instance); let imp = instance.impl_(); - imp.get_child_by_name( + imp.child_by_name( &from_glib_borrow::<_, ChildProxy>(child_proxy).unsafe_cast_ref(), &glib::GString::from_glib_borrow(name), ) @@ -148,7 +148,7 @@ unsafe extern "C" fn child_proxy_get_child_by_index( let instance = &*(child_proxy as *mut T::Instance); let imp = instance.impl_(); - imp.get_child_by_index( + imp.child_by_index( &from_glib_borrow::<_, ChildProxy>(child_proxy).unsafe_cast_ref(), index, ) @@ -161,7 +161,7 @@ unsafe extern "C" fn child_proxy_get_children_count( let instance = &*(child_proxy as *mut T::Instance); let imp = instance.impl_(); - imp.get_children_count(&from_glib_borrow::<_, ChildProxy>(child_proxy).unsafe_cast_ref()) + imp.children_count(&from_glib_borrow::<_, ChildProxy>(child_proxy).unsafe_cast_ref()) } unsafe extern "C" fn child_proxy_child_added( diff --git a/gstreamer/src/subclass/clock.rs b/gstreamer/src/subclass/clock.rs index 01e06e253..144ee44c2 100644 --- a/gstreamer/src/subclass/clock.rs +++ b/gstreamer/src/subclass/clock.rs @@ -22,12 +22,12 @@ pub trait ClockImpl: ClockImplExt + ObjectImpl + Send + Sync { self.parent_change_resolution(clock, old_resolution, new_resolution) } - fn get_resolution(&self, clock: &Self::Type) -> ClockTime { - self.parent_get_resolution(clock) + fn resolution(&self, clock: &Self::Type) -> ClockTime { + self.parent_resolution(clock) } - fn get_internal_time(&self, clock: &Self::Type) -> ClockTime { - self.parent_get_internal_time(clock) + fn internal_time(&self, clock: &Self::Type) -> ClockTime { + self.parent_internal_time(clock) } fn wait( @@ -55,9 +55,9 @@ pub trait ClockImplExt: ObjectSubclass { new_resolution: ClockTime, ) -> ClockTime; - fn parent_get_resolution(&self, clock: &Self::Type) -> ClockTime; + fn parent_resolution(&self, clock: &Self::Type) -> ClockTime; - fn parent_get_internal_time(&self, clock: &Self::Type) -> ClockTime; + fn parent_internal_time(&self, clock: &Self::Type) -> ClockTime; fn parent_wait( &self, @@ -97,12 +97,12 @@ impl ClockImplExt for T { new_resolution.to_glib(), )) } else { - self.get_resolution(clock) + self.resolution(clock) } } } - fn parent_get_resolution(&self, clock: &Self::Type) -> ClockTime { + fn parent_resolution(&self, clock: &Self::Type) -> ClockTime { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass; @@ -116,7 +116,7 @@ impl ClockImplExt for T { } } - fn parent_get_internal_time(&self, clock: &Self::Type) -> ClockTime { + fn parent_internal_time(&self, clock: &Self::Type) -> ClockTime { unsafe { let data = T::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass; @@ -271,7 +271,7 @@ unsafe extern "C" fn clock_get_resolution( let imp = instance.impl_(); let wrap: Borrowed = from_glib_borrow(ptr); - imp.get_resolution(wrap.unsafe_cast_ref()).to_glib() + imp.resolution(wrap.unsafe_cast_ref()).to_glib() } unsafe extern "C" fn clock_get_internal_time( @@ -281,7 +281,7 @@ unsafe extern "C" fn clock_get_internal_time( let imp = instance.impl_(); let wrap: Borrowed = from_glib_borrow(ptr); - imp.get_internal_time(wrap.unsafe_cast_ref()).to_glib() + imp.internal_time(wrap.unsafe_cast_ref()).to_glib() } unsafe extern "C" fn clock_wait( diff --git a/gstreamer/src/subclass/element.rs b/gstreamer/src/subclass/element.rs index df84cb880..2242d6738 100644 --- a/gstreamer/src/subclass/element.rs +++ b/gstreamer/src/subclass/element.rs @@ -317,7 +317,7 @@ impl ElementImplExt for T { } fn panicked(&self) -> &atomic::AtomicBool { - self.get_instance_data::(crate::Element::static_type()) + self.instance_data::(crate::Element::static_type()) .expect("instance not initialized correctly") } @@ -328,7 +328,7 @@ impl ElementImplExt for T { f: F, ) -> R { unsafe { - assert!(element.type_().is_a(T::get_type())); + assert!(element.type_().is_a(T::type_())); let ptr: *mut ffi::GstElement = element.as_ptr() as *mut _; let instance = &*(ptr as *mut T::Instance); let imp = instance.impl_(); @@ -344,7 +344,7 @@ impl ElementImplExt for T { ) -> R { unsafe { let wrap = parent.as_ref().unwrap().downcast_ref::().unwrap(); - assert!(wrap.type_().is_a(T::get_type())); + assert!(wrap.type_().is_a(T::type_())); let ptr: *mut ffi::GstElement = wrap.to_glib_none().0; let instance = &*(ptr as *mut T::Instance); let imp = instance.impl_(); diff --git a/gstreamer/src/subclass/uri_handler.rs b/gstreamer/src/subclass/uri_handler.rs index aea6b48c2..c4d0db526 100644 --- a/gstreamer/src/subclass/uri_handler.rs +++ b/gstreamer/src/subclass/uri_handler.rs @@ -12,41 +12,41 @@ use std::ptr; pub trait URIHandlerImpl: super::element::ElementImpl { const URI_TYPE: URIType; - fn get_protocols() -> &'static [&'static str]; - fn get_uri(&self, element: &Self::Type) -> Option; + fn protocols() -> &'static [&'static str]; + fn uri(&self, element: &Self::Type) -> Option; fn set_uri(&self, element: &Self::Type, uri: &str) -> Result<(), glib::Error>; } pub trait URIHandlerImplExt: ObjectSubclass { - fn parent_get_protocols() -> Vec; - fn parent_get_uri(&self, element: &Self::Type) -> Option; + fn parent_protocols() -> Vec; + fn parent_uri(&self, element: &Self::Type) -> Option; fn parent_set_uri(&self, element: &Self::Type, uri: &str) -> Result<(), glib::Error>; } impl URIHandlerImplExt for T { - fn parent_get_protocols() -> Vec { + fn parent_protocols() -> Vec { unsafe { let type_data = Self::type_data(); - let parent_iface = type_data.as_ref().get_parent_interface::() + let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstURIHandlerInterface; let func = (*parent_iface) .get_protocols - .expect("no parent \"get_protocols\" implementation"); + .expect("no parent \"protocols\" implementation"); let ret = func(Self::ParentType::static_type().to_glib()); FromGlibPtrContainer::from_glib_none(ret) } } - fn parent_get_uri(&self, element: &Self::Type) -> Option { + fn parent_uri(&self, element: &Self::Type) -> Option { unsafe { let type_data = Self::type_data(); - let parent_iface = type_data.as_ref().get_parent_interface::() + let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstURIHandlerInterface; let func = (*parent_iface) .get_uri - .expect("no parent \"get_uri\" implementation"); + .expect("no parent \"uri\" implementation"); let ret = func(element.unsafe_cast_ref::().to_glib_none().0); from_glib_full(ret) } @@ -55,7 +55,7 @@ impl URIHandlerImplExt for T { fn parent_set_uri(&self, element: &Self::Type, uri: &str) -> Result<(), glib::Error> { unsafe { let type_data = Self::type_data(); - let parent_iface = type_data.as_ref().get_parent_interface::() + let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstURIHandlerInterface; let func = (*parent_iface) @@ -90,7 +90,7 @@ unsafe impl IsImplementable for URIHandler { // Store the protocols in the interface data for later use unsafe { let mut data = T::type_data(); - let protocols = T::get_protocols(); + let protocols = T::protocols(); let protocols = protocols.to_glib_full(); let data = data.as_mut(); @@ -117,7 +117,7 @@ unsafe extern "C" fn uri_handler_get_protocols( ) -> *const *const libc::c_char { let data = ::type_data(); data.as_ref() - .get_class_data::(URIHandler::static_type()) + .class_data::(URIHandler::static_type()) .unwrap_or(&CStrV(std::ptr::null())) .0 } @@ -128,7 +128,7 @@ unsafe extern "C" fn uri_handler_get_uri( let instance = &*(uri_handler as *mut T::Instance); let imp = instance.impl_(); - imp.get_uri(&from_glib_borrow::<_, URIHandler>(uri_handler).unsafe_cast_ref()) + imp.uri(&from_glib_borrow::<_, URIHandler>(uri_handler).unsafe_cast_ref()) .to_glib_full() }