From e80a29372af68ac715a1a829213dc37e73e91c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= Date: Tue, 20 Apr 2021 12:23:24 +0200 Subject: [PATCH] fix-getters-def 0.3.0 pass --- examples/src/bin/custom_meta.rs | 2 +- examples/src/bin/rtpfecclient.rs | 4 ++-- examples/src/bin/rtpfecserver.rs | 4 ++-- examples/src/bin/subclass.rs | 2 +- examples/src/examples-common.rs | 2 +- gstreamer-audio/src/audio_channel_position.rs | 4 ++-- gstreamer-audio/src/audio_meta.rs | 4 ++-- gstreamer-base/src/adapter.rs | 16 +++++++-------- gstreamer-base/src/subclass/base_src.rs | 2 +- .../src/timeline_element.rs | 4 ++-- gstreamer-gl/egl/src/gl_display_egl.rs | 2 +- gstreamer-gl/src/gl_context.rs | 8 ++++---- gstreamer-gl/src/gl_sync_meta.rs | 2 +- gstreamer-gl/src/gl_video_frame.rs | 6 +++--- gstreamer-net/src/net_address_meta.rs | 2 +- gstreamer-rtp/src/rtp_buffer.rs | 6 +++--- gstreamer-rtsp-server/src/rtsp_token.rs | 2 +- gstreamer-sdp/src/sdp_media.rs | 14 ++++++------- gstreamer-sdp/src/sdp_message.rs | 20 +++++++++---------- gstreamer-video/src/video_decoder.rs | 4 ++-- gstreamer-video/src/video_encoder.rs | 4 ++-- gstreamer-video/src/video_meta.rs | 18 ++++++++--------- .../src/video_overlay_composition.rs | 14 ++++++------- gstreamer-video/src/video_time_code.rs | 2 +- gstreamer/src/buffer.rs | 10 +++++----- gstreamer/src/bufferlist.rs | 2 +- gstreamer/src/caps.rs | 8 ++++---- gstreamer/src/caps_features.rs | 2 +- gstreamer/src/child_proxy.rs | 4 ++-- gstreamer/src/control_binding.rs | 4 ++-- gstreamer/src/control_source.rs | 4 ++-- gstreamer/src/date_time.rs | 2 +- gstreamer/src/device_provider.rs | 4 ++-- gstreamer/src/element.rs | 16 +++++++-------- gstreamer/src/format.rs | 10 +++++----- gstreamer/src/log.rs | 2 +- gstreamer/src/meta.rs | 10 +++++----- gstreamer/src/object.rs | 4 ++-- gstreamer/src/pad.rs | 8 ++++---- gstreamer/src/promise.rs | 2 +- gstreamer/src/structure.rs | 4 ++-- gstreamer/src/tags.rs | 10 +++++----- tutorials/src/tutorials-common.rs | 2 +- 43 files changed, 128 insertions(+), 128 deletions(-) diff --git a/examples/src/bin/custom_meta.rs b/examples/src/bin/custom_meta.rs index 6b828f987..7f44d8104 100644 --- a/examples/src/bin/custom_meta.rs +++ b/examples/src/bin/custom_meta.rs @@ -54,7 +54,7 @@ mod custom_meta { unsafe impl MetaAPI for CustomMeta { type GstType = imp::CustomMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { imp::custom_meta_api_get_type() } } diff --git a/examples/src/bin/rtpfecclient.rs b/examples/src/bin/rtpfecclient.rs index aa8426f41..7104fb7dc 100644 --- a/examples/src/bin/rtpfecclient.rs +++ b/examples/src/bin/rtpfecclient.rs @@ -44,7 +44,7 @@ fn make_element( } } -fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result { +fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result { match element.get_static_pad(pad_name) { Some(pad) => Ok(pad), None => { @@ -54,7 +54,7 @@ fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result Result { +fn request_pad(element: &gst::Element, pad_name: &'static str) -> Result { match element.get_request_pad(pad_name) { Some(pad) => Ok(pad), None => { diff --git a/examples/src/bin/rtpfecserver.rs b/examples/src/bin/rtpfecserver.rs index e3f0cd1a8..2215bad77 100644 --- a/examples/src/bin/rtpfecserver.rs +++ b/examples/src/bin/rtpfecserver.rs @@ -40,7 +40,7 @@ fn make_element( } } -fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result { +fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result { match element.get_static_pad(pad_name) { Some(pad) => Ok(pad), None => { @@ -50,7 +50,7 @@ fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result Result { +fn request_pad(element: &gst::Element, pad_name: &'static str) -> Result { match element.get_request_pad(pad_name) { Some(pad) => Ok(pad), None => { diff --git a/examples/src/bin/subclass.rs b/examples/src/bin/subclass.rs index 7ef0fd27a..27c64183d 100644 --- a/examples/src/bin/subclass.rs +++ b/examples/src/bin/subclass.rs @@ -140,7 +140,7 @@ mod fir_filter { // Returns the size of one processing unit (i.e. a frame in our case) corresponding // to the given caps. This is used for allocating a big enough output buffer and // sanity checking the input buffer size, among other things. - fn get_unit_size(&self, _element: &Self::Type, caps: &gst::Caps) -> Option { + fn unit_size(&self, _element: &Self::Type, caps: &gst::Caps) -> Option { let audio_info = gst_audio::AudioInfo::from_caps(caps).ok(); audio_info.map(|info| info.bpf() as usize) } diff --git a/examples/src/examples-common.rs b/examples/src/examples-common.rs index 353adb4c9..fec002d9b 100644 --- a/examples/src/examples-common.rs +++ b/examples/src/examples-common.rs @@ -20,7 +20,7 @@ mod runloop { } } - pub fn get_main() -> CFRunLoop { + pub fn main() -> CFRunLoop { unsafe { let r = CFRunLoopGetMain(); assert!(!r.is_null()); diff --git a/gstreamer-audio/src/audio_channel_position.rs b/gstreamer-audio/src/audio_channel_position.rs index 03c469f1e..f0ac71e68 100644 --- a/gstreamer-audio/src/audio_channel_position.rs +++ b/gstreamer-audio/src/audio_channel_position.rs @@ -123,7 +123,7 @@ impl AudioChannelPosition { } } - pub fn get_fallback_mask(channels: u32) -> u64 { + pub fn fallback_mask(channels: u32) -> u64 { assert_initialized_main_thread!(); unsafe { ffi::gst_audio_channel_get_fallback_mask(channels as i32) } @@ -257,7 +257,7 @@ pub fn reorder_channels( } } -pub fn get_channel_reorder_map( +pub fn channel_reorder_map( from: &[AudioChannelPosition], to: &[AudioChannelPosition], reorder_map: &mut [usize], diff --git a/gstreamer-audio/src/audio_meta.rs b/gstreamer-audio/src/audio_meta.rs index dc8e789ba..bb49d85bd 100644 --- a/gstreamer-audio/src/audio_meta.rs +++ b/gstreamer-audio/src/audio_meta.rs @@ -54,7 +54,7 @@ impl AudioClippingMeta { unsafe impl MetaAPI for AudioClippingMeta { type GstType = ffi::GstAudioClippingMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_audio_clipping_meta_api_get_type()) } } } @@ -191,7 +191,7 @@ impl AudioMeta { unsafe impl MetaAPI for AudioMeta { type GstType = ffi::GstAudioMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_audio_meta_api_get_type()) } } } diff --git a/gstreamer-base/src/adapter.rs b/gstreamer-base/src/adapter.rs index f9328a3c9..32c2adc4a 100644 --- a/gstreamer-base/src/adapter.rs +++ b/gstreamer-base/src/adapter.rs @@ -60,7 +60,7 @@ impl Adapter { } } - pub fn get_buffer(&self, nbytes: usize) -> Result { + pub fn buffer(&self, nbytes: usize) -> Result { assert!(nbytes <= self.available()); assert!(nbytes != 0); @@ -70,7 +70,7 @@ impl Adapter { } } - pub fn get_buffer_fast(&self, nbytes: usize) -> Result { + pub fn buffer_fast(&self, nbytes: usize) -> Result { assert!(nbytes <= self.available()); assert!(nbytes != 0); @@ -83,7 +83,7 @@ impl Adapter { } } - pub fn get_buffer_list(&self, nbytes: usize) -> Result { + pub fn buffer_list(&self, nbytes: usize) -> Result { assert!(nbytes <= self.available()); assert!(nbytes != 0); @@ -96,7 +96,7 @@ impl Adapter { } } - pub fn get_list(&self, nbytes: usize) -> Result, glib::BoolError> { + pub fn list(&self, nbytes: usize) -> Result, glib::BoolError> { assert!(nbytes <= self.available()); assert!(nbytes != 0); @@ -292,19 +292,19 @@ impl UniqueAdapter { self.0.flush(flush); } - pub fn get_buffer(&self, nbytes: usize) -> Result { + pub fn buffer(&self, nbytes: usize) -> Result { self.0.get_buffer(nbytes) } - pub fn get_buffer_fast(&self, nbytes: usize) -> Result { + pub fn buffer_fast(&self, nbytes: usize) -> Result { self.0.get_buffer_fast(nbytes) } - pub fn get_buffer_list(&self, nbytes: usize) -> Result { + pub fn buffer_list(&self, nbytes: usize) -> Result { self.0.get_buffer_list(nbytes) } - pub fn get_list(&self, nbytes: usize) -> Result, glib::BoolError> { + pub fn list(&self, nbytes: usize) -> Result, glib::BoolError> { self.0.get_list(nbytes) } diff --git a/gstreamer-base/src/subclass/base_src.rs b/gstreamer-base/src/subclass/base_src.rs index c62d45b23..cf064bc88 100644 --- a/gstreamer-base/src/subclass/base_src.rs +++ b/gstreamer-base/src/subclass/base_src.rs @@ -35,7 +35,7 @@ pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl { self.parent_size(element) } - fn get_times( + fn times( &self, element: &Self::Type, buffer: &gst::BufferRef, diff --git a/gstreamer-editing-services/src/timeline_element.rs b/gstreamer-editing-services/src/timeline_element.rs index e07d3a79e..31343c4f8 100644 --- a/gstreamer-editing-services/src/timeline_element.rs +++ b/gstreamer-editing-services/src/timeline_element.rs @@ -6,7 +6,7 @@ use glib::translate::*; use std::ptr; pub trait TimelineElementExtManual: 'static { - fn get_child_property(&self, name: &str) -> Option; + fn child_property(&self, name: &str) -> Option; fn set_child_property( &self, name: &str, @@ -15,7 +15,7 @@ pub trait TimelineElementExtManual: 'static { } impl> TimelineElementExtManual for O { - fn get_child_property(&self, name: &str) -> Option { + fn child_property(&self, name: &str) -> Option { unsafe { let found: bool = from_glib(ffi::ges_timeline_element_lookup_child( self.as_ref().to_glib_none().0, diff --git a/gstreamer-gl/egl/src/gl_display_egl.rs b/gstreamer-gl/egl/src/gl_display_egl.rs index 2d394fdbc..95071f600 100644 --- a/gstreamer-gl/egl/src/gl_display_egl.rs +++ b/gstreamer-gl/egl/src/gl_display_egl.rs @@ -22,7 +22,7 @@ impl GLDisplayEGL { .ok_or_else(|| glib::bool_error!("Failed to create new EGL GL display")) } - pub unsafe fn get_from_native(display_type: GLDisplayType, display: uintptr_t) -> gpointer { + pub unsafe fn from_native(display_type: GLDisplayType, display: uintptr_t) -> gpointer { ffi::gst_gl_display_egl_get_from_native(display_type.to_glib(), display) } } diff --git a/gstreamer-gl/src/gl_context.rs b/gstreamer-gl/src/gl_context.rs index 952820d95..8ded7e8a9 100644 --- a/gstreamer-gl/src/gl_context.rs +++ b/gstreamer-gl/src/gl_context.rs @@ -23,12 +23,12 @@ impl GLContext { )) } - pub fn get_current_gl_context(context_type: GLPlatform) -> uintptr_t { + pub fn current_gl_context(context_type: GLPlatform) -> uintptr_t { skip_assert_initialized!(); unsafe { ffi::gst_gl_context_get_current_gl_context(context_type.to_glib()) as uintptr_t } } - pub fn get_proc_address_with_platform( + pub fn proc_address_with_platform( context_type: GLPlatform, gl_api: GLAPI, name: &str, @@ -47,7 +47,7 @@ impl GLContext { pub trait GLContextExtManual: 'static { fn gl_context(&self) -> uintptr_t; - fn get_proc_address(&self, name: &str) -> uintptr_t; + fn proc_address(&self, name: &str) -> uintptr_t; } impl> GLContextExtManual for O { @@ -55,7 +55,7 @@ impl> GLContextExtManual for O { unsafe { ffi::gst_gl_context_get_gl_context(self.as_ref().to_glib_none().0) as uintptr_t } } - fn get_proc_address(&self, name: &str) -> uintptr_t { + fn proc_address(&self, name: &str) -> uintptr_t { unsafe { ffi::gst_gl_context_get_proc_address( self.as_ref().to_glib_none().0, diff --git a/gstreamer-gl/src/gl_sync_meta.rs b/gstreamer-gl/src/gl_sync_meta.rs index 17ffbc498..15f87c53b 100644 --- a/gstreamer-gl/src/gl_sync_meta.rs +++ b/gstreamer-gl/src/gl_sync_meta.rs @@ -63,7 +63,7 @@ impl GLSyncMeta { unsafe impl MetaAPI for GLSyncMeta { type GstType = ffi::GstGLSyncMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_gl_sync_meta_api_get_type()) } } } diff --git a/gstreamer-gl/src/gl_video_frame.rs b/gstreamer-gl/src/gl_video_frame.rs index 7604a5230..5608f2799 100644 --- a/gstreamer-gl/src/gl_video_frame.rs +++ b/gstreamer-gl/src/gl_video_frame.rs @@ -17,7 +17,7 @@ pub trait VideoFrameGLExt { info: &'b gst_video::VideoInfo, ) -> Result, glib::error::BoolError>; - fn get_texture_id(&self, idx: u32) -> Option; + fn texture_id(&self, idx: u32) -> Option; } impl VideoFrameGLExt for gst_video::VideoFrame { @@ -37,7 +37,7 @@ impl VideoFrameGLExt for gst_video::VideoFrame { gst_video::VideoFrameRef::<&gst::BufferRef>::from_buffer_ref_readable_gl(buffer, info) } - fn get_texture_id(&self, idx: u32) -> Option { + fn texture_id(&self, idx: u32) -> Option { self.as_video_frame_ref().get_texture_id(idx) } } @@ -123,7 +123,7 @@ impl<'a> VideoFrameGLExt for gst_video::VideoFrameRef<&'a gst::BufferRef> { } } - fn get_texture_id(&self, idx: u32) -> Option { + fn texture_id(&self, idx: u32) -> Option { let len = buffer_n_gl_memory(self.buffer())?; if idx >= len { diff --git a/gstreamer-net/src/net_address_meta.rs b/gstreamer-net/src/net_address_meta.rs index 5a54e4880..ca721ace2 100644 --- a/gstreamer-net/src/net_address_meta.rs +++ b/gstreamer-net/src/net_address_meta.rs @@ -42,7 +42,7 @@ impl NetAddressMeta { unsafe impl MetaAPI for NetAddressMeta { type GstType = ffi::GstNetAddressMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_net_address_meta_api_get_type()) } } } diff --git a/gstreamer-rtp/src/rtp_buffer.rs b/gstreamer-rtp/src/rtp_buffer.rs index 306d5fb11..472afceca 100644 --- a/gstreamer-rtp/src/rtp_buffer.rs +++ b/gstreamer-rtp/src/rtp_buffer.rs @@ -194,7 +194,7 @@ impl<'a, T> RTPBuffer<'a, T> { } } - pub fn get_csrc(&self, idx: u8) -> Option { + pub fn csrc(&self, idx: u8) -> Option { if idx < self.csrc_count() { unsafe { Some(ffi::gst_rtp_buffer_get_csrc( @@ -265,7 +265,7 @@ impl<'a, T> RTPBuffer<'a, T> { } } - pub fn get_extension_onebyte_header(&self, id: u8, nth: u32) -> Option<&[u8]> { + pub fn extension_onebyte_header(&self, id: u8, nth: u32) -> Option<&[u8]> { unsafe { let mut data = ptr::null_mut(); // FIXME: Workaround for gstreamer-rtp-sys having the wrong type for this parameter @@ -286,7 +286,7 @@ impl<'a, T> RTPBuffer<'a, T> { } } - pub fn get_extension_twobytes_header(&self, id: u8, nth: u32) -> Option<(u8, &[u8])> { + pub fn extension_twobytes_header(&self, id: u8, nth: u32) -> Option<(u8, &[u8])> { unsafe { let mut data = ptr::null_mut(); // FIXME: Workaround for gstreamer-rtp-sys having the wrong type for this parameter diff --git a/gstreamer-rtsp-server/src/rtsp_token.rs b/gstreamer-rtsp-server/src/rtsp_token.rs index 789c84196..f3181725d 100644 --- a/gstreamer-rtsp-server/src/rtsp_token.rs +++ b/gstreamer-rtsp-server/src/rtsp_token.rs @@ -33,7 +33,7 @@ impl RTSPToken { } impl RTSPTokenRef { - pub fn get_string(&self, field: &str) -> Option { + pub fn string(&self, field: &str) -> Option { unsafe { from_glib_none(ffi::gst_rtsp_token_get_string( self.as_mut_ptr(), diff --git a/gstreamer-sdp/src/sdp_media.rs b/gstreamer-sdp/src/sdp_media.rs index a01bd18ec..dcd351e50 100644 --- a/gstreamer-sdp/src/sdp_media.rs +++ b/gstreamer-sdp/src/sdp_media.rs @@ -207,7 +207,7 @@ impl SDPMediaRef { unsafe { ffi::gst_sdp_media_formats_len(&self.0) } } - pub fn get_attribute(&self, idx: u32) -> Option<&SDPAttribute> { + pub fn attribute(&self, idx: u32) -> Option<&SDPAttribute> { if idx >= self.attributes_len() { return None; } @@ -222,7 +222,7 @@ impl SDPMediaRef { } } - pub fn get_attribute_val(&self, key: &str) -> Option<&str> { + pub fn attribute_val(&self, key: &str) -> Option<&str> { unsafe { let ptr = ffi::gst_sdp_media_get_attribute_val(&self.0, key.to_glib_none().0); if ptr.is_null() { @@ -233,7 +233,7 @@ impl SDPMediaRef { } } - pub fn get_attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> { + pub fn attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> { unsafe { let ptr = ffi::gst_sdp_media_get_attribute_val_n(&self.0, key.to_glib_none().0, nth); if ptr.is_null() { @@ -244,7 +244,7 @@ impl SDPMediaRef { } } - pub fn get_bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> { + pub fn bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> { if idx >= self.bandwidths_len() { return None; } @@ -259,11 +259,11 @@ impl SDPMediaRef { } } - pub fn get_caps_from_media(&self, pt: i32) -> Option { + pub fn caps_from_media(&self, pt: i32) -> Option { unsafe { from_glib_full(ffi::gst_sdp_media_get_caps_from_media(&self.0, pt)) } } - pub fn get_connection(&self, idx: u32) -> Option<&SDPConnection> { + pub fn connection(&self, idx: u32) -> Option<&SDPConnection> { if idx >= self.connections_len() { return None; } @@ -278,7 +278,7 @@ impl SDPMediaRef { } } - pub fn get_format(&self, idx: u32) -> Option<&str> { + pub fn format(&self, idx: u32) -> Option<&str> { if idx >= self.formats_len() { return None; } diff --git a/gstreamer-sdp/src/sdp_message.rs b/gstreamer-sdp/src/sdp_message.rs index 21d08153e..3afc0892b 100644 --- a/gstreamer-sdp/src/sdp_message.rs +++ b/gstreamer-sdp/src/sdp_message.rs @@ -245,7 +245,7 @@ impl SDPMessageRef { unsafe { ffi::gst_sdp_message_emails_len(&self.0) } } - pub fn get_attribute(&self, idx: u32) -> Option<&SDPAttribute> { + pub fn attribute(&self, idx: u32) -> Option<&SDPAttribute> { if idx >= self.attributes_len() { return None; } @@ -260,7 +260,7 @@ impl SDPMessageRef { } } - pub fn get_attribute_val(&self, key: &str) -> Option<&str> { + pub fn attribute_val(&self, key: &str) -> Option<&str> { unsafe { let ptr = ffi::gst_sdp_message_get_attribute_val(&self.0, key.to_glib_none().0); if ptr.is_null() { @@ -271,7 +271,7 @@ impl SDPMessageRef { } } - pub fn get_attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> { + pub fn attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> { unsafe { let ptr = ffi::gst_sdp_message_get_attribute_val_n(&self.0, key.to_glib_none().0, nth); if ptr.is_null() { @@ -282,7 +282,7 @@ impl SDPMessageRef { } } - pub fn get_bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> { + pub fn bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> { if idx >= self.bandwidths_len() { return None; } @@ -308,7 +308,7 @@ impl SDPMessageRef { } } - pub fn get_email(&self, idx: u32) -> Option<&str> { + pub fn email(&self, idx: u32) -> Option<&str> { if idx >= self.emails_len() { return None; } @@ -345,7 +345,7 @@ impl SDPMessageRef { } } - pub fn get_media(&self, idx: u32) -> Option<&SDPMediaRef> { + pub fn media(&self, idx: u32) -> Option<&SDPMediaRef> { if idx >= self.medias_len() { return None; } @@ -360,7 +360,7 @@ impl SDPMessageRef { } } - pub fn get_media_mut(&mut self, idx: u32) -> Option<&mut SDPMediaRef> { + pub fn media_mut(&mut self, idx: u32) -> Option<&mut SDPMediaRef> { if idx >= self.medias_len() { return None; } @@ -386,7 +386,7 @@ impl SDPMessageRef { } } - pub fn get_phone(&self, idx: u32) -> Option<&str> { + pub fn phone(&self, idx: u32) -> Option<&str> { if idx >= self.phones_len() { return None; } @@ -412,7 +412,7 @@ impl SDPMessageRef { } } - pub fn get_time(&self, idx: u32) -> Option<&SDPTime> { + pub fn time(&self, idx: u32) -> Option<&SDPTime> { if idx >= self.times_len() { return None; } @@ -449,7 +449,7 @@ impl SDPMessageRef { } } - pub fn get_zone(&self, idx: u32) -> Option<&SDPZone> { + pub fn zone(&self, idx: u32) -> Option<&SDPZone> { if idx >= self.zones_len() { return None; } diff --git a/gstreamer-video/src/video_decoder.rs b/gstreamer-video/src/video_decoder.rs index ce7fd2e5c..cc831b280 100644 --- a/gstreamer-video/src/video_decoder.rs +++ b/gstreamer-video/src/video_decoder.rs @@ -36,7 +36,7 @@ pub trait VideoDecoderExtManual: 'static { params: Option<&gst::BufferPoolAcquireParams>, ) -> Result; - fn get_frame(&self, frame_number: i32) -> Option; + fn frame(&self, frame_number: i32) -> Option; fn frames(&self) -> Vec; fn oldest_frame(&self) -> Option; @@ -179,7 +179,7 @@ impl> VideoDecoderExtManual for O { } } - fn get_frame(&self, frame_number: i32) -> Option { + fn frame(&self, frame_number: i32) -> Option { let frame = unsafe { ffi::gst_video_decoder_get_frame(self.as_ref().to_glib_none().0, frame_number) }; diff --git a/gstreamer-video/src/video_encoder.rs b/gstreamer-video/src/video_encoder.rs index 37ab89a34..070f5b42b 100644 --- a/gstreamer-video/src/video_encoder.rs +++ b/gstreamer-video/src/video_encoder.rs @@ -18,7 +18,7 @@ pub trait VideoEncoderExtManual: 'static { size: usize, ) -> Result; - fn get_frame(&self, frame_number: i32) -> Option; + fn frame(&self, frame_number: i32) -> Option; fn frames(&self) -> Vec; fn oldest_frame(&self) -> Option; @@ -130,7 +130,7 @@ impl> VideoEncoderExtManual for O { } } - fn get_frame(&self, frame_number: i32) -> Option { + fn frame(&self, frame_number: i32) -> Option { let frame = unsafe { ffi::gst_video_encoder_get_frame(self.as_ref().to_glib_none().0, frame_number) }; diff --git a/gstreamer-video/src/video_meta.rs b/gstreamer-video/src/video_meta.rs index b01b2adf7..fddd82044 100644 --- a/gstreamer-video/src/video_meta.rs +++ b/gstreamer-video/src/video_meta.rs @@ -208,7 +208,7 @@ impl VideoMeta { unsafe impl MetaAPI for VideoMeta { type GstType = ffi::GstVideoMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_video_meta_api_get_type()) } } } @@ -274,7 +274,7 @@ impl VideoCropMeta { unsafe impl MetaAPI for VideoCropMeta { type GstType = ffi::GstVideoCropMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_video_crop_meta_api_get_type()) } } } @@ -339,7 +339,7 @@ impl VideoRegionOfInterestMeta { } #[cfg(feature = "v1_14")] - pub fn get_param<'b>(&self, name: &'b str) -> Option<&gst::StructureRef> { + pub fn param<'b>(&self, name: &'b str) -> Option<&gst::StructureRef> { self.params().find(|s| s.name() == name) } @@ -396,7 +396,7 @@ impl<'a> Iterator for ParamsIter<'a> { unsafe impl MetaAPI for VideoRegionOfInterestMeta { type GstType = ffi::GstVideoRegionOfInterestMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_video_region_of_interest_meta_api_get_type()) } } } @@ -465,7 +465,7 @@ impl VideoAffineTransformationMeta { unsafe impl MetaAPI for VideoAffineTransformationMeta { type GstType = ffi::GstVideoAffineTransformationMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_video_affine_transformation_meta_api_get_type()) } } } @@ -521,7 +521,7 @@ impl VideoOverlayCompositionMeta { unsafe impl MetaAPI for VideoOverlayCompositionMeta { type GstType = ffi::GstVideoOverlayCompositionMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_video_overlay_composition_meta_api_get_type()) } } } @@ -586,7 +586,7 @@ impl VideoCaptionMeta { unsafe impl MetaAPI for VideoCaptionMeta { type GstType = ffi::GstVideoCaptionMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_video_caption_meta_api_get_type()) } } } @@ -655,7 +655,7 @@ impl VideoAFDMeta { unsafe impl MetaAPI for VideoAFDMeta { type GstType = ffi::GstVideoAFDMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_video_afd_meta_api_get_type()) } } } @@ -731,7 +731,7 @@ impl VideoBarMeta { unsafe impl MetaAPI for VideoBarMeta { type GstType = ffi::GstVideoBarMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_video_bar_meta_api_get_type()) } } } diff --git a/gstreamer-video/src/video_overlay_composition.rs b/gstreamer-video/src/video_overlay_composition.rs index 6aed1006f..25649c27f 100644 --- a/gstreamer-video/src/video_overlay_composition.rs +++ b/gstreamer-video/src/video_overlay_composition.rs @@ -115,7 +115,7 @@ impl VideoOverlayRectangleRef { } } - pub fn get_pixels_unscaled_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { + pub fn pixels_unscaled_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { unsafe { from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_raw( self.as_mut_ptr(), @@ -124,7 +124,7 @@ impl VideoOverlayRectangleRef { } } - pub fn get_pixels_unscaled_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { + pub fn pixels_unscaled_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { unsafe { from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_ayuv( self.as_mut_ptr(), @@ -133,7 +133,7 @@ impl VideoOverlayRectangleRef { } } - pub fn get_pixels_unscaled_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { + pub fn pixels_unscaled_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { unsafe { from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_argb( self.as_mut_ptr(), @@ -142,7 +142,7 @@ impl VideoOverlayRectangleRef { } } - pub fn get_pixels_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { + pub fn pixels_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { unsafe { from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_raw( self.as_mut_ptr(), @@ -151,7 +151,7 @@ impl VideoOverlayRectangleRef { } } - pub fn get_pixels_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { + pub fn pixels_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { unsafe { from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_ayuv( self.as_mut_ptr(), @@ -160,7 +160,7 @@ impl VideoOverlayRectangleRef { } } - pub fn get_pixels_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { + pub fn pixels_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer { unsafe { from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_argb( self.as_mut_ptr(), @@ -226,7 +226,7 @@ impl VideoOverlayCompositionRef { unsafe { ffi::gst_video_overlay_composition_n_rectangles(self.as_mut_ptr()) } } - pub fn get_rectangle(&self, idx: u32) -> Result { + pub fn rectangle(&self, idx: u32) -> Result { if idx >= self.n_rectangles() { return Err(glib::bool_error!("Invalid index")); } diff --git a/gstreamer-video/src/video_time_code.rs b/gstreamer-video/src/video_time_code.rs index 1eab27e93..bcc1bd3e6 100644 --- a/gstreamer-video/src/video_time_code.rs +++ b/gstreamer-video/src/video_time_code.rs @@ -557,7 +557,7 @@ impl VideoTimeCodeMeta { unsafe impl MetaAPI for VideoTimeCodeMeta { type GstType = ffi::GstVideoTimeCodeMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_video_time_code_meta_api_get_type()) } } } diff --git a/gstreamer/src/buffer.rs b/gstreamer/src/buffer.rs index 31220b3b1..dddc0430e 100644 --- a/gstreamer/src/buffer.rs +++ b/gstreamer/src/buffer.rs @@ -384,7 +384,7 @@ impl BufferRef { self.0.mini_object.flags &= !flags.bits(); } - pub fn get_meta(&self) -> Option> { + pub fn meta(&self) -> Option> { unsafe { let meta = ffi::gst_buffer_get_meta(self.as_mut_ptr(), T::get_meta_api().to_glib()); if meta.is_null() { @@ -395,7 +395,7 @@ impl BufferRef { } } - pub fn get_meta_mut(&mut self) -> Option> { + pub fn meta_mut(&mut self) -> Option> { unsafe { let meta = ffi::gst_buffer_get_meta(self.as_mut_ptr(), T::get_meta_api().to_glib()); if meta.is_null() { @@ -511,11 +511,11 @@ impl BufferRef { } } - pub fn get_max_memory() -> u32 { + pub fn max_memory() -> u32 { unsafe { ffi::gst_buffer_get_max_memory() } } - pub fn get_memory(&self, idx: u32) -> Option { + pub fn memory(&self, idx: u32) -> Option { if idx >= self.n_memory() { None } else { @@ -530,7 +530,7 @@ impl BufferRef { } } - pub fn get_memory_range(&self, idx: u32, length: Option) -> Option { + pub fn memory_range(&self, idx: u32, length: Option) -> Option { assert!(idx + length.unwrap_or(0) < self.n_memory()); unsafe { let res = ffi::gst_buffer_get_memory_range( diff --git a/gstreamer/src/bufferlist.rs b/gstreamer/src/bufferlist.rs index 2ccf27128..e663b92a1 100644 --- a/gstreamer/src/bufferlist.rs +++ b/gstreamer/src/bufferlist.rs @@ -62,7 +62,7 @@ impl BufferListRef { #[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] - pub fn get_writable(&mut self, idx: u32) -> Option<&mut BufferRef> { + pub fn writable(&mut self, idx: u32) -> Option<&mut BufferRef> { unsafe { let ptr = ffi::gst_buffer_list_get_writable(self.as_mut_ptr(), idx); if ptr.is_null() { diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index 47f6fd6f3..91749d47f 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -179,7 +179,7 @@ impl CapsRef { } } - pub fn get_structure(&self, idx: u32) -> Option<&StructureRef> { + pub fn structure(&self, idx: u32) -> Option<&StructureRef> { if idx >= self.size() { return None; } @@ -194,7 +194,7 @@ impl CapsRef { } } - pub fn get_mut_structure(&mut self, idx: u32) -> Option<&mut StructureRef> { + pub fn structure_mut(&mut self, idx: u32) -> Option<&mut StructureRef> { if idx >= self.size() { return None; } @@ -209,7 +209,7 @@ impl CapsRef { } } - pub fn get_features(&self, idx: u32) -> Option<&CapsFeaturesRef> { + pub fn features(&self, idx: u32) -> Option<&CapsFeaturesRef> { if idx >= self.size() { return None; } @@ -220,7 +220,7 @@ impl CapsRef { } } - pub fn get_mut_features(&mut self, idx: u32) -> Option<&mut CapsFeaturesRef> { + pub fn features_mut(&mut self, idx: u32) -> Option<&mut CapsFeaturesRef> { if idx >= self.size() { return None; } diff --git a/gstreamer/src/caps_features.rs b/gstreamer/src/caps_features.rs index ac058c39e..74af9265a 100644 --- a/gstreamer/src/caps_features.rs +++ b/gstreamer/src/caps_features.rs @@ -290,7 +290,7 @@ impl CapsFeaturesRef { unsafe { ffi::gst_caps_features_get_size(self.as_ptr()) } } - pub fn get_nth(&self, idx: u32) -> Option<&str> { + pub fn nth(&self, idx: u32) -> Option<&str> { if idx >= self.size() { return None; } diff --git a/gstreamer/src/child_proxy.rs b/gstreamer/src/child_proxy.rs index 92c770352..eba1dd58c 100644 --- a/gstreamer/src/child_proxy.rs +++ b/gstreamer/src/child_proxy.rs @@ -6,7 +6,7 @@ use glib::translate::*; use std::ptr; pub trait ChildProxyExtManual: 'static { - fn get_child_property(&self, name: &str) -> Option; + fn child_property(&self, name: &str) -> Option; fn set_child_property( &self, name: &str, @@ -15,7 +15,7 @@ pub trait ChildProxyExtManual: 'static { } impl> ChildProxyExtManual for O { - fn get_child_property(&self, name: &str) -> Option { + fn child_property(&self, name: &str) -> Option { unsafe { let found: bool = from_glib(ffi::gst_child_proxy_lookup( self.as_ref().to_glib_none().0, diff --git a/gstreamer/src/control_binding.rs b/gstreamer/src/control_binding.rs index 4fc69421b..66b690689 100644 --- a/gstreamer/src/control_binding.rs +++ b/gstreamer/src/control_binding.rs @@ -6,7 +6,7 @@ use glib::object::IsA; use glib::translate::*; pub trait ControlBindingExtManual: 'static { - fn get_g_value_array( + fn g_value_array( &self, timestamp: ClockTime, interval: ClockTime, @@ -15,7 +15,7 @@ pub trait ControlBindingExtManual: 'static { } impl> ControlBindingExtManual for O { - fn get_g_value_array( + fn g_value_array( &self, timestamp: ClockTime, interval: ClockTime, diff --git a/gstreamer/src/control_source.rs b/gstreamer/src/control_source.rs index d5cc35925..2466f1ad4 100644 --- a/gstreamer/src/control_source.rs +++ b/gstreamer/src/control_source.rs @@ -6,7 +6,7 @@ use glib::object::IsA; use glib::translate::*; pub trait ControlSourceExtManual: 'static { - fn get_value_array( + fn value_array( &self, timestamp: ClockTime, interval: ClockTime, @@ -15,7 +15,7 @@ pub trait ControlSourceExtManual: 'static { } impl> ControlSourceExtManual for O { - fn get_value_array( + fn value_array( &self, timestamp: ClockTime, interval: ClockTime, diff --git a/gstreamer/src/date_time.rs b/gstreamer/src/date_time.rs index e5768a801..80b8bf636 100644 --- a/gstreamer/src/date_time.rs +++ b/gstreamer/src/date_time.rs @@ -352,7 +352,7 @@ impl cmp::PartialOrd for DateTime { fn partial_cmp(&self, other: &Self) -> Option { #[inline] #[allow(clippy::unnecessary_wraps)] - fn get_cmp(delta: i32) -> Option { + fn cmp(delta: i32) -> Option { skip_assert_initialized!(); Some(delta.cmp(&0)) } diff --git a/gstreamer/src/device_provider.rs b/gstreamer/src/device_provider.rs index d4113bf7f..850359530 100644 --- a/gstreamer/src/device_provider.rs +++ b/gstreamer/src/device_provider.rs @@ -33,11 +33,11 @@ impl DeviceProvider { } pub trait DeviceProviderExtManual: 'static { - fn get_metadata<'a>(&self, key: &str) -> Option<&'a str>; + fn metadata<'a>(&self, key: &str) -> Option<&'a str>; } impl> DeviceProviderExtManual for O { - fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> { + fn metadata<'a>(&self, key: &str) -> Option<&'a str> { unsafe { let klass = (*(self.as_ptr() as *mut glib::gobject_ffi::GTypeInstance)).g_class as *mut ffi::GstDeviceProviderClass; diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index fa15084eb..da803eb48 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -129,7 +129,7 @@ pub trait ElementExtManual: 'static { ret: StateChangeReturn, ) -> Result; - fn get_state( + fn state( &self, timeout: ClockTime, ) -> (Result, State, State); @@ -147,9 +147,9 @@ pub trait ElementExtManual: 'static { fn send_event(&self, event: Event) -> bool; - fn get_metadata<'a>(&self, key: &str) -> Option<&'a str>; + fn metadata<'a>(&self, key: &str) -> Option<&'a str>; - fn get_pad_template(&self, name: &str) -> Option; + fn pad_template(&self, name: &str) -> Option; fn pad_template_list(&self) -> Vec; #[allow(clippy::too_many_arguments)] @@ -303,7 +303,7 @@ impl> ElementExtManual for O { ret.into_result() } - fn get_state( + fn state( &self, timeout: ClockTime, ) -> (Result, State, State) { @@ -352,11 +352,11 @@ impl> ElementExtManual for O { } } - fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> { + fn metadata<'a>(&self, key: &str) -> Option<&'a str> { self.element_class().get_metadata(key) } - fn get_pad_template(&self, name: &str) -> Option { + fn pad_template(&self, name: &str) -> Option { self.element_class().get_pad_template(name) } @@ -842,7 +842,7 @@ impl> ElementExtManual for O { } pub unsafe trait ElementClassExt { - fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> { + fn metadata<'a>(&self, key: &str) -> Option<&'a str> { unsafe { let klass = self as *const _ as *const ffi::GstElementClass; @@ -856,7 +856,7 @@ pub unsafe trait ElementClassExt { } } - fn get_pad_template(&self, name: &str) -> Option { + fn pad_template(&self, name: &str) -> Option { unsafe { let klass = self as *const _ as *const ffi::GstElementClass; diff --git a/gstreamer/src/format.rs b/gstreamer/src/format.rs index 9d9a5765b..e0a84a805 100644 --- a/gstreamer/src/format.rs +++ b/gstreamer/src/format.rs @@ -47,7 +47,7 @@ impl_common_ops_for_opt_int!(Percent); pub struct TryFromGenericFormattedValueError(()); pub trait FormattedValue: Copy + Clone + Sized + Into + 'static { - fn get_default_format() -> Format; + fn default_format() -> Format; fn format(&self) -> Format; unsafe fn from_raw(format: Format, value: i64) -> Self; @@ -57,7 +57,7 @@ pub trait FormattedValue: Copy + Clone + Sized + Into + ' pub trait SpecificFormattedValue: FormattedValue + TryFrom {} impl FormattedValue for GenericFormattedValue { - fn get_default_format() -> Format { + fn default_format() -> Format { Format::Undefined } @@ -274,7 +274,7 @@ macro_rules! impl_op_u64( macro_rules! impl_format_value_traits( ($name:ident, $format:ident, $format_value:ident) => { impl FormattedValue for $name { - fn get_default_format() -> Format { + fn default_format() -> Format { Format::$format } @@ -520,7 +520,7 @@ impl_format_value_traits!(ClockTime, Time, Time); impl_format_value_traits!(Buffers, Buffers, Buffers); impl FormattedValue for Undefined { - fn get_default_format() -> Format { + fn default_format() -> Format { Format::Undefined } @@ -601,7 +601,7 @@ impl AsMut for Undefined { } impl FormattedValue for Percent { - fn get_default_format() -> Format { + fn default_format() -> Format { Format::Percent } diff --git a/gstreamer/src/log.rs b/gstreamer/src/log.rs index 07980994c..ae350a1e6 100644 --- a/gstreamer/src/log.rs +++ b/gstreamer/src/log.rs @@ -493,7 +493,7 @@ mod tests { use std::sync::{Arc, Mutex}; #[test] - fn get_existing() { + fn existing() { crate::init().unwrap(); let perf_cat = DebugCategory::get("GST_PERFORMANCE") diff --git a/gstreamer/src/meta.rs b/gstreamer/src/meta.rs index a84663ba5..3106903be 100644 --- a/gstreamer/src/meta.rs +++ b/gstreamer/src/meta.rs @@ -24,7 +24,7 @@ use glib::translate::{from_glib, from_glib_none, FromGlib, ToGlibPtr}; pub unsafe trait MetaAPI: Sync + Send + Sized { type GstType; - fn get_meta_api() -> glib::Type; + fn meta_api() -> glib::Type; unsafe fn from_ptr(buffer: &BufferRef, ptr: *const Self::GstType) -> MetaRef { assert!(!ptr.is_null()); @@ -240,7 +240,7 @@ impl Meta { unsafe impl MetaAPI for Meta { type GstType = ffi::GstMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { glib::Type::INVALID } } @@ -282,7 +282,7 @@ impl ParentBufferMeta { unsafe impl MetaAPI for ParentBufferMeta { type GstType = ffi::GstParentBufferMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_parent_buffer_meta_api_get_type()) } } } @@ -323,7 +323,7 @@ impl ProtectionMeta { unsafe impl MetaAPI for ProtectionMeta { type GstType = ffi::GstProtectionMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_protection_meta_api_get_type()) } } } @@ -392,7 +392,7 @@ impl ReferenceTimestampMeta { unsafe impl MetaAPI for ReferenceTimestampMeta { type GstType = ffi::GstReferenceTimestampMeta; - fn get_meta_api() -> glib::Type { + fn meta_api() -> glib::Type { unsafe { from_glib(ffi::gst_reference_timestamp_meta_api_get_type()) } } } diff --git a/gstreamer/src/object.rs b/gstreamer/src/object.rs index 828e4897a..f11e0e7cf 100644 --- a/gstreamer/src/object.rs +++ b/gstreamer/src/object.rs @@ -21,7 +21,7 @@ pub trait GstObjectExtManual: 'static { fn object_flags(&self) -> ObjectFlags; - fn get_g_value_array( + fn g_value_array( &self, property_name: &str, timestamp: ClockTime, @@ -101,7 +101,7 @@ impl> GstObjectExtManual for O { } } - fn get_g_value_array( + fn g_value_array( &self, property_name: &str, timestamp: ClockTime, diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index a64b9a587..ef1866c1a 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -114,8 +114,8 @@ pub trait PadExtManual: 'static { buffer: &mut crate::BufferRef, size: u32, ) -> Result<(), FlowError>; - fn get_range(&self, offset: u64, size: u32) -> Result; - fn get_range_fill( + fn range(&self, offset: u64, size: u32) -> Result; + fn range_fill( &self, offset: u64, buffer: &mut crate::BufferRef, @@ -344,7 +344,7 @@ impl> PadExtManual for O { } } - fn get_range(&self, offset: u64, size: u32) -> Result { + fn range(&self, offset: u64, size: u32) -> Result { unsafe { let mut buffer = ptr::null_mut(); let ret: FlowReturn = from_glib(ffi::gst_pad_get_range( @@ -357,7 +357,7 @@ impl> PadExtManual for O { } } - fn get_range_fill( + fn range_fill( &self, offset: u64, buffer: &mut crate::BufferRef, diff --git a/gstreamer/src/promise.rs b/gstreamer/src/promise.rs index b0c880ad7..045fbe789 100644 --- a/gstreamer/src/promise.rs +++ b/gstreamer/src/promise.rs @@ -103,7 +103,7 @@ impl Promise { } } - pub fn get_reply(&self) -> Option<&StructureRef> { + pub fn reply(&self) -> Option<&StructureRef> { unsafe { let s = ffi::gst_promise_get_reply(self.to_glib_none().0); if s.is_null() { diff --git a/gstreamer/src/structure.rs b/gstreamer/src/structure.rs index 052230062..c6cfba7b8 100644 --- a/gstreamer/src/structure.rs +++ b/gstreamer/src/structure.rs @@ -368,7 +368,7 @@ impl StructureRef { .map_err(|err| GetError::from_value_get_error(name, err)) } - pub fn get_value<'structure, 'name>( + pub fn value<'structure, 'name>( &'structure self, name: &'name str, ) -> Result<&SendValue, GetError<'name>> { @@ -452,7 +452,7 @@ impl StructureRef { Iter::new(self) } - pub fn get_nth_field_name<'a>(&self, idx: u32) -> Option<&'a str> { + pub fn nth_field_name<'a>(&self, idx: u32) -> Option<&'a str> { unsafe { let field_name = ffi::gst_structure_nth_field_name(&self.0, idx); if field_name.is_null() { diff --git a/gstreamer/src/tags.rs b/gstreamer/src/tags.rs index 0df77be9b..a59172206 100644 --- a/gstreamer/src/tags.rs +++ b/gstreamer/src/tags.rs @@ -444,7 +444,7 @@ impl TagListRef { }) } - pub fn get_generic(&self, tag_name: &str) -> Option { + pub fn generic(&self, tag_name: &str) -> Option { unsafe { let mut value: mem::MaybeUninit = mem::MaybeUninit::zeroed(); @@ -474,7 +474,7 @@ impl TagListRef { } } - pub fn get_index<'a, T: Tag<'a>>(&self, idx: u32) -> Option<&'a TagValue> { + pub fn index<'a, T: Tag<'a>>(&self, idx: u32) -> Option<&'a TagValue> { self.get_index_generic(T::tag_name(), idx).map(|value| { if !value.is::() { panic!( @@ -487,7 +487,7 @@ impl TagListRef { }) } - pub fn get_index_generic<'a>(&'a self, tag_name: &str, idx: u32) -> Option<&'a SendValue> { + pub fn index_generic<'a>(&'a self, tag_name: &str, idx: u32) -> Option<&'a SendValue> { unsafe { let value = ffi::gst_tag_list_get_value_index(self.as_ptr(), tag_name.to_glib_none().0, idx); @@ -500,11 +500,11 @@ impl TagListRef { } } - pub fn get_size<'a, T: Tag<'a>>(&self) -> u32 { + pub fn size<'a, T: Tag<'a>>(&self) -> u32 { self.get_size_by_name(T::tag_name()) } - pub fn get_size_by_name(&self, tag_name: &str) -> u32 { + pub fn size_by_name(&self, tag_name: &str) -> u32 { unsafe { ffi::gst_tag_list_get_tag_size(self.as_ptr(), tag_name.to_glib_none().0) } } diff --git a/tutorials/src/tutorials-common.rs b/tutorials/src/tutorials-common.rs index 353adb4c9..fec002d9b 100644 --- a/tutorials/src/tutorials-common.rs +++ b/tutorials/src/tutorials-common.rs @@ -20,7 +20,7 @@ mod runloop { } } - pub fn get_main() -> CFRunLoop { + pub fn main() -> CFRunLoop { unsafe { let r = CFRunLoopGetMain(); assert!(!r.is_null());