From 27bc5c89cad7dfec9cc12c6c87beca76a4a0b139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= Date: Tue, 20 Apr 2021 14:57:40 +0200 Subject: [PATCH] fix-getters-def 0.3.0 pass --- audio/audiofx/src/audioecho/imp.rs | 2 +- audio/audiofx/src/audioloudnorm/imp.rs | 2 +- audio/audiofx/src/ebur128level/imp.rs | 2 +- audio/claxon/src/claxondec/imp.rs | 6 ++---- audio/csound/src/filter/imp.rs | 4 ++-- generic/file/src/filesink/imp.rs | 6 +++--- generic/file/src/filesrc/imp.rs | 8 ++++---- generic/sodium/src/decrypter/imp.rs | 6 +++--- generic/sodium/src/encrypter/imp.rs | 2 +- generic/threadshare/src/appsrc/imp.rs | 2 +- generic/threadshare/src/inputselector/imp.rs | 2 +- generic/threadshare/src/jitterbuffer/imp.rs | 4 ++-- generic/threadshare/src/jitterbuffer/jitterbuffer.rs | 4 ++-- generic/threadshare/src/proxy/imp.rs | 4 ++-- generic/threadshare/src/queue/imp.rs | 2 +- generic/threadshare/src/tcpclientsrc/imp.rs | 2 +- generic/threadshare/src/udpsink/imp.rs | 2 +- generic/threadshare/src/udpsrc/imp.rs | 2 +- net/reqwest/src/reqwesthttpsrc/imp.rs | 8 ++++---- net/rusoto/src/aws_transcriber/imp.rs | 2 +- net/rusoto/src/s3sink/imp.rs | 2 +- net/rusoto/src/s3src/imp.rs | 8 ++++---- text/json/src/jsongstparse/imp.rs | 2 +- text/regex/src/gstregex/imp.rs | 2 +- text/wrap/src/gsttextwrap/imp.rs | 2 +- tutorial/src/progressbin/imp.rs | 2 +- tutorial/src/rgb2gray/imp.rs | 4 ++-- tutorial/src/sinesrc/imp.rs | 2 +- utils/fallbackswitch/src/base/subclass/aggregator.rs | 2 +- utils/fallbackswitch/src/fallbacksrc/imp.rs | 2 +- .../src/fallbacksrc/video_fallback/imp.rs | 4 ++-- utils/fallbackswitch/src/fallbackswitch/imp.rs | 10 +++++----- utils/togglerecord/src/togglerecord/imp.rs | 8 ++++---- version-helper/src/lib.rs | 2 +- video/closedcaption/src/ccdetect/imp.rs | 2 +- video/closedcaption/src/cea608overlay/imp.rs | 2 +- video/closedcaption/src/line_reader.rs | 2 +- video/closedcaption/src/mcc_enc/imp.rs | 2 +- video/closedcaption/src/mcc_parse/imp.rs | 5 +---- video/closedcaption/src/scc_parse/imp.rs | 5 +---- video/closedcaption/src/tttocea608/imp.rs | 2 +- video/closedcaption/src/tttojson/imp.rs | 2 +- video/gif/src/gifenc/imp.rs | 4 ++-- video/hsv/src/hsvdetector/imp.rs | 4 ++-- video/hsv/src/hsvfilter/imp.rs | 4 ++-- video/rav1e/src/rav1enc/imp.rs | 2 +- video/rspng/src/pngenc/imp.rs | 2 +- 47 files changed, 77 insertions(+), 85 deletions(-) diff --git a/audio/audiofx/src/audioecho/imp.rs b/audio/audiofx/src/audioecho/imp.rs index 52e698f2..f5e32f8f 100644 --- a/audio/audiofx/src/audioecho/imp.rs +++ b/audio/audiofx/src/audioecho/imp.rs @@ -166,7 +166,7 @@ impl ObjectImpl for AudioEcho { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "max-delay" => { let settings = self.settings.lock().unwrap(); diff --git a/audio/audiofx/src/audioloudnorm/imp.rs b/audio/audiofx/src/audioloudnorm/imp.rs index cdd0180c..bb0dcb18 100644 --- a/audio/audiofx/src/audioloudnorm/imp.rs +++ b/audio/audiofx/src/audioloudnorm/imp.rs @@ -1831,7 +1831,7 @@ impl ObjectImpl for AudioLoudNorm { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "loudness-target" => { let settings = self.settings.lock().unwrap(); diff --git a/audio/audiofx/src/ebur128level/imp.rs b/audio/audiofx/src/ebur128level/imp.rs index cadcaf40..06b7459e 100644 --- a/audio/audiofx/src/ebur128level/imp.rs +++ b/audio/audiofx/src/ebur128level/imp.rs @@ -223,7 +223,7 @@ impl ObjectImpl for EbuR128Level { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { let settings = self.settings.lock().unwrap(); match pspec.name() { "mode" => settings.mode.to_value(), diff --git a/audio/claxon/src/claxondec/imp.rs b/audio/claxon/src/claxondec/imp.rs index 9a0da76d..f4f01b6d 100644 --- a/audio/claxon/src/claxondec/imp.rs +++ b/audio/claxon/src/claxondec/imp.rs @@ -375,7 +375,7 @@ impl AudioDepth { } } -fn get_claxon_streaminfo(indata: &[u8]) -> Result { +fn claxon_streaminfo(indata: &[u8]) -> Result { let mut cursor = Cursor::new(indata); let mut metadata_iter = claxon::metadata::MetadataBlockReader::new(&mut cursor); let streaminfo = match metadata_iter.next() { @@ -388,9 +388,7 @@ fn get_claxon_streaminfo(indata: &[u8]) -> Result Result { +fn gstaudioinfo(streaminfo: claxon::metadata::StreamInfo) -> Result { let format = match streaminfo.bits_per_sample { 8 => gst_audio::AudioFormat::S8, 16 => gst_audio::AUDIO_FORMAT_S16, diff --git a/audio/csound/src/filter/imp.rs b/audio/csound/src/filter/imp.rs index 68049c83..9795e3b8 100644 --- a/audio/csound/src/filter/imp.rs +++ b/audio/csound/src/filter/imp.rs @@ -88,7 +88,7 @@ impl State { in_process_samples * self.out_info.bpf() as usize } - fn get_bytes_to_read(&mut self, output_size: usize) -> usize { + fn bytes_to_read(&mut self, output_size: usize) -> usize { // The max amount of bytes at the input that We would need // for filling an output buffer of size *output_size* (output_size / self.out_info.bpf() as usize) * self.in_info.bpf() as usize @@ -418,7 +418,7 @@ impl ObjectImpl for CsoundFilter { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "loop" => { let settings = self.settings.lock().unwrap(); diff --git a/generic/file/src/filesink/imp.rs b/generic/file/src/filesink/imp.rs index 6627582d..e754ad0d 100644 --- a/generic/file/src/filesink/imp.rs +++ b/generic/file/src/filesink/imp.rs @@ -153,7 +153,7 @@ impl ObjectImpl for FileSink { }; } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "location" => { let settings = self.settings.lock().unwrap(); @@ -292,11 +292,11 @@ impl BaseSinkImpl for FileSink { impl URIHandlerImpl for FileSink { const URI_TYPE: gst::URIType = gst::URIType::Sink; - fn get_protocols() -> &'static [&'static str] { + fn protocols() -> &'static [&'static str] { &["file"] } - fn get_uri(&self, _element: &Self::Type) -> Option { + fn uri(&self, _element: &Self::Type) -> Option { let settings = self.settings.lock().unwrap(); // Conversion to Url already checked while building the `FileLocation` diff --git a/generic/file/src/filesrc/imp.rs b/generic/file/src/filesrc/imp.rs index 690cdf1f..26049003 100644 --- a/generic/file/src/filesrc/imp.rs +++ b/generic/file/src/filesrc/imp.rs @@ -167,7 +167,7 @@ impl ObjectImpl for FileSrc { }; } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "location" => { let settings = self.settings.lock().unwrap(); @@ -226,7 +226,7 @@ impl BaseSrcImpl for FileSrc { true } - fn get_size(&self, _src: &Self::Type) -> Option { + fn size(&self, _src: &Self::Type) -> Option { let state = self.state.lock().unwrap(); if let State::Started { ref file, .. } = *state { file.metadata().ok().map(|m| m.len()) @@ -345,11 +345,11 @@ impl BaseSrcImpl for FileSrc { impl URIHandlerImpl for FileSrc { const URI_TYPE: gst::URIType = gst::URIType::Src; - fn get_protocols() -> &'static [&'static str] { + fn protocols() -> &'static [&'static str] { &["file"] } - fn get_uri(&self, _element: &Self::Type) -> Option { + fn uri(&self, _element: &Self::Type) -> Option { let settings = self.settings.lock().unwrap(); // Conversion to Url already checked while building the `FileLocation` diff --git a/generic/sodium/src/decrypter/imp.rs b/generic/sodium/src/decrypter/imp.rs index 7ab81a38..c78e64f7 100644 --- a/generic/sodium/src/decrypter/imp.rs +++ b/generic/sodium/src/decrypter/imp.rs @@ -141,7 +141,7 @@ impl State { } // Retrieve the requested buffer out of the adapter. - fn get_requested_buffer( + fn requested_buffer( &mut self, pad: &gst::Pad, buffer: Option<&mut gst::BufferRef>, @@ -496,7 +496,7 @@ impl Decrypter { }) } - fn get_range( + fn range( &self, pad: &gst::Pad, element: &super::Decrypter, @@ -651,7 +651,7 @@ impl ObjectImpl for Decrypter { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "receiver-key" => { let props = self.props.lock().unwrap(); diff --git a/generic/sodium/src/encrypter/imp.rs b/generic/sodium/src/encrypter/imp.rs index c84f104f..b8d3ff37 100644 --- a/generic/sodium/src/encrypter/imp.rs +++ b/generic/sodium/src/encrypter/imp.rs @@ -456,7 +456,7 @@ impl ObjectImpl for Encrypter { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "receiver-key" => { let props = self.props.lock().unwrap(); diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index f3952178..28eaa0d2 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -646,7 +646,7 @@ impl ObjectImpl for AppSrc { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { let settings = self.settings.lock().unwrap(); match pspec.name() { "context" => settings.context.to_value(), diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs index 1fcbfbed..3d4fb8e3 100644 --- a/generic/threadshare/src/inputselector/imp.rs +++ b/generic/threadshare/src/inputselector/imp.rs @@ -493,7 +493,7 @@ impl ObjectImpl for InputSelector { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "context" => { let settings = self.settings.lock().unwrap(); diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs index 7550d6b7..af234953 100644 --- a/generic/threadshare/src/jitterbuffer/imp.rs +++ b/generic/threadshare/src/jitterbuffer/imp.rs @@ -847,7 +847,7 @@ impl SrcHandler { jb.src_pad.push(buffer).await } - fn get_next_wakeup( + fn next_wakeup( &self, element: &super::JitterBuffer, state: &State, @@ -1495,7 +1495,7 @@ impl ObjectImpl for JitterBuffer { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "latency" => { let settings = self.settings.lock().unwrap(); diff --git a/generic/threadshare/src/jitterbuffer/jitterbuffer.rs b/generic/threadshare/src/jitterbuffer/jitterbuffer.rs index 93c70fdd..efb2fbe4 100644 --- a/generic/threadshare/src/jitterbuffer/jitterbuffer.rs +++ b/generic/threadshare/src/jitterbuffer/jitterbuffer.rs @@ -192,12 +192,12 @@ impl RTPPacketRateCtx { unsafe { ffi::gst_rtp_packet_rate_ctx_update(&mut *self.0, seqnum, ts) } } - pub fn get_max_dropout(&mut self, time_ms: i32) -> u32 { + pub fn max_dropout(&mut self, time_ms: i32) -> u32 { unsafe { ffi::gst_rtp_packet_rate_ctx_get_max_dropout(&mut *self.0, time_ms) } } #[allow(dead_code)] - pub fn get_max_disorder(&mut self, time_ms: i32) -> u32 { + pub fn max_disorder(&mut self, time_ms: i32) -> u32 { unsafe { ffi::gst_rtp_packet_rate_ctx_get_max_disorder(&mut *self.0, time_ms) } } } diff --git a/generic/threadshare/src/proxy/imp.rs b/generic/threadshare/src/proxy/imp.rs index 32a159cb..8e182303 100644 --- a/generic/threadshare/src/proxy/imp.rs +++ b/generic/threadshare/src/proxy/imp.rs @@ -621,7 +621,7 @@ impl ObjectImpl for ProxySink { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { let settings = self.settings.lock().unwrap(); match pspec.name() { "proxy-context" => settings.proxy_context.to_value(), @@ -1223,7 +1223,7 @@ impl ObjectImpl for ProxySrc { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { let settings = self.settings.lock().unwrap(); match pspec.name() { "max-size-buffers" => settings.max_size_buffers.to_value(), diff --git a/generic/threadshare/src/queue/imp.rs b/generic/threadshare/src/queue/imp.rs index 86157d58..c8dd6fc0 100644 --- a/generic/threadshare/src/queue/imp.rs +++ b/generic/threadshare/src/queue/imp.rs @@ -798,7 +798,7 @@ impl ObjectImpl for Queue { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { let settings = self.settings.lock().unwrap(); match pspec.name() { "max-size-buffers" => settings.max_size_buffers.to_value(), diff --git a/generic/threadshare/src/tcpclientsrc/imp.rs b/generic/threadshare/src/tcpclientsrc/imp.rs index 3bff5fe5..8e3a7dba 100644 --- a/generic/threadshare/src/tcpclientsrc/imp.rs +++ b/generic/threadshare/src/tcpclientsrc/imp.rs @@ -657,7 +657,7 @@ impl ObjectImpl for TcpClientSrc { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { let settings = self.settings.lock().unwrap(); match pspec.name() { "host" => settings.host.to_value(), diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs index 43c06b11..df549802 100644 --- a/generic/threadshare/src/udpsink/imp.rs +++ b/generic/threadshare/src/udpsink/imp.rs @@ -1286,7 +1286,7 @@ impl ObjectImpl for UdpSink { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { let settings = self.settings.lock().unwrap(); match pspec.name() { "sync" => settings.sync.to_value(), diff --git a/generic/threadshare/src/udpsrc/imp.rs b/generic/threadshare/src/udpsrc/imp.rs index aa240d43..0d2b126c 100644 --- a/generic/threadshare/src/udpsrc/imp.rs +++ b/generic/threadshare/src/udpsrc/imp.rs @@ -847,7 +847,7 @@ impl ObjectImpl for UdpSrc { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { let settings = self.settings.lock().unwrap(); match pspec.name() { "address" => settings.address.to_value(), diff --git a/net/reqwest/src/reqwesthttpsrc/imp.rs b/net/reqwest/src/reqwesthttpsrc/imp.rs index bd986925..6bb40c8e 100644 --- a/net/reqwest/src/reqwesthttpsrc/imp.rs +++ b/net/reqwest/src/reqwesthttpsrc/imp.rs @@ -739,7 +739,7 @@ impl ObjectImpl for ReqwestHttpSrc { }; } - fn get_property(&self, obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "location" => { let settings = self.settings.lock().unwrap(); @@ -860,7 +860,7 @@ impl BaseSrcImpl for ReqwestHttpSrc { } } - fn get_size(&self, _src: &Self::Type) -> Option { + fn size(&self, _src: &Self::Type) -> Option { match *self.state.lock().unwrap() { State::Started { size, .. } => size, _ => None, @@ -1096,11 +1096,11 @@ impl PushSrcImpl for ReqwestHttpSrc { impl URIHandlerImpl for ReqwestHttpSrc { const URI_TYPE: gst::URIType = gst::URIType::Src; - fn get_protocols() -> &'static [&'static str] { + fn protocols() -> &'static [&'static str] { &["http", "https"] } - fn get_uri(&self, _element: &Self::Type) -> Option { + fn uri(&self, _element: &Self::Type) -> Option { let settings = self.settings.lock().unwrap(); settings.location.as_ref().map(Url::to_string) diff --git a/net/rusoto/src/aws_transcriber/imp.rs b/net/rusoto/src/aws_transcriber/imp.rs index c777d8c9..a7d7fba8 100644 --- a/net/rusoto/src/aws_transcriber/imp.rs +++ b/net/rusoto/src/aws_transcriber/imp.rs @@ -1091,7 +1091,7 @@ impl ObjectImpl for Transcriber { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "language-code" => { let settings = self.settings.lock().unwrap(); diff --git a/net/rusoto/src/s3sink/imp.rs b/net/rusoto/src/s3sink/imp.rs index 44e5d7f4..42b6f952 100644 --- a/net/rusoto/src/s3sink/imp.rs +++ b/net/rusoto/src/s3sink/imp.rs @@ -420,7 +420,7 @@ impl ObjectImpl for S3Sink { } } - fn get_property(&self, _: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { let settings = self.settings.lock().unwrap(); match pspec.name() { diff --git a/net/rusoto/src/s3src/imp.rs b/net/rusoto/src/s3src/imp.rs index e7bb2ad7..07cb4ab0 100644 --- a/net/rusoto/src/s3src/imp.rs +++ b/net/rusoto/src/s3src/imp.rs @@ -240,7 +240,7 @@ impl ObjectImpl for S3Src { } } - fn get_property(&self, _: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "uri" => { let url = match *self.url.lock().unwrap() { @@ -298,11 +298,11 @@ impl ElementImpl for S3Src { impl URIHandlerImpl for S3Src { const URI_TYPE: gst::URIType = gst::URIType::Src; - fn get_protocols() -> &'static [&'static str] { + fn protocols() -> &'static [&'static str] { &["s3"] } - fn get_uri(&self, _: &Self::Type) -> Option { + fn uri(&self, _: &Self::Type) -> Option { self.url.lock().unwrap().as_ref().map(|s| s.to_string()) } @@ -316,7 +316,7 @@ impl BaseSrcImpl for S3Src { true } - fn get_size(&self, _: &Self::Type) -> Option { + fn size(&self, _: &Self::Type) -> Option { match *self.state.lock().unwrap() { StreamingState::Stopped => None, StreamingState::Started { size, .. } => Some(size), diff --git a/text/json/src/jsongstparse/imp.rs b/text/json/src/jsongstparse/imp.rs index 30f0dabd..73784d63 100644 --- a/text/json/src/jsongstparse/imp.rs +++ b/text/json/src/jsongstparse/imp.rs @@ -115,7 +115,7 @@ enum Line<'a> { } impl State { - fn get_line(&mut self, drain: bool) -> Result, (&[u8], serde_json::Error)> { + fn line(&mut self, drain: bool) -> Result, (&[u8], serde_json::Error)> { let line = if self.replay_last_line { self.replay_last_line = false; &self.last_raw_line diff --git a/text/regex/src/gstregex/imp.rs b/text/regex/src/gstregex/imp.rs index 12f0dce1..b33ccf48 100644 --- a/text/regex/src/gstregex/imp.rs +++ b/text/regex/src/gstregex/imp.rs @@ -248,7 +248,7 @@ impl ObjectImpl for RegEx { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "commands" => { let state = self.state.lock().unwrap(); diff --git a/text/wrap/src/gsttextwrap/imp.rs b/text/wrap/src/gsttextwrap/imp.rs index 377e46ac..5f9194cb 100644 --- a/text/wrap/src/gsttextwrap/imp.rs +++ b/text/wrap/src/gsttextwrap/imp.rs @@ -569,7 +569,7 @@ impl ObjectImpl for TextWrap { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "dictionary" => { let settings = self.settings.lock().unwrap(); diff --git a/tutorial/src/progressbin/imp.rs b/tutorial/src/progressbin/imp.rs index 41f390ce..cd06c844 100644 --- a/tutorial/src/progressbin/imp.rs +++ b/tutorial/src/progressbin/imp.rs @@ -125,7 +125,7 @@ impl ObjectImpl for ProgressBin { // Called whenever a value of a property is read. It can be called // at any time from any thread. - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "output" => { let output_type = self.output_type.lock().unwrap(); diff --git a/tutorial/src/rgb2gray/imp.rs b/tutorial/src/rgb2gray/imp.rs index 5c31dac0..f12a6847 100644 --- a/tutorial/src/rgb2gray/imp.rs +++ b/tutorial/src/rgb2gray/imp.rs @@ -165,7 +165,7 @@ impl ObjectImpl for Rgb2Gray { // Called whenever a value of a property is read. It can be called // at any time from any thread. - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "invert" => { let settings = self.settings.lock().unwrap(); @@ -351,7 +351,7 @@ impl BaseTransformImpl for Rgb2Gray { // 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 { gst_video::VideoInfo::from_caps(caps) .map(|info| info.size()) .ok() diff --git a/tutorial/src/sinesrc/imp.rs b/tutorial/src/sinesrc/imp.rs index 8e3d64a5..2d201fe6 100644 --- a/tutorial/src/sinesrc/imp.rs +++ b/tutorial/src/sinesrc/imp.rs @@ -303,7 +303,7 @@ impl ObjectImpl for SineSrc { // Called whenever a value of a property is read. It can be called // at any time from any thread. - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "samples-per-buffer" => { let settings = self.settings.lock().unwrap(); diff --git a/utils/fallbackswitch/src/base/subclass/aggregator.rs b/utils/fallbackswitch/src/base/subclass/aggregator.rs index 499dc8e4..f34e8941 100644 --- a/utils/fallbackswitch/src/base/subclass/aggregator.rs +++ b/utils/fallbackswitch/src/base/subclass/aggregator.rs @@ -110,7 +110,7 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl { self.parent_stop(aggregator) } - fn get_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime { + fn next_time(&self, aggregator: &Self::Type) -> gst::ClockTime { self.parent_get_next_time(aggregator) } diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs index db85a4f8..8432a210 100644 --- a/utils/fallbackswitch/src/fallbacksrc/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs @@ -439,7 +439,7 @@ impl ObjectImpl for FallbackSrc { // Called whenever a value of a property is read. It can be called // at any time from any thread. #[allow(clippy::blocks_in_if_conditions)] - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "enable-audio" => { let settings = self.settings.lock().unwrap(); diff --git a/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs b/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs index 6f248aaf..dfe93f5c 100644 --- a/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs @@ -142,7 +142,7 @@ impl ObjectImpl for VideoFallbackSource { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "uri" => { let settings = self.settings.lock().unwrap(); @@ -235,7 +235,7 @@ impl BinImpl for VideoFallbackSource { } impl VideoFallbackSource { - fn get_file_src_for_uri( + fn file_src_for_uri( &self, element: &super::VideoFallbackSource, uri: Option<&str>, diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs index b2e107a0..2e659768 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -123,7 +123,7 @@ impl Default for Settings { } impl OutputState { - fn get_health( + fn health( &self, settings: &Settings, check_primary_pad: bool, @@ -360,7 +360,7 @@ impl FallbackSwitch { Ok(Some((buffer, active_caps, pad_change))) } - fn get_backup_buffer( + fn backup_buffer( &self, state: &mut OutputState, settings: &Settings, @@ -477,7 +477,7 @@ impl FallbackSwitch { } #[allow(clippy::type_complexity)] - fn get_next_buffer( + fn next_buffer( &self, agg: &super::FallbackSwitch, timeout: bool, @@ -769,7 +769,7 @@ impl ObjectImpl for FallbackSwitch { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "timeout" => { let settings = self.settings.lock().unwrap(); @@ -980,7 +980,7 @@ impl AggregatorImpl for FallbackSwitch { } } - fn get_next_time(&self, agg: &Self::Type) -> gst::ClockTime { + fn next_time(&self, agg: &Self::Type) -> gst::ClockTime { /* At each iteration, we have a preferred pad and a backup pad. If autoswitch is true, * the sinkpad is always preferred, otherwise it's the active sinkpad as set by the app. * The backup pad is the other one (may be None if there's no fallback pad yet). diff --git a/utils/togglerecord/src/togglerecord/imp.rs b/utils/togglerecord/src/togglerecord/imp.rs index 6069de2c..928fd3b2 100644 --- a/utils/togglerecord/src/togglerecord/imp.rs +++ b/utils/togglerecord/src/togglerecord/imp.rs @@ -168,7 +168,7 @@ trait HandleData: Sized { self.pts() } } - fn get_duration(&self, state: &StreamState) -> gst::ClockTime; + fn duration(&self, state: &StreamState) -> gst::ClockTime; fn is_keyframe(&self) -> bool; fn can_clip(&self, state: &StreamState) -> bool; fn clip( @@ -187,7 +187,7 @@ impl HandleData for (gst::ClockTime, gst::ClockTime) { self.0 } - fn get_duration(&self, _state: &StreamState) -> gst::ClockTime { + fn duration(&self, _state: &StreamState) -> gst::ClockTime { self.1 } @@ -225,7 +225,7 @@ impl HandleData for gst::Buffer { gst::BufferRef::dts(self) } - fn get_duration(&self, state: &StreamState) -> gst::ClockTime { + fn duration(&self, state: &StreamState) -> gst::ClockTime { let duration = gst::BufferRef::duration(self); if duration.is_some() { @@ -1743,7 +1743,7 @@ impl ObjectImpl for ToggleRecord { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "record" => { let settings = self.settings.lock(); diff --git a/version-helper/src/lib.rs b/version-helper/src/lib.rs index e62869dc..7841c537 100644 --- a/version-helper/src/lib.rs +++ b/version-helper/src/lib.rs @@ -53,7 +53,7 @@ use std::{env, fs, path}; /// - If neither is possible, `COMMIT_ID` is set to the string `UNKNOWN` and `BUILD_REL_DATE` to the /// current date. /// -pub fn get_info() { +pub fn info() { let crate_dir = path::PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set")); let mut repo_dir = crate_dir.clone(); diff --git a/video/closedcaption/src/ccdetect/imp.rs b/video/closedcaption/src/ccdetect/imp.rs index cc4230d3..5aa14d3b 100644 --- a/video/closedcaption/src/ccdetect/imp.rs +++ b/video/closedcaption/src/ccdetect/imp.rs @@ -270,7 +270,7 @@ impl ObjectImpl for CCDetect { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "window" => { let settings = self.settings.lock().unwrap(); diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs index a9427a47..c07d91fd 100644 --- a/video/closedcaption/src/cea608overlay/imp.rs +++ b/video/closedcaption/src/cea608overlay/imp.rs @@ -614,7 +614,7 @@ impl ObjectImpl for Cea608Overlay { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "field" => { let settings = self.settings.lock().unwrap(); diff --git a/video/closedcaption/src/line_reader.rs b/video/closedcaption/src/line_reader.rs index 3f0dd48a..82e6d677 100644 --- a/video/closedcaption/src/line_reader.rs +++ b/video/closedcaption/src/line_reader.rs @@ -152,7 +152,7 @@ impl> LineReader { assert_eq!(self.buf.len(), len); } - pub fn get_line_with_drain(&mut self, drain: bool) -> Option<&[u8]> { + pub fn line_with_drain(&mut self, drain: bool) -> Option<&[u8]> { // Drop all data from the previous line self.drop_previous_line(); diff --git a/video/closedcaption/src/mcc_enc/imp.rs b/video/closedcaption/src/mcc_enc/imp.rs index 5a610330..5feeec1e 100644 --- a/video/closedcaption/src/mcc_enc/imp.rs +++ b/video/closedcaption/src/mcc_enc/imp.rs @@ -540,7 +540,7 @@ impl ObjectImpl for MccEnc { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "uuid" => { let settings = self.settings.lock().unwrap(); diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs index a6d449e9..5d54ca94 100644 --- a/video/closedcaption/src/mcc_parse/imp.rs +++ b/video/closedcaption/src/mcc_parse/imp.rs @@ -156,10 +156,7 @@ fn parse_timecode_rate( impl State { #[allow(clippy::type_complexity)] - fn get_line( - &mut self, - drain: bool, - ) -> Result, (&[u8], nom::error::Error<&[u8]>)> { + fn line(&mut self, drain: bool) -> Result, (&[u8], nom::error::Error<&[u8]>)> { let line = if self.replay_last_line { self.replay_last_line = false; &self.last_raw_line diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs index 32c1bfb0..207a43b3 100644 --- a/video/closedcaption/src/scc_parse/imp.rs +++ b/video/closedcaption/src/scc_parse/imp.rs @@ -139,10 +139,7 @@ fn parse_timecode( impl State { #[allow(clippy::type_complexity)] - fn get_line( - &mut self, - drain: bool, - ) -> Result, (&[u8], nom::error::Error<&[u8]>)> { + fn line(&mut self, drain: bool) -> Result, (&[u8], nom::error::Error<&[u8]>)> { let line = match self.reader.get_line_with_drain(drain) { None => { return Ok(None); diff --git a/video/closedcaption/src/tttocea608/imp.rs b/video/closedcaption/src/tttocea608/imp.rs index 698fb726..94d83392 100644 --- a/video/closedcaption/src/tttocea608/imp.rs +++ b/video/closedcaption/src/tttocea608/imp.rs @@ -1094,7 +1094,7 @@ impl ObjectImpl for TtToCea608 { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "mode" => { let settings = self.settings.lock().unwrap(); diff --git a/video/closedcaption/src/tttojson/imp.rs b/video/closedcaption/src/tttojson/imp.rs index d61154ee..947d474b 100644 --- a/video/closedcaption/src/tttojson/imp.rs +++ b/video/closedcaption/src/tttojson/imp.rs @@ -264,7 +264,7 @@ impl ObjectImpl for TtToJson { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "mode" => { let settings = self.settings.lock().unwrap(); diff --git a/video/gif/src/gifenc/imp.rs b/video/gif/src/gifenc/imp.rs index 4f28d5b3..9df54983 100644 --- a/video/gif/src/gifenc/imp.rs +++ b/video/gif/src/gifenc/imp.rs @@ -170,7 +170,7 @@ impl ObjectImpl for GifEnc { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "repeat" => { let settings = self.settings.lock().unwrap(); @@ -424,7 +424,7 @@ impl GifEnc { /// Helper method that takes a gstreamer video-frame and copies it into a /// tightly packed rgb(a) buffer, ready for consumption by the gif encoder. -fn get_tightly_packed_framebuffer(frame: &gst_video::VideoFrameRef<&gst::BufferRef>) -> Vec { +fn tightly_packed_framebuffer(frame: &gst_video::VideoFrameRef<&gst::BufferRef>) -> Vec { assert_eq!(frame.n_planes(), 1); // RGB and RGBA are tightly packed let line_size = (frame.info().width() * frame.n_components()) as usize; let line_stride = frame.info().stride()[0] as usize; diff --git a/video/hsv/src/hsvdetector/imp.rs b/video/hsv/src/hsvdetector/imp.rs index 0acf28d5..468abcbb 100644 --- a/video/hsv/src/hsvdetector/imp.rs +++ b/video/hsv/src/hsvdetector/imp.rs @@ -232,7 +232,7 @@ impl ObjectImpl for HsvDetector { // Called whenever a value of a property is read. It can be called // at any time from any thread. - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "hue-ref" => { let settings = self.settings.lock().unwrap(); @@ -390,7 +390,7 @@ impl BaseTransformImpl for HsvDetector { } } - fn get_unit_size(&self, _element: &Self::Type, caps: &gst::Caps) -> Option { + fn unit_size(&self, _element: &Self::Type, caps: &gst::Caps) -> Option { gst_video::VideoInfo::from_caps(caps) .map(|info| info.size()) .ok() diff --git a/video/hsv/src/hsvfilter/imp.rs b/video/hsv/src/hsvfilter/imp.rs index e509271e..5d24235b 100644 --- a/video/hsv/src/hsvfilter/imp.rs +++ b/video/hsv/src/hsvfilter/imp.rs @@ -206,7 +206,7 @@ impl ObjectImpl for HsvFilter { // Called whenever a value of a property is read. It can be called // at any time from any thread. - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "hue-shift" => { let settings = self.settings.lock().unwrap(); @@ -298,7 +298,7 @@ impl BaseTransformImpl for HsvFilter { const PASSTHROUGH_ON_SAME_CAPS: bool = false; const TRANSFORM_IP_ON_PASSTHROUGH: bool = false; - fn get_unit_size(&self, _element: &Self::Type, caps: &gst::Caps) -> Option { + fn unit_size(&self, _element: &Self::Type, caps: &gst::Caps) -> Option { gst_video::VideoInfo::from_caps(caps) .map(|info| info.size()) .ok() diff --git a/video/rav1e/src/rav1enc/imp.rs b/video/rav1e/src/rav1enc/imp.rs index 8438802e..44ae80c4 100644 --- a/video/rav1e/src/rav1enc/imp.rs +++ b/video/rav1e/src/rav1enc/imp.rs @@ -364,7 +364,7 @@ impl ObjectImpl for Rav1Enc { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "speed-preset" => { let settings = self.settings.lock().unwrap(); diff --git a/video/rspng/src/pngenc/imp.rs b/video/rspng/src/pngenc/imp.rs index e77820be..16c54e71 100644 --- a/video/rspng/src/pngenc/imp.rs +++ b/video/rspng/src/pngenc/imp.rs @@ -222,7 +222,7 @@ impl ObjectImpl for PngEncoder { } } - fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "compression-level" => { let settings = self.settings.lock();