From 67c5871957a583c5817156891cb6586a54e6d5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= Date: Tue, 20 Apr 2021 14:58:11 +0200 Subject: [PATCH] fix-getters-calls 0.3.0 pass --- audio/audiofx/build.rs | 2 +- audio/audiofx/src/audioloudnorm/imp.rs | 4 +-- audio/audiofx/src/audiornnoise/imp.rs | 4 +-- audio/audiofx/tests/audioloudnorm.rs | 2 +- audio/claxon/build.rs | 2 +- audio/claxon/src/claxondec/imp.rs | 10 +++--- audio/csound/build.rs | 2 +- audio/csound/src/filter/imp.rs | 18 +++++----- audio/lewton/build.rs | 2 +- audio/lewton/src/lewtondec/imp.rs | 4 +-- generic/file/build.rs | 2 +- generic/sodium/build.rs | 2 +- generic/sodium/examples/decrypt_example.rs | 2 +- generic/sodium/examples/encrypt_example.rs | 2 +- generic/sodium/examples/generate_keys.rs | 2 +- generic/sodium/src/decrypter/imp.rs | 8 ++--- generic/sodium/src/encrypter/imp.rs | 4 +-- generic/sodium/tests/decrypter.rs | 22 ++++++------ generic/sodium/tests/encrypter.rs | 4 +-- generic/threadshare/build.rs | 2 +- generic/threadshare/examples/benchmark.rs | 2 +- generic/threadshare/src/appsrc/imp.rs | 2 +- generic/threadshare/src/inputselector/imp.rs | 2 +- generic/threadshare/src/jitterbuffer/imp.rs | 22 +++++------- generic/threadshare/src/proxy/imp.rs | 4 +-- generic/threadshare/src/queue/imp.rs | 4 +-- generic/threadshare/src/tcpclientsrc/imp.rs | 2 +- generic/threadshare/src/udpsink/imp.rs | 2 +- generic/threadshare/src/udpsrc/imp.rs | 2 +- generic/threadshare/tests/inputselector.rs | 4 +-- generic/threadshare/tests/pad.rs | 6 ++-- generic/threadshare/tests/proxy.rs | 4 +-- generic/threadshare/tests/udpsink.rs | 16 ++++----- generic/threadshare/tests/udpsrc.rs | 2 +- net/reqwest/build.rs | 2 +- net/reqwest/src/reqwesthttpsrc/imp.rs | 10 +++--- net/reqwest/tests/reqwesthttpsrc.rs | 14 ++++---- net/rusoto/build.rs | 2 +- net/rusoto/src/aws_transcriber/imp.rs | 6 ++-- net/rusoto/src/s3src/imp.rs | 2 +- text/json/build.rs | 2 +- text/json/src/jsongstenc/imp.rs | 6 ++-- text/json/src/jsongstparse/imp.rs | 10 +++--- text/regex/build.rs | 2 +- text/regex/src/gstregex/imp.rs | 4 +-- text/wrap/build.rs | 2 +- text/wrap/src/gsttextwrap/imp.rs | 4 +-- tutorial/build.rs | 2 +- tutorial/src/identity/imp.rs | 4 +-- tutorial/src/progressbin/imp.rs | 8 ++--- tutorial/src/sinesrc/imp.rs | 2 +- utils/fallbackswitch/build.rs | 2 +- .../examples/gtk_fallbackswitch.rs | 8 ++--- .../src/base/subclass/aggregator.rs | 2 +- .../src/fallbacksrc/custom_source/imp.rs | 8 ++--- utils/fallbackswitch/src/fallbacksrc/imp.rs | 20 +++++------ .../src/fallbacksrc/video_fallback/imp.rs | 14 ++++---- .../fallbackswitch/src/fallbackswitch/imp.rs | 19 +++++------ utils/fallbackswitch/tests/fallbackswitch.rs | 14 ++++---- utils/togglerecord/build.rs | 2 +- utils/togglerecord/examples/gtk_recording.rs | 12 +++---- utils/togglerecord/src/togglerecord/imp.rs | 16 ++++----- utils/togglerecord/tests/tests.rs | 34 +++++++++---------- video/cdg/build.rs | 2 +- video/cdg/src/cdgdec/imp.rs | 2 +- video/closedcaption/build.rs | 2 +- video/closedcaption/src/ccdetect/imp.rs | 2 +- video/closedcaption/src/cea608overlay/imp.rs | 8 ++--- video/closedcaption/src/cea608tojson/imp.rs | 4 +-- video/closedcaption/src/cea608tott/imp.rs | 6 ++-- video/closedcaption/src/line_reader.rs | 4 +-- video/closedcaption/src/mcc_enc/imp.rs | 10 +++--- video/closedcaption/src/mcc_parse/imp.rs | 10 +++--- video/closedcaption/src/scc_enc/imp.rs | 10 +++--- video/closedcaption/src/scc_parse/imp.rs | 10 +++--- video/closedcaption/src/tttocea608/imp.rs | 8 ++--- video/closedcaption/src/tttojson/imp.rs | 4 +-- video/closedcaption/tests/ccdetect.rs | 4 +-- video/closedcaption/tests/mcc_enc.rs | 2 +- video/closedcaption/tests/mcc_parse.rs | 4 +-- video/closedcaption/tests/scc_enc.rs | 8 ++--- video/closedcaption/tests/scc_parse.rs | 2 +- video/dav1d/build.rs | 2 +- video/dav1d/src/dav1ddec/imp.rs | 6 ++-- video/flavors/build.rs | 2 +- video/flavors/src/flvdemux/imp.rs | 4 +-- video/gif/build.rs | 2 +- video/gif/src/gifenc/imp.rs | 4 +-- video/hsv/build.rs | 2 +- video/rav1e/build.rs | 2 +- video/rav1e/src/rav1enc/imp.rs | 4 +-- video/rspng/build.rs | 2 +- video/webp/build.rs | 2 +- video/webp/src/dec/imp.rs | 4 +-- 94 files changed, 269 insertions(+), 276 deletions(-) diff --git a/audio/audiofx/build.rs b/audio/audiofx/build.rs index 17be1215..cda12e57 100644 --- a/audio/audiofx/build.rs +++ b/audio/audiofx/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/audio/audiofx/src/audioloudnorm/imp.rs b/audio/audiofx/src/audioloudnorm/imp.rs index bb0dcb18..b79af3e6 100644 --- a/audio/audiofx/src/audioloudnorm/imp.rs +++ b/audio/audiofx/src/audioloudnorm/imp.rs @@ -1710,7 +1710,7 @@ impl ObjectSubclass for AudioLoudNorm { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { Self::catch_panic_pad_function( @@ -1729,7 +1729,7 @@ impl ObjectSubclass for AudioLoudNorm { .flags(gst::PadFlags::PROXY_CAPS) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .query_function(|pad, parent, query| { Self::catch_panic_pad_function( diff --git a/audio/audiofx/src/audiornnoise/imp.rs b/audio/audiofx/src/audiornnoise/imp.rs index 1bdaa58a..6af68e10 100644 --- a/audio/audiofx/src/audiornnoise/imp.rs +++ b/audio/audiofx/src/audiornnoise/imp.rs @@ -154,7 +154,7 @@ impl AudioRNNoise { state.process(in_data, &mut out_data); } - let srcpad = element.get_static_pad("src").unwrap(); + let srcpad = element.static_pad("src").unwrap(); srcpad.push(buffer) } @@ -349,7 +349,7 @@ impl BaseTransformImpl for AudioRNNoise { ) -> bool { if direction == gst::PadDirection::Src { if let gst::QueryView::Latency(ref mut q) = query.view_mut() { - let sink_pad = element.get_static_pad("sink").expect("Sink pad not found"); + let sink_pad = element.static_pad("sink").expect("Sink pad not found"); let mut upstream_query = gst::query::Latency::new(); if sink_pad.peer_query(&mut upstream_query) { let (live, mut min, mut max) = upstream_query.result(); diff --git a/audio/audiofx/tests/audioloudnorm.rs b/audio/audiofx/tests/audioloudnorm.rs index 3da526e5..00c74746 100644 --- a/audio/audiofx/tests/audioloudnorm.rs +++ b/audio/audiofx/tests/audioloudnorm.rs @@ -70,7 +70,7 @@ fn run_test( .downcast::() .unwrap(); let sink = pipeline - .get_by_name("sink") + .by_name("sink") .unwrap() .downcast::() .unwrap(); diff --git a/audio/claxon/build.rs b/audio/claxon/build.rs index 17be1215..cda12e57 100644 --- a/audio/claxon/build.rs +++ b/audio/claxon/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/audio/claxon/src/claxondec/imp.rs b/audio/claxon/src/claxondec/imp.rs index f4f01b6d..d8846419 100644 --- a/audio/claxon/src/claxondec/imp.rs +++ b/audio/claxon/src/claxondec/imp.rs @@ -126,7 +126,7 @@ impl AudioDecoderImpl for ClaxonDec { let mut streaminfo: Option = None; let mut audio_info: Option = None; - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); if let Ok(Some(streamheaders)) = s.get_optional::("streamheader") { let streamheaders = streamheaders.as_slice(); @@ -144,8 +144,8 @@ impl AudioDecoderImpl for ClaxonDec { if inmap[0..7] != [0x7f, b'F', b'L', b'A', b'C', 0x01, 0x00] { gst_debug!(CAT, obj: element, "Unknown streamheader format"); - } else if let Ok(tstreaminfo) = get_claxon_streaminfo(&inmap[13..]) { - if let Ok(taudio_info) = get_gstaudioinfo(tstreaminfo) { + } else if let Ok(tstreaminfo) = claxon_streaminfo(&inmap[13..]) { + if let Ok(taudio_info) = gstaudioinfo(tstreaminfo) { // To speed up negotiation if element.set_output_format(&taudio_info).is_err() || element.negotiate().is_err() @@ -224,12 +224,12 @@ impl ClaxonDec { state: &mut State, indata: &[u8], ) -> Result { - let streaminfo = get_claxon_streaminfo(indata).map_err(|e| { + let streaminfo = claxon_streaminfo(indata).map_err(|e| { gst::element_error!(element, gst::StreamError::Decode, [e]); gst::FlowError::Error })?; - let audio_info = get_gstaudioinfo(streaminfo).map_err(|e| { + let audio_info = gstaudioinfo(streaminfo).map_err(|e| { gst::element_error!(element, gst::StreamError::Decode, [&e]); gst::FlowError::Error })?; diff --git a/audio/csound/build.rs b/audio/csound/build.rs index 17be1215..cda12e57 100644 --- a/audio/csound/build.rs +++ b/audio/csound/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/audio/csound/src/filter/imp.rs b/audio/csound/src/filter/imp.rs index 9795e3b8..23269dad 100644 --- a/audio/csound/src/filter/imp.rs +++ b/audio/csound/src/filter/imp.rs @@ -128,8 +128,8 @@ impl State { impl CsoundFilter { fn process(&self, csound: &mut Csound, idata: &[f64], odata: &mut [f64]) -> bool { - let spin = csound.get_spin().unwrap(); - let spout = csound.get_spout().unwrap(); + let spin = csound.spin().unwrap(); + let spout = csound.spout().unwrap(); let in_chunks = idata.chunks_exact(spin.len()); let out_chuncks = odata.chunks_exact_mut(spout.len()); @@ -190,8 +190,8 @@ impl CsoundFilter { return Ok(gst::FlowSuccess::Ok); } - let mut spin = csound.get_spin().unwrap(); - let spout = csound.get_spout().unwrap(); + let mut spin = csound.spin().unwrap(); + let spout = csound.spout().unwrap(); let out_bytes = (avail / state.in_info.channels() as usize) * state.out_info.channels() as usize; @@ -214,7 +214,7 @@ impl CsoundFilter { buffer_mut.set_pts(pts); buffer_mut.set_duration(duration); - let srcpad = element.get_static_pad("src").unwrap(); + let srcpad = element.static_pad("src").unwrap(); let adapter_map = state.adapter.map(avail).unwrap(); let data = adapter_map @@ -271,7 +271,7 @@ impl CsoundFilter { // Get the required amount of bytes to be read from // the adapter to fill an ouput buffer of size output_size - let bytes_to_read = state.get_bytes_to_read(output_size); + let bytes_to_read = state.bytes_to_read(output_size); let indata = state .adapter @@ -547,7 +547,7 @@ impl BaseTransformImpl for CsoundFilter { if compiled { let csound = self.csound.lock().unwrap(); // Use the sample rate and channels configured in the csound score - let sr = csound.get_sample_rate() as i32; + let sr = csound.sample_rate() as i32; let ichannels = csound.input_channels() as i32; let ochannels = csound.output_channels() as i32; for s in new_caps.make_mut().iter_mut() { @@ -608,7 +608,7 @@ impl BaseTransformImpl for CsoundFilter { let rate = in_info.rate(); // Check if the negotiated caps are the right ones - if rate != out_info.rate() || rate != csound.get_sample_rate() as u32 { + if rate != out_info.rate() || rate != csound.sample_rate() as u32 { return Err(loggable_error!( CAT, "Failed to negotiate caps: invalid sample rate {}", @@ -628,7 +628,7 @@ impl BaseTransformImpl for CsoundFilter { )); } - let ksmps = csound.get_ksmps(); + let ksmps = csound.ksmps(); let adapter = gst_base::UniqueAdapter::new(); diff --git a/audio/lewton/build.rs b/audio/lewton/build.rs index 17be1215..cda12e57 100644 --- a/audio/lewton/build.rs +++ b/audio/lewton/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/audio/lewton/src/lewtondec/imp.rs b/audio/lewton/src/lewtondec/imp.rs index fa1d0235..2a0a9d57 100644 --- a/audio/lewton/src/lewtondec/imp.rs +++ b/audio/lewton/src/lewtondec/imp.rs @@ -136,7 +136,7 @@ impl AudioDecoderImpl for LewtonDec { let mut state = state_guard.as_mut().unwrap(); - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); if let Ok(Some(streamheaders)) = s.get_optional::("streamheader") { let streamheaders = streamheaders.as_slice(); if streamheaders.len() < 3 { @@ -336,7 +336,7 @@ impl LewtonDec { audio_info = audio_info.positions(to); let mut map = [0; 8]; - if gst_audio::get_channel_reorder_map(from, to, &mut map[..channels]).is_err() { + if gst_audio::channel_reorder_map(from, to, &mut map[..channels]).is_err() { gst_error!( CAT, obj: element, diff --git a/generic/file/build.rs b/generic/file/build.rs index 17be1215..cda12e57 100644 --- a/generic/file/build.rs +++ b/generic/file/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/generic/sodium/build.rs b/generic/sodium/build.rs index 17be1215..cda12e57 100644 --- a/generic/sodium/build.rs +++ b/generic/sodium/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/generic/sodium/examples/decrypt_example.rs b/generic/sodium/examples/decrypt_example.rs index 78817e44..e8a1566d 100644 --- a/generic/sodium/examples/decrypt_example.rs +++ b/generic/sodium/examples/decrypt_example.rs @@ -68,7 +68,7 @@ fn main() -> Result<(), Box> { .required(true) .takes_value(true), ) - .get_matches(); + .matches(); gst::init()?; gstsodium::plugin_register_static().expect("Failed to register sodium plugin"); diff --git a/generic/sodium/examples/encrypt_example.rs b/generic/sodium/examples/encrypt_example.rs index c4e6f66b..ec57ecc3 100644 --- a/generic/sodium/examples/encrypt_example.rs +++ b/generic/sodium/examples/encrypt_example.rs @@ -68,7 +68,7 @@ fn main() -> Result<(), Box> { .required(true) .takes_value(true), ) - .get_matches(); + .matches(); gst::init()?; gstsodium::plugin_register_static().expect("Failed to register sodium plugin"); diff --git a/generic/sodium/examples/generate_keys.rs b/generic/sodium/examples/generate_keys.rs index fa5e137b..cf184e93 100644 --- a/generic/sodium/examples/generate_keys.rs +++ b/generic/sodium/examples/generate_keys.rs @@ -92,7 +92,7 @@ fn main() { .short("j") .help("Write a JSON file instead of a key.prv/key.pub pair"), ) - .get_matches(); + .matches(); let keys = Keys::new(); diff --git a/generic/sodium/src/decrypter/imp.rs b/generic/sodium/src/decrypter/imp.rs index c78e64f7..296e9655 100644 --- a/generic/sodium/src/decrypter/imp.rs +++ b/generic/sodium/src/decrypter/imp.rs @@ -540,7 +540,7 @@ impl Decrypter { state.decrypt_into_adapter(element, &self.srcpad, &pulled_buffer, chunk_index)?; let adapter_offset = pull_offset as usize; - state.get_requested_buffer(&self.srcpad, buffer, requested_size, adapter_offset) + state.requested_buffer(&self.srcpad, buffer, requested_size, adapter_offset) } } @@ -551,16 +551,16 @@ impl ObjectSubclass for Decrypter { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::from_template(&templ, Some("sink")); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .getrange_function(|pad, parent, offset, buffer, size| { Decrypter::catch_panic_pad_function( parent, || Err(gst::FlowError::Error), - |decrypter, element| decrypter.get_range(pad, element, offset, buffer, size), + |decrypter, element| decrypter.range(pad, element, offset, buffer, size), ) }) .activatemode_function(|pad, parent, mode, active| { diff --git a/generic/sodium/src/encrypter/imp.rs b/generic/sodium/src/encrypter/imp.rs index b8d3ff37..4cc7e432 100644 --- a/generic/sodium/src/encrypter/imp.rs +++ b/generic/sodium/src/encrypter/imp.rs @@ -341,7 +341,7 @@ impl ObjectSubclass for Encrypter { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { Encrypter::catch_panic_pad_function( @@ -359,7 +359,7 @@ impl ObjectSubclass for Encrypter { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .query_function(|pad, parent, query| { Encrypter::catch_panic_pad_function( diff --git a/generic/sodium/tests/decrypter.rs b/generic/sodium/tests/decrypter.rs index 164de480..864cc04c 100644 --- a/generic/sodium/tests/decrypter.rs +++ b/generic/sodium/tests/decrypter.rs @@ -184,7 +184,7 @@ fn test_pull_range() { pipeline .set_state(gst::State::Ready) .expect("Unable to set the pipeline to the `Playing` state"); - let srcpad = dec.get_static_pad("src").unwrap(); + let srcpad = dec.static_pad("src").unwrap(); srcpad.activate_mode(gst::PadMode::Pull, true).unwrap(); pipeline @@ -213,7 +213,7 @@ fn test_pull_range() { 53, 37, 220, 28, 225, 35, 16, 243, 140, 220, 4, 192, 2, 64, 14, 3, 144, 203, 67, 208, 244, 61, 70, 175, 103, 127, 28, 0, ]; - let buf1 = srcpad.get_range(0, 50).unwrap(); + let buf1 = srcpad.range(0, 50).unwrap(); assert_eq!(buf1.size(), 50); let map1 = buf1.map_readable().unwrap(); assert_eq!(&map1[..], &expected_array_1[..]); @@ -225,7 +225,7 @@ fn test_pull_range() { 207, 192, 0, 0, 3, 113, 195, 199, 255, 255, 254, 97, 225, 225, 231, 160, 0, 0, 49, 24, 120, 120, 121, 232, 0, 0, 12, 252, 195, 195, 199, 128, 0, 0, 0, ]; - let buf2 = srcpad.get_range(0, 100).unwrap(); + let buf2 = srcpad.range(0, 100).unwrap(); assert_eq!(buf2.size(), 100); let map2 = buf2.map_readable().unwrap(); assert_eq!(&map2[..], &expected_array_2[..]); @@ -235,37 +235,37 @@ fn test_pull_range() { assert_eq!(&map1[..], &map2[..map1.len()]); // request in the middle of a block - let buf = srcpad.get_range(853, 100).unwrap(); + let buf = srcpad.range(853, 100).unwrap(); // result size doesn't include the block macs, assert_eq!(buf.size(), 100); // read till eos, this also will pull multiple blocks - let buf = srcpad.get_range(853, 42000).unwrap(); + let buf = srcpad.range(853, 42000).unwrap(); // 6031 (size of file) - 883 (requersted offset) - headers size - (numbler of blcks * block mac) assert_eq!(buf.size(), 5054); // read 0 bytes from the start - let buf = srcpad.get_range(0, 0).unwrap(); + let buf = srcpad.range(0, 0).unwrap(); assert_eq!(buf.size(), 0); // read 0 bytes somewhere in the middle - let buf = srcpad.get_range(4242, 0).unwrap(); + let buf = srcpad.range(4242, 0).unwrap(); assert_eq!(buf.size(), 0); // read 0 bytes to eos - let res = srcpad.get_range(6003, 0); + let res = srcpad.range(6003, 0); assert_eq!(res, Err(gst::FlowError::Eos)); // read 100 bytes at eos - let res = srcpad.get_range(6003, 100); + let res = srcpad.range(6003, 100); assert_eq!(res, Err(gst::FlowError::Eos)); // read 100 bytes way past eos - let res = srcpad.get_range(424_242, 100); + let res = srcpad.range(424_242, 100); assert_eq!(res, Err(gst::FlowError::Eos)); // read 10 bytes at eos -1, should return a single byte - let buf = srcpad.get_range(5906, 10).unwrap(); + let buf = srcpad.range(5906, 10).unwrap(); assert_eq!(buf.size(), 1); pipeline diff --git a/generic/sodium/tests/encrypter.rs b/generic/sodium/tests/encrypter.rs index cbb65392..c945b077 100644 --- a/generic/sodium/tests/encrypter.rs +++ b/generic/sodium/tests/encrypter.rs @@ -82,8 +82,8 @@ fn encrypt_file() { .expect("failed to set property"); let mut h = gst_check::Harness::with_element(&enc, None, None); - h.add_element_src_pad(&enc.get_static_pad("src").expect("failed to get src pad")); - h.add_element_sink_pad(&enc.get_static_pad("sink").expect("failed to get src pad")); + h.add_element_src_pad(&enc.static_pad("src").expect("failed to get src pad")); + h.add_element_sink_pad(&enc.static_pad("sink").expect("failed to get src pad")); h.set_src_caps_str("application/x-sodium-encrypted"); let buf = gst::Buffer::from_mut_slice(Vec::from(&input[..])); diff --git a/generic/threadshare/build.rs b/generic/threadshare/build.rs index 27f10df9..35653591 100644 --- a/generic/threadshare/build.rs +++ b/generic/threadshare/build.rs @@ -27,5 +27,5 @@ fn main() { ); } - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/generic/threadshare/examples/benchmark.rs b/generic/threadshare/examples/benchmark.rs index 49ef3d4f..86d84d21 100644 --- a/generic/threadshare/examples/benchmark.rs +++ b/generic/threadshare/examples/benchmark.rs @@ -70,7 +70,7 @@ fn main() { sink.set_property("async", &false).unwrap(); let counter_clone = Arc::clone(&counter); - sink.get_static_pad("sink").unwrap().add_probe( + sink.static_pad("sink").unwrap().add_probe( gst::PadProbeType::BUFFER, move |_pad, _probe_info| { let _ = counter_clone.fetch_add(1, Ordering::SeqCst); diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index 28eaa0d2..56c71794 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -514,7 +514,7 @@ impl ObjectSubclass for AppSrc { Self { src_pad: PadSrc::new( - gst::Pad::from_template(&klass.get_pad_template("src").unwrap(), Some("src")), + gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")), src_pad_handler.clone(), ), src_pad_handler, diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs index 3d4fb8e3..3301e68c 100644 --- a/generic/threadshare/src/inputselector/imp.rs +++ b/generic/threadshare/src/inputselector/imp.rs @@ -399,7 +399,7 @@ impl ObjectSubclass for InputSelector { fn with_class(klass: &Self::Class) -> Self { Self { src_pad: PadSrc::new( - gst::Pad::from_template(&klass.get_pad_template("src").unwrap(), Some("src")), + gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")), InputSelectorPadSrcHandler, ), state: Mutex::new(State::default()), diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs index af234953..4a4d8e29 100644 --- a/generic/threadshare/src/jitterbuffer/imp.rs +++ b/generic/threadshare/src/jitterbuffer/imp.rs @@ -179,7 +179,7 @@ impl SinkHandler { caps: &gst::Caps, pt: u8, ) -> Result { - let s = caps.get_structure(0).ok_or(gst::FlowError::Error)?; + let s = caps.structure(0).ok_or(gst::FlowError::Error)?; gst_info!(CAT, obj: element, "Parsing {:?}", caps); @@ -389,12 +389,8 @@ impl SinkHandler { inner.packet_rate_ctx.update(seq, rtptime); - let max_dropout = inner - .packet_rate_ctx - .get_max_dropout(max_dropout_time as i32); - let max_misorder = inner - .packet_rate_ctx - .get_max_dropout(max_misorder_time as i32); + let max_dropout = inner.packet_rate_ctx.max_dropout(max_dropout_time as i32); + let max_misorder = inner.packet_rate_ctx.max_dropout(max_misorder_time as i32); pts = state.jbuf.borrow().calculate_pts( dts, @@ -532,7 +528,7 @@ impl SinkHandler { // Reschedule if needed let (_, next_wakeup) = jb.src_pad_handler - .get_next_wakeup(&element, &state, latency, context_wait); + .next_wakeup(&element, &state, latency, context_wait); if let Some((next_wakeup, _)) = next_wakeup { if let Some((previous_next_wakeup, ref abort_handle)) = state.wait_handle { if previous_next_wakeup.is_none() || previous_next_wakeup > next_wakeup { @@ -1110,7 +1106,7 @@ impl TaskImpl for JitterBufferTask { loop { let delay_fut = { let mut state = jb.state.lock().unwrap(); - let (_, next_wakeup) = self.src_pad_handler.get_next_wakeup( + let (_, next_wakeup) = self.src_pad_handler.next_wakeup( &self.element, &state, latency, @@ -1155,7 +1151,7 @@ impl TaskImpl for JitterBufferTask { let state = jb.state.lock().unwrap(); // // Check earliest PTS as we have just taken the lock - let (now, next_wakeup) = self.src_pad_handler.get_next_wakeup( + let (now, next_wakeup) = self.src_pad_handler.next_wakeup( &self.element, &state, latency, @@ -1200,7 +1196,7 @@ impl TaskImpl for JitterBufferTask { if res.is_ok() { // Return and reschedule if the next packet would be in the future // Check earliest PTS as we have just taken the lock - let (now, next_wakeup) = self.src_pad_handler.get_next_wakeup( + let (now, next_wakeup) = self.src_pad_handler.next_wakeup( &self.element, &state, latency, @@ -1342,11 +1338,11 @@ impl ObjectSubclass for JitterBuffer { Self { sink_pad: PadSink::new( - gst::Pad::from_template(&klass.get_pad_template("sink").unwrap(), Some("sink")), + gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")), sink_pad_handler.clone(), ), src_pad: PadSrc::new( - gst::Pad::from_template(&klass.get_pad_template("src").unwrap(), Some("src")), + gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")), src_pad_handler.clone(), ), sink_pad_handler, diff --git a/generic/threadshare/src/proxy/imp.rs b/generic/threadshare/src/proxy/imp.rs index 8e182303..6268a862 100644 --- a/generic/threadshare/src/proxy/imp.rs +++ b/generic/threadshare/src/proxy/imp.rs @@ -578,7 +578,7 @@ impl ObjectSubclass for ProxySink { fn with_class(klass: &Self::Class) -> Self { Self { sink_pad: PadSink::new( - gst::Pad::from_template(&klass.get_pad_template("sink").unwrap(), Some("sink")), + gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")), ProxySinkPadHandler, ), proxy_ctx: StdMutex::new(None), @@ -1115,7 +1115,7 @@ impl ObjectSubclass for ProxySrc { fn with_class(klass: &Self::Class) -> Self { Self { src_pad: PadSrc::new( - gst::Pad::from_template(&klass.get_pad_template("src").unwrap(), Some("src")), + gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")), ProxySrcPadHandler, ), task: Task::default(), diff --git a/generic/threadshare/src/queue/imp.rs b/generic/threadshare/src/queue/imp.rs index c8dd6fc0..ebf7db64 100644 --- a/generic/threadshare/src/queue/imp.rs +++ b/generic/threadshare/src/queue/imp.rs @@ -698,11 +698,11 @@ impl ObjectSubclass for Queue { fn with_class(klass: &Self::Class) -> Self { Self { sink_pad: PadSink::new( - gst::Pad::from_template(&klass.get_pad_template("sink").unwrap(), Some("sink")), + gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")), QueuePadSinkHandler, ), src_pad: PadSrc::new( - gst::Pad::from_template(&klass.get_pad_template("src").unwrap(), Some("src")), + gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")), QueuePadSrcHandler, ), task: Task::default(), diff --git a/generic/threadshare/src/tcpclientsrc/imp.rs b/generic/threadshare/src/tcpclientsrc/imp.rs index 8e3a7dba..373c0eb0 100644 --- a/generic/threadshare/src/tcpclientsrc/imp.rs +++ b/generic/threadshare/src/tcpclientsrc/imp.rs @@ -555,7 +555,7 @@ impl ObjectSubclass for TcpClientSrc { Self { src_pad: PadSrc::new( - gst::Pad::from_template(&klass.get_pad_template("src").unwrap(), Some("src")), + gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")), src_pad_handler.clone(), ), src_pad_handler, diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs index df549802..0c09e7ae 100644 --- a/generic/threadshare/src/udpsink/imp.rs +++ b/generic/threadshare/src/udpsink/imp.rs @@ -955,7 +955,7 @@ impl ObjectSubclass for UdpSink { Self { sink_pad: PadSink::new( - gst::Pad::from_template(&klass.get_pad_template("sink").unwrap(), Some("sink")), + gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")), sink_pad_handler.clone(), ), sink_pad_handler, diff --git a/generic/threadshare/src/udpsrc/imp.rs b/generic/threadshare/src/udpsrc/imp.rs index 0d2b126c..ada2c706 100644 --- a/generic/threadshare/src/udpsrc/imp.rs +++ b/generic/threadshare/src/udpsrc/imp.rs @@ -696,7 +696,7 @@ impl ObjectSubclass for UdpSrc { Self { src_pad: PadSrc::new( - gst::Pad::from_template(&klass.get_pad_template("src").unwrap(), Some("src")), + gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")), src_pad_handler.clone(), ), src_pad_handler, diff --git a/generic/threadshare/tests/inputselector.rs b/generic/threadshare/tests/inputselector.rs index 0af82fb4..6bc19601 100644 --- a/generic/threadshare/tests/inputselector.rs +++ b/generic/threadshare/tests/inputselector.rs @@ -38,7 +38,7 @@ fn test_active_pad() { let mut h2 = gst_check::Harness::with_element(&is, Some("sink_%u"), None); let active_pad = is - .get_property("active-pad") + .property("active-pad") .unwrap() .get::() .unwrap(); @@ -47,7 +47,7 @@ fn test_active_pad() { is.set_property("active-pad", &h2.srcpad().unwrap().peer()) .unwrap(); let active_pad = is - .get_property("active-pad") + .property("active-pad") .unwrap() .get::() .unwrap(); diff --git a/generic/threadshare/tests/pad.rs b/generic/threadshare/tests/pad.rs index b8f42dfe..4df220ba 100644 --- a/generic/threadshare/tests/pad.rs +++ b/generic/threadshare/tests/pad.rs @@ -310,7 +310,7 @@ mod imp_src { fn with_class(klass: &Self::Class) -> Self { ElementSrcTest { src_pad: PadSrc::new( - gst::Pad::from_template(&klass.get_pad_template("src").unwrap(), Some("src")), + gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")), PadSrcTestHandler, ), task: Task::default(), @@ -641,7 +641,7 @@ mod imp_sink { fn with_class(klass: &Self::Class) -> Self { ElementSinkTest { sink_pad: PadSink::new( - gst::Pad::from_template(&klass.get_pad_template("sink").unwrap(), Some("sink")), + gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")), PadSinkTestHandler, ), flushing: AtomicBool::new(true), @@ -657,7 +657,7 @@ mod imp_sink { "sender", "Sender", "Channel sender to forward the incoming items to", - ItemSender::get_type(), + ItemSender::type_(), glib::ParamFlags::WRITABLE | glib::ParamFlags::CONSTRUCT_ONLY, )] }); diff --git a/generic/threadshare/tests/proxy.rs b/generic/threadshare/tests/proxy.rs index a7481797..7e1b64e8 100644 --- a/generic/threadshare/tests/proxy.rs +++ b/generic/threadshare/tests/proxy.rs @@ -121,8 +121,8 @@ fn test_from_pipeline_to_pipeline() { pipe_1.set_state(gst::State::Paused).unwrap(); pipe_2.set_state(gst::State::Paused).unwrap(); - let _ = pipe_1.get_state(gst::CLOCK_TIME_NONE); - let _ = pipe_2.get_state(gst::CLOCK_TIME_NONE); + let _ = pipe_1.state(gst::CLOCK_TIME_NONE); + let _ = pipe_2.state(gst::CLOCK_TIME_NONE); pipe_1.set_state(gst::State::Null).unwrap(); diff --git a/generic/threadshare/tests/udpsink.rs b/generic/threadshare/tests/udpsink.rs index 823ede1c..7015f73d 100644 --- a/generic/threadshare/tests/udpsink.rs +++ b/generic/threadshare/tests/udpsink.rs @@ -37,7 +37,7 @@ fn test_client_management() { let udpsink = h.element().unwrap(); let clients = udpsink - .get_property("clients") + .property("clients") .unwrap() .get::() .unwrap() @@ -49,7 +49,7 @@ fn test_client_management() { .emit_by_name("add", &[&"192.168.1.1", &57i32]) .unwrap(); let clients = udpsink - .get_property("clients") + .property("clients") .unwrap() .get::() .unwrap() @@ -61,7 +61,7 @@ fn test_client_management() { .emit_by_name("add", &[&"192.168.1.1", &57i32]) .unwrap(); let clients = udpsink - .get_property("clients") + .property("clients") .unwrap() .get::() .unwrap() @@ -72,7 +72,7 @@ fn test_client_management() { .emit_by_name("remove", &[&"192.168.1.1", &57i32]) .unwrap(); let clients = udpsink - .get_property("clients") + .property("clients") .unwrap() .get::() .unwrap() @@ -84,7 +84,7 @@ fn test_client_management() { .emit_by_name("remove", &[&"192.168.1.1", &57i32]) .unwrap(); let clients = udpsink - .get_property("clients") + .property("clients") .unwrap() .get::() .unwrap() @@ -96,7 +96,7 @@ fn test_client_management() { .emit_by_name("remove", &[&"127.0.0.1", &5004i32]) .unwrap(); let clients = udpsink - .get_property("clients") + .property("clients") .unwrap() .get::() .unwrap() @@ -108,7 +108,7 @@ fn test_client_management() { .set_property("clients", &"127.0.0.1:5004,192.168.1.1:57") .unwrap(); let clients = udpsink - .get_property("clients") + .property("clients") .unwrap() .get::() .unwrap() @@ -117,7 +117,7 @@ fn test_client_management() { udpsink.emit_by_name("clear", &[]).unwrap(); let clients = udpsink - .get_property("clients") + .property("clients") .unwrap() .get::() .unwrap() diff --git a/generic/threadshare/tests/udpsrc.rs b/generic/threadshare/tests/udpsrc.rs index cb05581d..5eac5754 100644 --- a/generic/threadshare/tests/udpsrc.rs +++ b/generic/threadshare/tests/udpsrc.rs @@ -115,7 +115,7 @@ fn test_socket_reuse() { { let udpsrc = ts_src_h.element().unwrap(); let socket = udpsrc - .get_property("used-socket") + .property("used-socket") .unwrap() .get::() .unwrap(); diff --git a/net/reqwest/build.rs b/net/reqwest/build.rs index 17be1215..cda12e57 100644 --- a/net/reqwest/build.rs +++ b/net/reqwest/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/net/reqwest/src/reqwesthttpsrc/imp.rs b/net/reqwest/src/reqwesthttpsrc/imp.rs index 6bb40c8e..5b67d995 100644 --- a/net/reqwest/src/reqwesthttpsrc/imp.rs +++ b/net/reqwest/src/reqwesthttpsrc/imp.rs @@ -178,7 +178,7 @@ impl ReqwestHttpSrc { return Ok(client.clone()); } - let srcpad = src.get_static_pad("src").unwrap(); + let srcpad = src.static_pad("src").unwrap(); let mut q = gst::query::Context::new(REQWEST_CLIENT_CONTEXT); if srcpad.peer_query(&mut q) { if let Some(context) = q.context_owned() { @@ -471,15 +471,15 @@ impl ReqwestHttpSrc { gst_debug!(CAT, obj: src, "Got content type {}", content_type); if let Some(ref mut caps) = caps { let caps = caps.get_mut().unwrap(); - let s = caps.get_mut_structure(0).unwrap(); + let s = caps.structure_mut(0).unwrap(); s.set("content-type", &content_type.as_ref()); } else if content_type.type_() == "audio" && content_type.subtype() == "L16" { let channels = content_type - .get_param("channels") + .param("channels") .and_then(|s| s.as_ref().parse::().ok()) .unwrap_or(2); let rate = content_type - .get_param("rate") + .param("rate") .and_then(|s| s.as_ref().parse::().ok()) .unwrap_or(44_100); @@ -1014,7 +1014,7 @@ impl PushSrcImpl for ReqwestHttpSrc { if let Some(tags) = tags { gst_debug!(CAT, obj: src, "Sending iradio tags {:?}", tags); - let pad = src.get_static_pad("src").unwrap(); + let pad = src.static_pad("src").unwrap(); pad.push_event(gst::event::Tag::new(tags)); } diff --git a/net/reqwest/tests/reqwesthttpsrc.rs b/net/reqwest/tests/reqwesthttpsrc.rs index 4e51c184..11cb5d9a 100644 --- a/net/reqwest/tests/reqwesthttpsrc.rs +++ b/net/reqwest/tests/reqwesthttpsrc.rs @@ -81,7 +81,7 @@ impl Harness { }) .build(); - let srcpad = src.get_static_pad("src").unwrap(); + let srcpad = src.static_pad("src").unwrap(); srcpad.link(&pad).unwrap(); let bus = gst::Bus::new(); @@ -459,7 +459,7 @@ fn test_extra_headers() { assert_eq!(headers.get("baz").unwrap(), "1"); assert_eq!( headers - .get_all("list") + .all("list") .iter() .map(|v| v.to_str().unwrap()) .collect::>(), @@ -467,7 +467,7 @@ fn test_extra_headers() { ); assert_eq!( headers - .get_all("array") + .all("array") .iter() .map(|v| v.to_str().unwrap()) .collect::>(), @@ -640,7 +640,7 @@ fn test_iradio_mode() { // Check if everything was read assert_eq!(cursor.position(), 11); - let srcpad = h.src.get_static_pad("src").unwrap(); + let srcpad = h.src.static_pad("src").unwrap(); let caps = srcpad.current_caps().unwrap(); assert_eq!( caps, @@ -652,7 +652,7 @@ fn test_iradio_mode() { { use gst::EventView; - let tag_event = srcpad.get_sticky_event(gst::EventType::Tag, 0).unwrap(); + let tag_event = srcpad.sticky_event(gst::EventType::Tag, 0).unwrap(); if let EventView::Tag(tags) = tag_event.view() { let tags = tags.tag(); assert_eq!( @@ -721,7 +721,7 @@ fn test_audio_l16() { // Check if everything was read assert_eq!(cursor.position(), 11); - let srcpad = h.src.get_static_pad("src").unwrap(); + let srcpad = h.src.static_pad("src").unwrap(); let caps = srcpad.current_caps().unwrap(); assert_eq!( caps, @@ -1172,7 +1172,7 @@ fn test_cookies() { }, ); - let context = h.src.get_context("gst.reqwest.client").expect("No context"); + let context = h.src.context("gst.reqwest.client").expect("No context"); h2.src.set_context(&context); // Set the HTTP source to Playing so that everything can start diff --git a/net/rusoto/build.rs b/net/rusoto/build.rs index 17be1215..cda12e57 100644 --- a/net/rusoto/build.rs +++ b/net/rusoto/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/net/rusoto/src/aws_transcriber/imp.rs b/net/rusoto/src/aws_transcriber/imp.rs index a7d7fba8..32015e12 100644 --- a/net/rusoto/src/aws_transcriber/imp.rs +++ b/net/rusoto/src/aws_transcriber/imp.rs @@ -821,7 +821,7 @@ impl Transcriber { } let in_caps = self.sinkpad.current_caps().unwrap(); - let s = in_caps.get_structure(0).unwrap(); + let s = in_caps.structure(0).unwrap(); let sample_rate: i32 = s.get("rate").unwrap().unwrap(); let settings = self.settings.lock().unwrap(); @@ -962,7 +962,7 @@ impl ObjectSubclass for Transcriber { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { Transcriber::catch_panic_pad_function( @@ -980,7 +980,7 @@ impl ObjectSubclass for Transcriber { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .activatemode_function(|pad, parent, mode, active| { Transcriber::catch_panic_pad_function( diff --git a/net/rusoto/src/s3src/imp.rs b/net/rusoto/src/s3src/imp.rs index 07cb4ab0..72f328d3 100644 --- a/net/rusoto/src/s3src/imp.rs +++ b/net/rusoto/src/s3src/imp.rs @@ -175,7 +175,7 @@ impl S3Src { offset + length - 1 ); - let response = client.get_object(request); + let response = client.object(request); let output = s3utils::wait(&self.canceller, response).map_err(|err| match err { WaitError::FutureError(err) => Some(gst::error_msg!( diff --git a/text/json/build.rs b/text/json/build.rs index 17be1215..cda12e57 100644 --- a/text/json/build.rs +++ b/text/json/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/text/json/src/jsongstenc/imp.rs b/text/json/src/jsongstenc/imp.rs index 58c8a6c8..2b825c54 100644 --- a/text/json/src/jsongstenc/imp.rs +++ b/text/json/src/jsongstenc/imp.rs @@ -183,7 +183,7 @@ impl JsonGstEnc { { let mut state = self.state.lock().unwrap(); let caps = e.caps(); - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); state.format = match s.get::("format") { Err(_) => None, Ok(format) => format, @@ -207,7 +207,7 @@ impl ObjectSubclass for JsonGstEnc { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { JsonGstEnc::catch_panic_pad_function( @@ -225,7 +225,7 @@ impl ObjectSubclass for JsonGstEnc { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")).build(); Self { diff --git a/text/json/src/jsongstparse/imp.rs b/text/json/src/jsongstparse/imp.rs index 73784d63..02f93683 100644 --- a/text/json/src/jsongstparse/imp.rs +++ b/text/json/src/jsongstparse/imp.rs @@ -120,7 +120,7 @@ impl State { self.replay_last_line = false; &self.last_raw_line } else { - match self.reader.get_line_with_drain(drain) { + match self.reader.line_with_drain(drain) { None => { return Ok(None); } @@ -242,7 +242,7 @@ impl JsonGstParse { loop { let seeking = state.seeking; - let line = state.get_line(drain); + let line = state.line(drain); match line { Ok(Some(Line::Buffer { pts, @@ -489,7 +489,7 @@ impl JsonGstParse { reader.push(buf); } - while let Some(line) = reader.get_line_with_drain(true) { + while let Some(line) = reader.line_with_drain(true) { if let Ok(Line::Buffer { pts, duration, @@ -869,7 +869,7 @@ impl ObjectSubclass for JsonGstParse { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .activate_function(|pad, parent| { JsonGstParse::catch_panic_pad_function( @@ -906,7 +906,7 @@ impl ObjectSubclass for JsonGstParse { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .event_function(|pad, parent, event| { JsonGstParse::catch_panic_pad_function( diff --git a/text/regex/build.rs b/text/regex/build.rs index 17be1215..cda12e57 100644 --- a/text/regex/build.rs +++ b/text/regex/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/text/regex/src/gstregex/imp.rs b/text/regex/src/gstregex/imp.rs index b33ccf48..f1ca08be 100644 --- a/text/regex/src/gstregex/imp.rs +++ b/text/regex/src/gstregex/imp.rs @@ -125,7 +125,7 @@ impl ObjectSubclass for RegEx { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { RegEx::catch_panic_pad_function( @@ -137,7 +137,7 @@ impl ObjectSubclass for RegEx { .flags(gst::PadFlags::PROXY_CAPS | gst::PadFlags::FIXED_CAPS) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .flags(gst::PadFlags::PROXY_CAPS | gst::PadFlags::FIXED_CAPS) .build(); diff --git a/text/wrap/build.rs b/text/wrap/build.rs index 17be1215..cda12e57 100644 --- a/text/wrap/build.rs +++ b/text/wrap/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/text/wrap/src/gsttextwrap/imp.rs b/text/wrap/src/gsttextwrap/imp.rs index 5f9194cb..73f75e7c 100644 --- a/text/wrap/src/gsttextwrap/imp.rs +++ b/text/wrap/src/gsttextwrap/imp.rs @@ -428,7 +428,7 @@ impl ObjectSubclass for TextWrap { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { TextWrap::catch_panic_pad_function( @@ -447,7 +447,7 @@ impl ObjectSubclass for TextWrap { .flags(gst::PadFlags::PROXY_CAPS | gst::PadFlags::FIXED_CAPS) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .query_function(|pad, parent, query| { TextWrap::catch_panic_pad_function( diff --git a/tutorial/build.rs b/tutorial/build.rs index 17be1215..cda12e57 100644 --- a/tutorial/build.rs +++ b/tutorial/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/tutorial/src/identity/imp.rs b/tutorial/src/identity/imp.rs index 2d58f9a5..6b56e1b5 100644 --- a/tutorial/src/identity/imp.rs +++ b/tutorial/src/identity/imp.rs @@ -132,7 +132,7 @@ impl ObjectSubclass for Identity { // - Extract our Identity struct from the object instance and pass it to us // // Details about what each function is good for is next to each function definition - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { Identity::catch_panic_pad_function( @@ -157,7 +157,7 @@ impl ObjectSubclass for Identity { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .event_function(|pad, parent, event| { Identity::catch_panic_pad_function( diff --git a/tutorial/src/progressbin/imp.rs b/tutorial/src/progressbin/imp.rs index cd06c844..713e88ed 100644 --- a/tutorial/src/progressbin/imp.rs +++ b/tutorial/src/progressbin/imp.rs @@ -57,9 +57,9 @@ impl ObjectSubclass for ProgressBin { // do so after the progressreport element was added to the bin. // // We do that and adding the pads inside glib::Object::constructed() later. - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::GhostPad::from_template(&templ, Some("sink")); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::GhostPad::from_template(&templ, Some("src")); // Create the progressreport element. @@ -148,10 +148,10 @@ impl ObjectImpl for ProgressBin { // Then set the ghost pad targets to the corresponding pads of the progressreport element. self.sinkpad - .set_target(Some(&self.progress.get_static_pad("sink").unwrap())) + .set_target(Some(&self.progress.static_pad("sink").unwrap())) .unwrap(); self.srcpad - .set_target(Some(&self.progress.get_static_pad("src").unwrap())) + .set_target(Some(&self.progress.static_pad("src").unwrap())) .unwrap(); // And finally add the two ghostpads to the bin. diff --git a/tutorial/src/sinesrc/imp.rs b/tutorial/src/sinesrc/imp.rs index 2d201fe6..c7fc4541 100644 --- a/tutorial/src/sinesrc/imp.rs +++ b/tutorial/src/sinesrc/imp.rs @@ -522,7 +522,7 @@ impl BaseSrcImpl for SineSrc { caps.truncate(); { let caps = caps.make_mut(); - let s = caps.get_mut_structure(0).unwrap(); + let s = caps.structure_mut(0).unwrap(); s.fixate_field_nearest_int("rate", 48_000); s.fixate_field_nearest_int("channels", 1); } diff --git a/utils/fallbackswitch/build.rs b/utils/fallbackswitch/build.rs index 939ddee0..bf710735 100644 --- a/utils/fallbackswitch/build.rs +++ b/utils/fallbackswitch/build.rs @@ -1,5 +1,5 @@ fn main() { - gst_plugin_version_helper::get_info(); + gst_plugin_version_helper::info(); if cfg!(feature = "v1_18") { return; diff --git a/utils/fallbackswitch/examples/gtk_fallbackswitch.rs b/utils/fallbackswitch/examples/gtk_fallbackswitch.rs index e0d19dbd..72b996bc 100644 --- a/utils/fallbackswitch/examples/gtk_fallbackswitch.rs +++ b/utils/fallbackswitch/examples/gtk_fallbackswitch.rs @@ -50,9 +50,9 @@ fn create_pipeline() -> (gst::Pipeline, gst::Pad, gst::Element, gtk::Widget) { let videoconvert_clone = videoconvert.clone(); decodebin.connect_pad_added(move |_, pad| { let caps = pad.current_caps().unwrap(); - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); - let sinkpad = videoconvert_clone.get_static_pad("sink").unwrap(); + let sinkpad = videoconvert_clone.static_pad("sink").unwrap(); if s.name() == "video/x-raw" && !sinkpad.is_linked() { pad.link(&sinkpad).unwrap(); @@ -69,7 +69,7 @@ fn create_pipeline() -> (gst::Pipeline, gst::Pad, gst::Element, gtk::Widget) { //} else { let sink = gst::ElementFactory::make("gtksink", None).unwrap(); - let widget = sink.get_property("widget").unwrap(); + let widget = sink.property("widget").unwrap(); (sink, widget.get::().unwrap().unwrap()) }; @@ -99,7 +99,7 @@ fn create_pipeline() -> (gst::Pipeline, gst::Pad, gst::Element, gtk::Widget) { ( pipeline, - video_src.get_static_pad("src").unwrap(), + video_src.static_pad("src").unwrap(), video_sink, video_widget, ) diff --git a/utils/fallbackswitch/src/base/subclass/aggregator.rs b/utils/fallbackswitch/src/base/subclass/aggregator.rs index f34e8941..d0acb9e7 100644 --- a/utils/fallbackswitch/src/base/subclass/aggregator.rs +++ b/utils/fallbackswitch/src/base/subclass/aggregator.rs @@ -881,7 +881,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/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs b/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs index 03dda3c5..67500082 100644 --- a/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs @@ -260,7 +260,7 @@ impl CustomSource { let mut stream_type = None; // Take stream type from stream-start event if we can - if let Some(event) = pad.get_sticky_event(gst::EventType::StreamStart, 0) { + if let Some(event) = pad.sticky_event(gst::EventType::StreamStart, 0) { if let gst::EventView::StreamStart(ev) = event.view() { stream_type = ev.stream().map(|s| s.stream_type()); } @@ -279,7 +279,7 @@ impl CustomSource { } }; - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); if s.name().starts_with("audio/") { stream_type = Some(gst::StreamType::AUDIO); @@ -295,11 +295,11 @@ impl CustomSource { let (templ, name) = if stream_type.contains(gst::StreamType::AUDIO) { let name = format!("audio_{}", state.num_audio); state.num_audio += 1; - (element.get_pad_template("audio_%u").unwrap(), name) + (element.pad_template("audio_%u").unwrap(), name) } else { let name = format!("video_{}", state.num_video); state.num_video += 1; - (element.get_pad_template("video_%u").unwrap(), name) + (element.pad_template("video_%u").unwrap(), name) }; let ghost_pad = gst::GhostPad::builder_with_template(&templ, Some(&name)) diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs index 8432a210..99ce3033 100644 --- a/utils/fallbackswitch/src/fallbacksrc/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs @@ -756,7 +756,7 @@ impl FallbackSrc { audiotestsrc.set_property_from_str("wave", "silence"); audiotestsrc.set_property("is-live", &true).unwrap(); - let srcpad = audiotestsrc.get_static_pad("src").unwrap(); + let srcpad = audiotestsrc.static_pad("src").unwrap(); input .add_pad( &gst::GhostPad::builder(Some("src"), gst::PadDirection::Src) @@ -827,9 +827,9 @@ impl FallbackSrc { gst::Element::link_pads(&clocksync, Some("src"), &switch, Some("sink")).unwrap(); // clocksync_queue sink pad is not connected to anything yet at this point! - let srcpad = switch.get_static_pad("src").unwrap(); + let srcpad = switch.static_pad("src").unwrap(); let templ = element - .get_pad_template(if is_audio { "audio" } else { "video" }) + .pad_template(if is_audio { "audio" } else { "video" }) .unwrap(); let ghostpad = gst::GhostPad::builder_with_template(&templ, Some(&templ.name())) .proxy_pad_chain_function({ @@ -854,7 +854,7 @@ impl FallbackSrc { source_srcpad: None, source_srcpad_block: None, clocksync, - clocksync_queue_srcpad: clocksync_queue.get_static_pad("src").unwrap(), + clocksync_queue_srcpad: clocksync_queue.static_pad("src").unwrap(), clocksync_queue, switch, srcpad: ghostpad.upcast(), @@ -1115,7 +1115,7 @@ impl FallbackSrc { _ => return Ok(()), }; - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); if s.name().starts_with("audio/") { ("audio", &mut state.audio_stream) @@ -1143,7 +1143,7 @@ impl FallbackSrc { Some(ref mut stream) => stream, }; - let sinkpad = stream.clocksync_queue.get_static_pad("sink").unwrap(); + let sinkpad = stream.clocksync_queue.static_pad("sink").unwrap(); pad.link(&sinkpad).map_err(|err| { gst_error!( CAT, @@ -1338,7 +1338,7 @@ impl FallbackSrc { None => return Ok(()), }; - let ev = match pad.get_sticky_event(gst::EventType::Segment, 0) { + let ev = match pad.sticky_event(gst::EventType::Segment, 0) { Some(ev) => ev, None => { gst_warning!(CAT, obj: element, "Have no segment event yet"); @@ -1762,7 +1762,7 @@ impl FallbackSrc { let prev_fallback_uri = video_stream .fallback_input - .get_property("uri") + .property("uri") .unwrap() .get::() .unwrap(); @@ -2114,7 +2114,7 @@ impl FallbackSrc { .as_ref() .and_then(|s| { s.switch - .get_property("active-pad") + .property("active-pad") .unwrap() .get::() .unwrap() @@ -2128,7 +2128,7 @@ impl FallbackSrc { .as_ref() .and_then(|s| { s.switch - .get_property("active-pad") + .property("active-pad") .unwrap() .get::() .unwrap() diff --git a/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs b/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs index dfe93f5c..cf2f4f9a 100644 --- a/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs @@ -68,7 +68,7 @@ impl ObjectSubclass for VideoFallbackSource { type ParentType = gst::Bin; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::GhostPad::builder_with_template(&templ, Some(&templ.name())).build(); Self { @@ -264,7 +264,7 @@ impl VideoFallbackSource { // To invoke GstBaseSrc::start() method, activate pad manually. // filesrc will check whether given file is readable or not // via open() and fstat() in there. - let pad = filesrc.get_static_pad("src").unwrap(); + let pad = filesrc.static_pad("src").unwrap(); if pad.set_active(true).is_err() { gst_warning!(CAT, obj: element, "Couldn't active pad"); let _ = filesrc.set_state(gst::State::Null); @@ -283,7 +283,7 @@ impl VideoFallbackSource { gst_debug!(CAT, obj: element, "Creating source with uri {:?}", uri); let source = gst::Bin::new(None); - let filesrc = self.get_file_src_for_uri(element, uri); + let filesrc = self.file_src_for_uri(element, uri); let srcpad = match filesrc { Some(filesrc) => { @@ -377,7 +377,7 @@ impl VideoFallbackSource { None => return None, }; - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); let decoder; if s.name() == "image/jpeg" { decoder = gst::ElementFactory::make("jpegdec", Some("decoder")) @@ -413,7 +413,7 @@ impl VideoFallbackSource { }) .unwrap(); - queue.get_static_pad("src").unwrap() + queue.static_pad("src").unwrap() } None => { let videotestsrc = @@ -424,7 +424,7 @@ impl VideoFallbackSource { videotestsrc.set_property_from_str("pattern", "black"); videotestsrc.set_property("is-live", &true).unwrap(); - videotestsrc.get_static_pad("src").unwrap() + videotestsrc.static_pad("src").unwrap() } }; @@ -457,7 +457,7 @@ impl VideoFallbackSource { element.add(&source).unwrap(); - let srcpad = source.get_static_pad("src").unwrap(); + let srcpad = source.static_pad("src").unwrap(); let _ = self.srcpad.set_target(Some(&srcpad)); *state_guard = Some(State { source }); diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs index 2e659768..1b624b77 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -153,9 +153,9 @@ impl OutputState { preferred_is_primary: bool, cur_running_time: gst::ClockTime, ) -> (bool, bool) { - let preferred_health = self.get_health(settings, preferred_is_primary, cur_running_time); + let preferred_health = self.health(settings, preferred_is_primary, cur_running_time); let backup_health = if backup_pad.is_some() { - self.get_health(settings, !preferred_is_primary, cur_running_time) + self.health(settings, !preferred_is_primary, cur_running_time) } else { StreamHealth::Inactive }; @@ -615,7 +615,7 @@ impl FallbackSwitch { ) } else if let (true, Some(backup_pad)) = (timeout, &backup_pad) { ( - self.get_backup_buffer(&mut *state, &settings, backup_pad), + self.backup_buffer(&mut *state, &settings, backup_pad), state.check_health_changes( &settings, &Some(backup_pad), @@ -650,7 +650,7 @@ impl ObjectSubclass for FallbackSwitch { type ParentType = gst_base::Aggregator; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::PadBuilder::::from_template(&templ, Some("sink")).build(); @@ -857,7 +857,7 @@ impl ElementImpl for FallbackSwitch { name: Option, _caps: Option<&gst::Caps>, ) -> Option { - let fallback_sink_templ = element.get_pad_template("fallback_sink").unwrap(); + let fallback_sink_templ = element.pad_template("fallback_sink").unwrap(); if templ != &fallback_sink_templ || (name.is_some() && name.as_deref() != Some("fallback_sink")) { @@ -951,10 +951,10 @@ impl AggregatorImpl for FallbackSwitch { let audio_info; let video_info; - if caps.get_structure(0).unwrap().name() == "audio/x-raw" { + if caps.structure(0).unwrap().name() == "audio/x-raw" { audio_info = gst_audio::AudioInfo::from_caps(&caps).ok(); video_info = None; - } else if caps.get_structure(0).unwrap().name() == "video/x-raw" { + } else if caps.structure(0).unwrap().name() == "video/x-raw" { audio_info = None; video_info = gst_video::VideoInfo::from_caps(&caps).ok(); } else { @@ -1155,8 +1155,7 @@ impl AggregatorImpl for FallbackSwitch { ) -> Result { gst_debug!(CAT, obj: agg, "Aggregate called: timeout {}", timeout); - let (res, (primary_health_change, fallback_health_change)) = - self.get_next_buffer(agg, timeout); + let (res, (primary_health_change, fallback_health_change)) = self.next_buffer(agg, timeout); if primary_health_change { gst_debug!( @@ -1179,7 +1178,7 @@ impl AggregatorImpl for FallbackSwitch { let (mut buffer, active_caps, pad_change) = res?; - let current_src_caps = agg.get_static_pad("src").unwrap().current_caps(); + let current_src_caps = agg.static_pad("src").unwrap().current_caps(); if Some(&active_caps) != current_src_caps.as_ref() { gst_info!( CAT, diff --git a/utils/fallbackswitch/tests/fallbackswitch.rs b/utils/fallbackswitch/tests/fallbackswitch.rs index 2ec10eef..ca0092f1 100644 --- a/utils/fallbackswitch/tests/fallbackswitch.rs +++ b/utils/fallbackswitch/tests/fallbackswitch.rs @@ -453,7 +453,7 @@ fn setup_pipeline(with_live_fallback: Option) -> Pipeline { fn push_buffer(pipeline: &Pipeline, time: gst::ClockTime) { let src = pipeline - .get_by_name("src") + .by_name("src") .unwrap() .downcast::() .unwrap(); @@ -467,7 +467,7 @@ fn push_buffer(pipeline: &Pipeline, time: gst::ClockTime) { fn push_fallback_buffer(pipeline: &Pipeline, time: gst::ClockTime) { let src = pipeline - .get_by_name("fallback-src") + .by_name("fallback-src") .unwrap() .downcast::() .unwrap(); @@ -481,7 +481,7 @@ fn push_fallback_buffer(pipeline: &Pipeline, time: gst::ClockTime) { fn push_eos(pipeline: &Pipeline) { let src = pipeline - .get_by_name("src") + .by_name("src") .unwrap() .downcast::() .unwrap(); @@ -490,7 +490,7 @@ fn push_eos(pipeline: &Pipeline) { fn push_fallback_eos(pipeline: &Pipeline) { let src = pipeline - .get_by_name("fallback-src") + .by_name("fallback-src") .unwrap() .downcast::() .unwrap(); @@ -499,7 +499,7 @@ fn push_fallback_eos(pipeline: &Pipeline) { fn pull_buffer(pipeline: &Pipeline) -> gst::Buffer { let sink = pipeline - .get_by_name("sink") + .by_name("sink") .unwrap() .downcast::() .unwrap(); @@ -520,7 +520,7 @@ fn set_time(pipeline: &Pipeline, time: gst::ClockTime) { fn wait_eos(pipeline: &Pipeline) { let sink = pipeline - .get_by_name("sink") + .by_name("sink") .unwrap() .downcast::() .unwrap(); @@ -549,7 +549,7 @@ fn stop_pipeline(mut pipeline: Pipeline) { let clock_id = clock.new_single_shot_id(0.into()); let _ = clock_id.wait(); - let switch = pipeline.get_by_name("switch").unwrap(); + let switch = pipeline.by_name("switch").unwrap(); let switch_weak = switch.downgrade(); drop(switch); let pipeline_weak = pipeline.downgrade(); diff --git a/utils/togglerecord/build.rs b/utils/togglerecord/build.rs index 17be1215..cda12e57 100644 --- a/utils/togglerecord/build.rs +++ b/utils/togglerecord/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/utils/togglerecord/examples/gtk_recording.rs b/utils/togglerecord/examples/gtk_recording.rs index bd322c8a..13e1ebaa 100644 --- a/utils/togglerecord/examples/gtk_recording.rs +++ b/utils/togglerecord/examples/gtk_recording.rs @@ -52,11 +52,11 @@ fn create_pipeline() -> ( let glsinkbin = gst::ElementFactory::make("glsinkbin", None).unwrap(); glsinkbin.set_property("sink", >kglsink).unwrap(); - let widget = gtkglsink.get_property("widget").unwrap(); + let widget = gtkglsink.property("widget").unwrap(); (glsinkbin, widget.get::().unwrap().unwrap()) } else { let sink = gst::ElementFactory::make("gtksink", None).unwrap(); - let widget = sink.get_property("widget").unwrap(); + let widget = sink.property("widget").unwrap(); (sink, widget.get::().unwrap().unwrap()) }; @@ -185,8 +185,8 @@ fn create_pipeline() -> ( ( pipeline, - video_queue2.get_static_pad("sink").unwrap(), - audio_queue2.get_static_pad("sink").unwrap(), + video_queue2.static_pad("sink").unwrap(), + audio_queue2.static_pad("sink").unwrap(), togglerecord, video_sink, video_widget, @@ -240,7 +240,7 @@ fn create_ui(app: >k::Application) { position_label.set_text(&format!("Position: {:.1}", position)); let recording_duration = togglerecord - .get_static_pad("src") + .static_pad("src") .unwrap() .query_position::() .unwrap_or_else(|| 0.into()); @@ -257,7 +257,7 @@ fn create_ui(app: >k::Application) { }; let recording = !togglerecord - .get_property("record") + .property("record") .unwrap() .get_some::() .unwrap(); diff --git a/utils/togglerecord/src/togglerecord/imp.rs b/utils/togglerecord/src/togglerecord/imp.rs index 928fd3b2..a191e254 100644 --- a/utils/togglerecord/src/togglerecord/imp.rs +++ b/utils/togglerecord/src/togglerecord/imp.rs @@ -295,7 +295,7 @@ impl HandleData for gst::Buffer { } let pts = HandleData::pts(&self); - let duration = HandleData::get_duration(&self, state); + let duration = HandleData::duration(&self, state); let stop = if duration.is_some() { pts + duration } else { @@ -356,7 +356,7 @@ impl ToggleRecord { let mut state = stream.state.lock(); let mut dts_or_pts = data.dts_or_pts(); - let duration = data.get_duration(&state); + let duration = data.duration(&state); if !dts_or_pts.is_some() { gst::element_error!( @@ -610,7 +610,7 @@ impl ToggleRecord { let mut state = stream.state.lock(); let mut pts = data.pts(); - let duration = data.get_duration(&state); + let duration = data.duration(&state); if pts.is_none() { gst::element_error!(element, gst::StreamError::Format, ["Buffer without PTS"]); @@ -1245,7 +1245,7 @@ impl ToggleRecord { EventView::Caps(c) => { let mut state = stream.state.lock(); let caps = c.caps(); - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); if s.name().starts_with("audio/") { state.audio_info = gst_audio::AudioInfo::from_caps(caps).ok(); gst_log!(CAT, obj: pad, "Got audio caps {:?}", state.audio_info); @@ -1620,7 +1620,7 @@ impl ObjectSubclass for ToggleRecord { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { ToggleRecord::catch_panic_pad_function( @@ -1652,7 +1652,7 @@ impl ObjectSubclass for ToggleRecord { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .event_function(|pad, parent, event| { ToggleRecord::catch_panic_pad_function( @@ -1899,7 +1899,7 @@ impl ElementImpl for ToggleRecord { let id = *pad_count; *pad_count += 1; - let templ = element.get_pad_template("sink_%u").unwrap(); + let templ = element.pad_template("sink_%u").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some(format!("sink_{}", id).as_str())) .chain_function(|pad, parent, buffer| { @@ -1932,7 +1932,7 @@ impl ElementImpl for ToggleRecord { }) .build(); - let templ = element.get_pad_template("src_%u").unwrap(); + let templ = element.pad_template("src_%u").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some(format!("src_{}", id).as_str())) .event_function(|pad, parent, event| { ToggleRecord::catch_panic_pad_function( diff --git a/utils/togglerecord/tests/tests.rs b/utils/togglerecord/tests/tests.rs index 3f6d2fa1..dbb2ff8e 100644 --- a/utils/togglerecord/tests/tests.rs +++ b/utils/togglerecord/tests/tests.rs @@ -62,16 +62,16 @@ fn setup_sender_receiver( let (srcpad, sinkpad) = if main_stream { ( - togglerecord.get_static_pad("src").unwrap(), - togglerecord.get_static_pad("sink").unwrap(), + togglerecord.static_pad("src").unwrap(), + togglerecord.static_pad("sink").unwrap(), ) } else { - let sinkpad = togglerecord.get_request_pad("sink_%u").unwrap(); + let sinkpad = togglerecord.request_pad("sink_%u").unwrap(); let srcpad = sinkpad.iterate_internal_links().next().unwrap().unwrap(); (srcpad, sinkpad) }; - let fakesink_sinkpad = fakesink.get_static_pad("sink").unwrap(); + let fakesink_sinkpad = fakesink.static_pad("sink").unwrap(); srcpad.link(&fakesink_sinkpad).unwrap(); let (sender_output, receiver_output) = mpsc::channel::>(); @@ -263,7 +263,7 @@ fn test_create_pads() { init(); let togglerecord = gst::ElementFactory::make("togglerecord", None).unwrap(); - let sinkpad = togglerecord.get_request_pad("sink_%u").unwrap(); + let sinkpad = togglerecord.request_pad("sink_%u").unwrap(); let srcpad = sinkpad.iterate_internal_links().next().unwrap().unwrap(); assert_eq!(sinkpad.name(), "sink_0"); @@ -1201,7 +1201,7 @@ fn test_two_stream_main_eos() { receiver_input_done_1.recv().unwrap(); let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1220,7 +1220,7 @@ fn test_two_stream_main_eos() { // At this moment, all streams should be in eos state. So togglerecord // must be in stopped state let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1284,7 +1284,7 @@ fn test_two_stream_secondary_eos_first() { // Since main stream is not yet EOS state, we should be in recording state let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1295,7 +1295,7 @@ fn test_two_stream_secondary_eos_first() { receiver_input_done_1.recv().unwrap(); let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1363,7 +1363,7 @@ fn test_three_stream_main_eos() { receiver_input_done_1.recv().unwrap(); let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1382,7 +1382,7 @@ fn test_three_stream_main_eos() { // The third stream is not in EOS state yet, so still recording == true let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1397,7 +1397,7 @@ fn test_three_stream_main_eos() { // At this moment, all streams should be in eos state. So togglerecord // must be in stopped state let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1476,7 +1476,7 @@ fn test_three_stream_main_and_second_eos() { receiver_input_done_1.recv().unwrap(); let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1488,7 +1488,7 @@ fn test_three_stream_main_and_second_eos() { receiver_input_done_2.recv().unwrap(); let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1509,7 +1509,7 @@ fn test_three_stream_main_and_second_eos() { // At this moment, all streams should be in eos state. So togglerecord // must be in stopped state let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1592,7 +1592,7 @@ fn test_three_stream_secondary_eos_first() { // Since main stream is not yet EOS state, we should be in recording state let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); @@ -1604,7 +1604,7 @@ fn test_three_stream_secondary_eos_first() { receiver_input_done_1.recv().unwrap(); let recording = togglerecord - .get_property("recording") + .property("recording") .unwrap() .get_some::() .unwrap(); diff --git a/video/cdg/build.rs b/video/cdg/build.rs index 17be1215..cda12e57 100644 --- a/video/cdg/build.rs +++ b/video/cdg/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/video/cdg/src/cdgdec/imp.rs b/video/cdg/src/cdgdec/imp.rs index e4e57664..b46903df 100644 --- a/video/cdg/src/cdgdec/imp.rs +++ b/video/cdg/src/cdgdec/imp.rs @@ -181,7 +181,7 @@ impl VideoDecoderImpl for CdgDec { .take(CDG_WIDTH as usize) .enumerate() { - let p = cdg_inter.get_pixel(x as u32, y as u32); + let p = cdg_inter.pixel(x as u32, y as u32); pixel.copy_from_slice(&p.0); } } diff --git a/video/closedcaption/build.rs b/video/closedcaption/build.rs index 3654b4fa..c866594f 100644 --- a/video/closedcaption/build.rs +++ b/video/closedcaption/build.rs @@ -1,5 +1,5 @@ fn main() { - gst_plugin_version_helper::get_info(); + gst_plugin_version_helper::info(); cc::Build::new() .file("src/c/caption.c") diff --git a/video/closedcaption/src/ccdetect/imp.rs b/video/closedcaption/src/ccdetect/imp.rs index 5aa14d3b..7745326e 100644 --- a/video/closedcaption/src/ccdetect/imp.rs +++ b/video/closedcaption/src/ccdetect/imp.rs @@ -414,7 +414,7 @@ impl BaseTransformImpl for CCDetect { } let s = incaps - .get_structure(0) + .structure(0) .ok_or_else(|| gst::loggable_error!(CAT, "Failed to parse input caps"))?; let format_str = s .get::<&str>("format") diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs index c07d91fd..3221d444 100644 --- a/video/closedcaption/src/cea608overlay/imp.rs +++ b/video/closedcaption/src/cea608overlay/imp.rs @@ -286,7 +286,7 @@ impl Cea608Overlay { let mut downstream_accepts_meta = false; let upstream_has_meta = caps - .get_features(0) + .features(0) .map(|f| f.contains(&gst_video::CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION)) .unwrap_or(false); @@ -294,7 +294,7 @@ impl Cea608Overlay { let mut caps_clone = caps.clone(); let overlay_caps = caps_clone.make_mut(); - if let Some(features) = overlay_caps.get_mut_features(0) { + if let Some(features) = overlay_caps.features_mut(0) { features.add(&gst_video::CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION); let peercaps = self.srcpad.peer_query_caps(Some(&caps_clone)); downstream_accepts_meta = !peercaps.is_empty(); @@ -542,7 +542,7 @@ impl ObjectSubclass for Cea608Overlay { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { Cea608Overlay::catch_panic_pad_function( @@ -561,7 +561,7 @@ impl ObjectSubclass for Cea608Overlay { .flags(gst::PadFlags::PROXY_CAPS) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .flags(gst::PadFlags::PROXY_CAPS) .build(); diff --git a/video/closedcaption/src/cea608tojson/imp.rs b/video/closedcaption/src/cea608tojson/imp.rs index 9712d57a..c245b51a 100644 --- a/video/closedcaption/src/cea608tojson/imp.rs +++ b/video/closedcaption/src/cea608tojson/imp.rs @@ -824,7 +824,7 @@ impl ObjectSubclass for Cea608ToJson { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { Cea608ToJson::catch_panic_pad_function( @@ -843,7 +843,7 @@ impl ObjectSubclass for Cea608ToJson { .flags(gst::PadFlags::FIXED_CAPS) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .flags(gst::PadFlags::FIXED_CAPS) .build(); diff --git a/video/closedcaption/src/cea608tott/imp.rs b/video/closedcaption/src/cea608tott/imp.rs index bf073e9b..da27a013 100644 --- a/video/closedcaption/src/cea608tott/imp.rs +++ b/video/closedcaption/src/cea608tott/imp.rs @@ -303,7 +303,7 @@ impl Cea608ToTt { downstream_caps ); - let s = downstream_caps.get_structure(0).unwrap(); + let s = downstream_caps.structure(0).unwrap(); let new_caps = if s.name() == "application/x-subtitle-vtt" { state.format = Some(Format::Vtt); gst::Caps::builder("application/x-subtitle-vtt").build() @@ -377,7 +377,7 @@ impl ObjectSubclass for Cea608ToTt { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { Cea608ToTt::catch_panic_pad_function( @@ -396,7 +396,7 @@ impl ObjectSubclass for Cea608ToTt { .flags(gst::PadFlags::FIXED_CAPS) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .flags(gst::PadFlags::FIXED_CAPS) .build(); diff --git a/video/closedcaption/src/line_reader.rs b/video/closedcaption/src/line_reader.rs index 82e6d677..1d64d128 100644 --- a/video/closedcaption/src/line_reader.rs +++ b/video/closedcaption/src/line_reader.rs @@ -62,12 +62,12 @@ impl> LineReader { #[allow(unused)] pub fn line_or_drain(&mut self) -> Option<&[u8]> { - self.get_line_with_drain(true) + self.line_with_drain(true) } #[allow(unused)] pub fn line(&mut self) -> Option<&[u8]> { - self.get_line_with_drain(false) + self.line_with_drain(false) } /// Searches the first '\n' in the currently queued buffers and returns the index in buffers diff --git a/video/closedcaption/src/mcc_enc/imp.rs b/video/closedcaption/src/mcc_enc/imp.rs index 5feeec1e..7a8033dc 100644 --- a/video/closedcaption/src/mcc_enc/imp.rs +++ b/video/closedcaption/src/mcc_enc/imp.rs @@ -93,7 +93,7 @@ impl MccEnc { .current_caps() .ok_or(gst::FlowError::NotNegotiated)?; let framerate = match caps - .get_structure(0) + .structure(0) .unwrap() .get_some::("framerate") { @@ -276,7 +276,7 @@ impl MccEnc { outbuf: &mut Vec, ) -> Result<(), gst::FlowError> { let meta = buffer - .get_meta::() + .meta::() .ok_or_else(|| { gst::element_error!( element, @@ -370,7 +370,7 @@ impl MccEnc { match event.view() { EventView::Caps(ev) => { let caps = ev.caps(); - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); let framerate = match s.get_some::("framerate") { Ok(framerate) => framerate, Err(structure::GetError::FieldNotFound { .. }) => { @@ -451,7 +451,7 @@ impl ObjectSubclass for MccEnc { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { MccEnc::catch_panic_pad_function( @@ -469,7 +469,7 @@ impl ObjectSubclass for MccEnc { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .event_function(|pad, parent, event| { MccEnc::catch_panic_pad_function( diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs index 5d54ca94..861bf30a 100644 --- a/video/closedcaption/src/mcc_parse/imp.rs +++ b/video/closedcaption/src/mcc_parse/imp.rs @@ -161,7 +161,7 @@ impl State { self.replay_last_line = false; &self.last_raw_line } else { - match self.reader.get_line_with_drain(drain) { + match self.reader.line_with_drain(drain) { None => { return Ok(None); } @@ -394,7 +394,7 @@ impl MccParse { } loop { - let line = state.get_line(drain); + let line = state.line(drain); match line { Ok(Some(MccLine::Caption(tc, Some(data)))) => { assert!(!state.seeking); @@ -711,7 +711,7 @@ impl MccParse { reader.push(buf); } - while let Some(line) = reader.get_line_with_drain(true) { + while let Some(line) = reader.line_with_drain(true) { if let Ok(MccLine::Caption(tc, None)) = parser.parse_line(line, false).map_err(|err| (line, err)) { @@ -1121,7 +1121,7 @@ impl ObjectSubclass for MccParse { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .activate_function(|pad, parent| { MccParse::catch_panic_pad_function( @@ -1153,7 +1153,7 @@ impl ObjectSubclass for MccParse { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .event_function(|pad, parent, event| { MccParse::catch_panic_pad_function( diff --git a/video/closedcaption/src/scc_enc/imp.rs b/video/closedcaption/src/scc_enc/imp.rs index c5a5cc09..646a38d0 100644 --- a/video/closedcaption/src/scc_enc/imp.rs +++ b/video/closedcaption/src/scc_enc/imp.rs @@ -89,7 +89,7 @@ impl State { }; let mut timecode = buffer - .get_meta::() + .meta::() .ok_or_else(|| { gst::element_error!( element, @@ -169,7 +169,7 @@ impl State { // else, separate the packets with a space if line_start { let timecode = buffer - .get_meta::() + .meta::() // Checked already before the buffer has been pushed to the // internal_buffer .expect("Buffer without timecode") @@ -253,7 +253,7 @@ impl SccEnc { match event.view() { EventView::Caps(ev) => { let caps = ev.caps(); - let s = caps.get_structure(0).unwrap(); + let s = caps.structure(0).unwrap(); let framerate = match s.get_some::("framerate") { Ok(framerate) => Some(framerate), Err(structure::GetError::FieldNotFound { .. }) => { @@ -339,7 +339,7 @@ impl ObjectSubclass for SccEnc { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { SccEnc::catch_panic_pad_function( @@ -357,7 +357,7 @@ impl ObjectSubclass for SccEnc { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .event_function(|pad, parent, event| { SccEnc::catch_panic_pad_function( diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs index 207a43b3..dccbabba 100644 --- a/video/closedcaption/src/scc_parse/imp.rs +++ b/video/closedcaption/src/scc_parse/imp.rs @@ -140,7 +140,7 @@ fn parse_timecode( impl State { #[allow(clippy::type_complexity)] fn line(&mut self, drain: bool) -> Result, (&[u8], nom::error::Error<&[u8]>)> { - let line = match self.reader.get_line_with_drain(drain) { + let line = match self.reader.line_with_drain(drain) { None => { return Ok(None); } @@ -320,7 +320,7 @@ impl SccParse { } loop { - let line = state.get_line(drain); + let line = state.line(drain); match line { Ok(Some(SccLine::Caption(tc, data))) => { state = self.handle_line(tc, data, element, state)?; @@ -604,7 +604,7 @@ impl SccParse { reader.push(buf); } - while let Some(line) = reader.get_line_with_drain(true) { + while let Some(line) = reader.line_with_drain(true) { if let Ok(SccLine::Caption(tc, data)) = parser.parse_line(line).map_err(|err| (line, err)) { @@ -1001,7 +1001,7 @@ impl ObjectSubclass for SccParse { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .activate_function(|pad, parent| { SccParse::catch_panic_pad_function( @@ -1033,7 +1033,7 @@ impl ObjectSubclass for SccParse { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .event_function(|pad, parent, event| { SccParse::catch_panic_pad_function( diff --git a/video/closedcaption/src/tttocea608/imp.rs b/video/closedcaption/src/tttocea608/imp.rs index 94d83392..ec82991b 100644 --- a/video/closedcaption/src/tttocea608/imp.rs +++ b/video/closedcaption/src/tttocea608/imp.rs @@ -899,7 +899,7 @@ impl TtToCea608 { } let caps = downstream_caps.make_mut(); - let s = caps.get_mut_structure(0).unwrap(); + let s = caps.structure_mut(0).unwrap(); s.fixate_field_nearest_fraction( "framerate", @@ -911,7 +911,7 @@ impl TtToCea608 { state.framerate = s.get_some::("framerate").unwrap(); let upstream_caps = e.caps(); - let s = upstream_caps.get_structure(0).unwrap(); + let s = upstream_caps.structure(0).unwrap(); state.json_input = s.name() == "application/x-json"; gst_debug!(CAT, obj: pad, "Pushing caps {}", caps); @@ -987,7 +987,7 @@ impl ObjectSubclass for TtToCea608 { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { TtToCea608::catch_panic_pad_function( @@ -1006,7 +1006,7 @@ impl ObjectSubclass for TtToCea608 { .flags(gst::PadFlags::FIXED_CAPS) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .flags(gst::PadFlags::FIXED_CAPS) .build(); diff --git a/video/closedcaption/src/tttojson/imp.rs b/video/closedcaption/src/tttojson/imp.rs index 947d474b..0370c010 100644 --- a/video/closedcaption/src/tttojson/imp.rs +++ b/video/closedcaption/src/tttojson/imp.rs @@ -194,7 +194,7 @@ impl ObjectSubclass for TtToJson { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { TtToJson::catch_panic_pad_function( @@ -212,7 +212,7 @@ impl ObjectSubclass for TtToJson { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")).build(); Self { diff --git a/video/closedcaption/tests/ccdetect.rs b/video/closedcaption/tests/ccdetect.rs index 8a283472..8a310a6d 100644 --- a/video/closedcaption/tests/ccdetect.rs +++ b/video/closedcaption/tests/ccdetect.rs @@ -82,7 +82,7 @@ fn test_have_cc_data_notify() { .connect_notify(Some("cc608"), move |o, _pspec| { let mut state_guard = state_c.lock().unwrap(); state_guard.cc608_count += 1; - o.get_property("cc608").unwrap(); + o.property("cc608").unwrap(); }); let state_c = state.clone(); h.element() @@ -90,7 +90,7 @@ fn test_have_cc_data_notify() { .connect_notify(Some("cc708"), move |o, _pspec| { let mut state_guard = state_c.lock().unwrap(); state_guard.cc708_count += 1; - o.get_property("cc708").unwrap(); + o.property("cc708").unwrap(); }); /* valid cc608 data moves cc608 property to true */ diff --git a/video/closedcaption/tests/mcc_enc.rs b/video/closedcaption/tests/mcc_enc.rs index 4ce03d9c..f8fe6016 100644 --- a/video/closedcaption/tests/mcc_enc.rs +++ b/video/closedcaption/tests/mcc_enc.rs @@ -130,7 +130,7 @@ Time Code Rate=30DF\r\n\ let buf = h.pull().expect("Couldn't pull buffer"); let timecode = buf - .get_meta::() + .meta::() .expect("No timecode for buffer") .tc(); assert_eq!(timecode, tc); diff --git a/video/closedcaption/tests/mcc_parse.rs b/video/closedcaption/tests/mcc_parse.rs index 40efde05..e31c8524 100644 --- a/video/closedcaption/tests/mcc_parse.rs +++ b/video/closedcaption/tests/mcc_parse.rs @@ -76,7 +76,7 @@ fn test_parse() { ); let tc_meta = buf - .get_meta::() + .meta::() .expect("No timecode meta"); if let Some(ref timecode) = expected_timecode { assert_eq!(&tc_meta.tc(), timecode); @@ -101,7 +101,7 @@ fn test_parse() { ); let tc_meta = buf - .get_meta::() + .meta::() .expect("No timecode meta"); if let Some(ref timecode) = expected_timecode { assert_eq!(&tc_meta.tc(), timecode); diff --git a/video/closedcaption/tests/scc_enc.rs b/video/closedcaption/tests/scc_enc.rs index 17c25256..3308344c 100644 --- a/video/closedcaption/tests/scc_enc.rs +++ b/video/closedcaption/tests/scc_enc.rs @@ -64,7 +64,7 @@ fn test_encode_single_packet() { let buf = h.pull().expect("Couldn't pull buffer"); let timecode = buf - .get_meta::() + .meta::() .expect("No timecode for buffer") .tc(); assert_eq!(timecode, tc); @@ -163,7 +163,7 @@ fn test_encode_multiple_packets() { let buf = h.pull().expect("Couldn't pull buffer"); let timecode = buf - .get_meta::() + .meta::() .expect("No timecode for buffer") .tc(); assert_eq!(timecode, tc1); @@ -181,7 +181,7 @@ fn test_encode_multiple_packets() { // Pull 2 let buf = h.pull().expect("Couldn't pull buffer"); let timecode = buf - .get_meta::() + .meta::() .expect("No timecode for buffer") .tc(); assert_eq!(timecode, tc2); @@ -210,7 +210,7 @@ fn test_encode_multiple_packets() { // Pull 3 let buf = h.pull().expect("Couldn't pull buffer"); let timecode = buf - .get_meta::() + .meta::() .expect("No timecode for buffer") .tc(); assert_eq!(timecode, tc3); diff --git a/video/closedcaption/tests/scc_parse.rs b/video/closedcaption/tests/scc_parse.rs index 781a414e..b984859e 100644 --- a/video/closedcaption/tests/scc_parse.rs +++ b/video/closedcaption/tests/scc_parse.rs @@ -170,7 +170,7 @@ fn test_timecodes() { // get the timecode of the buffer let tc = buf - .get_meta::() + .meta::() .expect("No timecode meta") .tc(); diff --git a/video/dav1d/build.rs b/video/dav1d/build.rs index 17be1215..cda12e57 100644 --- a/video/dav1d/build.rs +++ b/video/dav1d/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs index cfd60939..a08721bd 100644 --- a/video/dav1d/src/dav1ddec/imp.rs +++ b/video/dav1d/src/dav1ddec/imp.rs @@ -265,7 +265,7 @@ impl Dav1dDec { .output_state() .expect("Output state not set. Shouldn't happen!"); let offset = pic.offset() as i32; - if let Some(mut frame) = element.get_frame(offset) { + if let Some(mut frame) = element.frame(offset) { let output_buffer = self.decoded_picture_as_buffer(&pic, output_state)?; frame.set_output_buffer(output_buffer); element.finish_frame(frame)?; @@ -278,7 +278,7 @@ impl Dav1dDec { fn drop_decoded_pictures(&self) { let mut decoder = self.decoder.lock().unwrap(); - while let Ok(pic) = decoder.get_picture() { + while let Ok(pic) = decoder.picture() { gst_debug!(CAT, "Dropping picture"); drop(pic); } @@ -289,7 +289,7 @@ impl Dav1dDec { ) -> Result, gst::FlowError> { let mut decoder = self.decoder.lock().unwrap(); let mut pictures = vec![]; - while let Ok(pic) = decoder.get_picture() { + while let Ok(pic) = decoder.picture() { let format = self.gst_video_format_from_dav1d_picture(&pic); if format == gst_video::VideoFormat::Unknown { return Err(gst::FlowError::NotNegotiated); diff --git a/video/flavors/build.rs b/video/flavors/build.rs index 17be1215..cda12e57 100644 --- a/video/flavors/build.rs +++ b/video/flavors/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/video/flavors/src/flvdemux/imp.rs b/video/flavors/src/flvdemux/imp.rs index 5e4c351b..89bcdbf7 100644 --- a/video/flavors/src/flvdemux/imp.rs +++ b/video/flavors/src/flvdemux/imp.rs @@ -126,7 +126,7 @@ impl ObjectSubclass for FlvDemux { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .activate_function(|pad, parent| { FlvDemux::catch_panic_pad_function( @@ -637,7 +637,7 @@ impl FlvDemux { } fn create_srcpad(&self, element: &super::FlvDemux, name: &str, caps: &gst::Caps) -> gst::Pad { - let templ = element.element_class().get_pad_template(name).unwrap(); + let templ = element.element_class().pad_template(name).unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some(name)) .event_function(|pad, parent, event| { FlvDemux::catch_panic_pad_function( diff --git a/video/gif/build.rs b/video/gif/build.rs index 17be1215..cda12e57 100644 --- a/video/gif/build.rs +++ b/video/gif/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/video/gif/src/gifenc/imp.rs b/video/gif/src/gifenc/imp.rs index 9df54983..e973a989 100644 --- a/video/gif/src/gifenc/imp.rs +++ b/video/gif/src/gifenc/imp.rs @@ -336,7 +336,7 @@ impl VideoEncoderImpl for GifEnc { return Err(gst::FlowError::Error); } - let mut raw_frame = get_tightly_packed_framebuffer(&in_frame); + let mut raw_frame = tightly_packed_framebuffer(&in_frame); let mut gif_frame = match in_frame.info().format() { gst_video::VideoFormat::Rgb => { gif::Frame::from_rgb_speed( @@ -414,7 +414,7 @@ impl GifEnc { }); if let Some(trailer_buffer) = trailer_buffer { // manually push GIF trailer to the encoder's src pad - let srcpad = element.get_static_pad("src").unwrap(); + let srcpad = element.static_pad("src").unwrap(); srcpad.push(trailer_buffer)?; } diff --git a/video/hsv/build.rs b/video/hsv/build.rs index 17be1215..cda12e57 100644 --- a/video/hsv/build.rs +++ b/video/hsv/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/video/rav1e/build.rs b/video/rav1e/build.rs index 17be1215..cda12e57 100644 --- a/video/rav1e/build.rs +++ b/video/rav1e/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/video/rav1e/src/rav1enc/imp.rs b/video/rav1e/src/rav1enc/imp.rs index 44ae80c4..2f544767 100644 --- a/video/rav1e/src/rav1enc/imp.rs +++ b/video/rav1e/src/rav1enc/imp.rs @@ -739,9 +739,7 @@ impl Rav1Enc { packet_type ); - let mut frame = element - .get_frame(frame_number as i32) - .expect("frame not found"); + let mut frame = element.frame(frame_number as i32).expect("frame not found"); if packet_type == data::FrameType::KEY { frame.set_flags(gst_video::VideoCodecFrameFlags::SYNC_POINT); diff --git a/video/rspng/build.rs b/video/rspng/build.rs index 17be1215..cda12e57 100644 --- a/video/rspng/build.rs +++ b/video/rspng/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/video/webp/build.rs b/video/webp/build.rs index 17be1215..cda12e57 100644 --- a/video/webp/build.rs +++ b/video/webp/build.rs @@ -1,3 +1,3 @@ fn main() { - gst_plugin_version_helper::get_info() + gst_plugin_version_helper::info() } diff --git a/video/webp/src/dec/imp.rs b/video/webp/src/dec/imp.rs index a81778aa..0060284a 100644 --- a/video/webp/src/dec/imp.rs +++ b/video/webp/src/dec/imp.rs @@ -291,7 +291,7 @@ impl ObjectSubclass for WebPDec { type ParentType = gst::Element; fn with_class(klass: &Self::Class) -> Self { - let templ = klass.get_pad_template("sink").unwrap(); + let templ = klass.pad_template("sink").unwrap(); let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { WebPDec::catch_panic_pad_function( @@ -309,7 +309,7 @@ impl ObjectSubclass for WebPDec { }) .build(); - let templ = klass.get_pad_template("src").unwrap(); + let templ = klass.pad_template("src").unwrap(); let srcpad = gst::Pad::builder_with_template(&templ, Some("src")) .event_function(|pad, parent, event| { WebPDec::catch_panic_pad_function(