diff options
author | François Laignel <fengalin@free.fr> | 2021-04-12 15:49:54 +0300 |
---|---|---|
committer | François Laignel <fengalin@free.fr> | 2021-04-12 16:57:19 +0300 |
commit | 06accc8d98cc2876bcacfc6f9e097af690b4e64f (patch) | |
tree | e4f056143e5257d49b367dd28ef5fecaa1df9ebc /generic/sodium | |
parent | c3fb55f235f7feb1ab737a64f8d3d53d03a81c7a (diff) |
fix-getters-{def,calls} pass
Diffstat (limited to 'generic/sodium')
-rw-r--r-- | generic/sodium/examples/decrypt_example.rs | 10 | ||||
-rw-r--r-- | generic/sodium/examples/encrypt_example.rs | 10 | ||||
-rw-r--r-- | generic/sodium/examples/generate_keys.rs | 2 | ||||
-rw-r--r-- | generic/sodium/src/decrypter/imp.rs | 14 | ||||
-rw-r--r-- | generic/sodium/src/encrypter/imp.rs | 12 | ||||
-rw-r--r-- | generic/sodium/tests/decrypter.rs | 26 |
6 files changed, 37 insertions, 37 deletions
diff --git a/generic/sodium/examples/decrypt_example.rs b/generic/sodium/examples/decrypt_example.rs index 08cd1519f..e8a1566d1 100644 --- a/generic/sodium/examples/decrypt_example.rs +++ b/generic/sodium/examples/decrypt_example.rs @@ -68,7 +68,7 @@ fn main() -> Result<(), Box<dyn Error>> { .required(true) .takes_value(true), ) - .get_matches(); + .matches(); gst::init()?; gstsodium::plugin_register_static().expect("Failed to register sodium plugin"); @@ -123,17 +123,17 @@ fn main() -> Result<(), Box<dyn Error>> { .set_state(gst::State::Playing) .expect("Unable to set the pipeline to the `Playing` state"); - let bus = pipeline.get_bus().unwrap(); + let bus = pipeline.bus().unwrap(); for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { use gst::MessageView; match msg.view() { MessageView::Error(err) => { eprintln!( "Error received from element {:?}: {}", - err.get_src().map(|s| s.get_path_string()), - err.get_error() + err.src().map(|s| s.path_string()), + err.error() ); - eprintln!("Debugging information: {:?}", err.get_debug()); + eprintln!("Debugging information: {:?}", err.debug()); break; } MessageView::Eos(..) => break, diff --git a/generic/sodium/examples/encrypt_example.rs b/generic/sodium/examples/encrypt_example.rs index 4da6c0254..ec57ecc33 100644 --- a/generic/sodium/examples/encrypt_example.rs +++ b/generic/sodium/examples/encrypt_example.rs @@ -68,7 +68,7 @@ fn main() -> Result<(), Box<dyn Error>> { .required(true) .takes_value(true), ) - .get_matches(); + .matches(); gst::init()?; gstsodium::plugin_register_static().expect("Failed to register sodium plugin"); @@ -120,17 +120,17 @@ fn main() -> Result<(), Box<dyn Error>> { pipeline.set_state(gst::State::Playing)?; - let bus = pipeline.get_bus().unwrap(); + let bus = pipeline.bus().unwrap(); for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { use gst::MessageView; match msg.view() { MessageView::Error(err) => { eprintln!( "Error received from element {:?}: {}", - err.get_src().map(|s| s.get_path_string()), - err.get_error() + err.src().map(|s| s.path_string()), + err.error() ); - eprintln!("Debugging information: {:?}", err.get_debug()); + eprintln!("Debugging information: {:?}", err.debug()); break; } MessageView::Eos(..) => break, diff --git a/generic/sodium/examples/generate_keys.rs b/generic/sodium/examples/generate_keys.rs index fa5e137b8..cf184e93f 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 c5c5bda7b..80e1a774e 100644 --- a/generic/sodium/src/decrypter/imp.rs +++ b/generic/sodium/src/decrypter/imp.rs @@ -301,16 +301,16 @@ impl Decrypter { gst_log!(CAT, obj: pad, "Upstream returned {:?}", peer_query); - let (flags, min, max, align) = peer_query.get_result(); + let (flags, min, max, align) = peer_query.result(); q.set(flags, min, max, align); q.add_scheduling_modes(&[gst::PadMode::Pull]); - gst_log!(CAT, obj: pad, "Returning {:?}", q.get_mut_query()); + gst_log!(CAT, obj: pad, "Returning {:?}", q.query_mut()); true } QueryView::Duration(ref mut q) => { use std::convert::TryInto; - if q.get_format() != gst::Format::Bytes { + if q.format() != gst::Format::Bytes { return pad.query_default(Some(element), query); } @@ -322,7 +322,7 @@ impl Decrypter { return false; } - let size = match peer_query.get_result().try_into().unwrap() { + let size = match peer_query.result().try_into().unwrap() { gst::format::Bytes(Some(size)) => size, gst::format::Bytes(None) => { gst_error!(CAT, "Failed to query upstream duration"); @@ -381,7 +381,7 @@ impl Decrypter { err })?; - if buffer.get_size() != crate::HEADERS_SIZE { + if buffer.size() != crate::HEADERS_SIZE { let err = gst::loggable_error!(CAT, "Headers buffer has wrong size"); err.log_with_object(element); return Err(err); @@ -636,7 +636,7 @@ impl ObjectImpl for Decrypter { value: &glib::Value, pspec: &glib::ParamSpec, ) { - match pspec.get_name() { + match pspec.name() { "sender-key" => { let mut props = self.props.lock().unwrap(); props.sender_key = value.get().expect("type checked upstream"); @@ -652,7 +652,7 @@ impl ObjectImpl for Decrypter { } fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { - match pspec.get_name() { + match pspec.name() { "receiver-key" => { let props = self.props.lock().unwrap(); props.receiver_key.to_value() diff --git a/generic/sodium/src/encrypter/imp.rs b/generic/sodium/src/encrypter/imp.rs index a53f6fc71..415c8a4db 100644 --- a/generic/sodium/src/encrypter/imp.rs +++ b/generic/sodium/src/encrypter/imp.rs @@ -275,19 +275,19 @@ impl Encrypter { match query.view_mut() { QueryView::Seeking(mut q) => { - let format = q.get_format(); + let format = q.format(); q.set( false, gst::GenericFormattedValue::Other(format, -1), gst::GenericFormattedValue::Other(format, -1), ); - gst_log!(CAT, obj: pad, "Returning {:?}", q.get_mut_query()); + gst_log!(CAT, obj: pad, "Returning {:?}", q.query_mut()); true } QueryView::Duration(ref mut q) => { use std::convert::TryInto; - if q.get_format() != gst::Format::Bytes { + if q.format() != gst::Format::Bytes { return pad.query_default(Some(element), query); } @@ -299,7 +299,7 @@ impl Encrypter { return false; } - let size = match peer_query.get_result().try_into().unwrap() { + let size = match peer_query.result().try_into().unwrap() { gst::format::Bytes(Some(size)) => size, gst::format::Bytes(None) => { gst_error!(CAT, "Failed to query upstream duration"); @@ -436,7 +436,7 @@ impl ObjectImpl for Encrypter { value: &glib::Value, pspec: &glib::ParamSpec, ) { - match pspec.get_name() { + match pspec.name() { "sender-key" => { let mut props = self.props.lock().unwrap(); props.sender_key = value.get().expect("type checked upstream"); @@ -457,7 +457,7 @@ impl ObjectImpl for Encrypter { } fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { - match pspec.get_name() { + match pspec.name() { "receiver-key" => { let props = self.props.lock().unwrap(); props.receiver_key.to_value() diff --git a/generic/sodium/tests/decrypter.rs b/generic/sodium/tests/decrypter.rs index cab580dd2..164de4809 100644 --- a/generic/sodium/tests/decrypter.rs +++ b/generic/sodium/tests/decrypter.rs @@ -104,7 +104,7 @@ fn test_pipeline() { .new_sample(move |appsink| { // Pull the sample in question out of the appsink's buffer. let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?; - let buffer = sample.get_buffer().ok_or(gst::FlowError::Error)?; + let buffer = sample.buffer().ok_or(gst::FlowError::Error)?; let mut adapter = adapter_clone.lock().unwrap(); adapter.push(buffer.to_owned()); @@ -118,17 +118,17 @@ fn test_pipeline() { .set_state(gst::State::Playing) .expect("Unable to set the pipeline to the `Playing` state"); - let bus = pipeline.get_bus().unwrap(); + let bus = pipeline.bus().unwrap(); for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { use gst::MessageView; match msg.view() { MessageView::Error(err) => { eprintln!( "Error received from element {:?}: {}", - err.get_src().map(|s| s.get_path_string()), - err.get_error() + err.src().map(|s| s.path_string()), + err.error() ); - eprintln!("Debugging information: {:?}", err.get_debug()); + eprintln!("Debugging information: {:?}", err.debug()); unreachable!(); } MessageView::Eos(..) => break, @@ -196,7 +196,7 @@ fn test_pull_range() { srcpad.query(&mut q); // get the seeking capabilities - let (seekable, start, stop) = q.get_result(); + let (seekable, start, stop) = q.result(); assert_eq!(seekable, true); assert_eq!( start, @@ -214,7 +214,7 @@ fn test_pull_range() { 61, 70, 175, 103, 127, 28, 0, ]; let buf1 = srcpad.get_range(0, 50).unwrap(); - assert_eq!(buf1.get_size(), 50); + assert_eq!(buf1.size(), 50); let map1 = buf1.map_readable().unwrap(); assert_eq!(&map1[..], &expected_array_1[..]); @@ -226,7 +226,7 @@ fn test_pull_range() { 120, 121, 232, 0, 0, 12, 252, 195, 195, 199, 128, 0, 0, 0, ]; let buf2 = srcpad.get_range(0, 100).unwrap(); - assert_eq!(buf2.get_size(), 100); + assert_eq!(buf2.size(), 100); let map2 = buf2.map_readable().unwrap(); assert_eq!(&map2[..], &expected_array_2[..]); @@ -237,20 +237,20 @@ fn test_pull_range() { // request in the middle of a block let buf = srcpad.get_range(853, 100).unwrap(); // result size doesn't include the block macs, - assert_eq!(buf.get_size(), 100); + assert_eq!(buf.size(), 100); // read till eos, this also will pull multiple blocks let buf = srcpad.get_range(853, 42000).unwrap(); // 6031 (size of file) - 883 (requersted offset) - headers size - (numbler of blcks * block mac) - assert_eq!(buf.get_size(), 5054); + assert_eq!(buf.size(), 5054); // read 0 bytes from the start let buf = srcpad.get_range(0, 0).unwrap(); - assert_eq!(buf.get_size(), 0); + assert_eq!(buf.size(), 0); // read 0 bytes somewhere in the middle let buf = srcpad.get_range(4242, 0).unwrap(); - assert_eq!(buf.get_size(), 0); + assert_eq!(buf.size(), 0); // read 0 bytes to eos let res = srcpad.get_range(6003, 0); @@ -266,7 +266,7 @@ fn test_pull_range() { // read 10 bytes at eos -1, should return a single byte let buf = srcpad.get_range(5906, 10).unwrap(); - assert_eq!(buf.get_size(), 1); + assert_eq!(buf.size(), 1); pipeline .set_state(gst::State::Null) |