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 /video/gif | |
parent | c3fb55f235f7feb1ab737a64f8d3d53d03a81c7a (diff) |
fix-getters-{def,calls} pass
Diffstat (limited to 'video/gif')
-rw-r--r-- | video/gif/examples/testvideosrc2gif.rs | 8 | ||||
-rw-r--r-- | video/gif/src/gifenc/imp.rs | 18 | ||||
-rw-r--r-- | video/gif/tests/gifenc.rs | 2 |
3 files changed, 13 insertions, 15 deletions
diff --git a/video/gif/examples/testvideosrc2gif.rs b/video/gif/examples/testvideosrc2gif.rs index 7f4ef5300..66869f54c 100644 --- a/video/gif/examples/testvideosrc2gif.rs +++ b/video/gif/examples/testvideosrc2gif.rs @@ -24,7 +24,7 @@ fn main() { gstgif::plugin_register_static().expect("Failed to register gif plugin"); let pipeline = gst::parse_launch(ENCODE_PIPELINE).unwrap(); - let bus = pipeline.get_bus().unwrap(); + let bus = pipeline.bus().unwrap(); pipeline .set_state(gst::State::Playing) @@ -38,9 +38,9 @@ fn main() { MessageView::Error(err) => { println!( "Error from {:?}: {} ({:?})", - err.get_src().map(|s| s.get_path_string()), - err.get_error(), - err.get_debug() + err.src().map(|s| s.path_string()), + err.error(), + err.debug() ); break; } diff --git a/video/gif/src/gifenc/imp.rs b/video/gif/src/gifenc/imp.rs index 7db670687..aeca73e45 100644 --- a/video/gif/src/gifenc/imp.rs +++ b/video/gif/src/gifenc/imp.rs @@ -161,7 +161,7 @@ impl ObjectImpl for GifEnc { value: &glib::Value, pspec: &glib::ParamSpec, ) { - match pspec.get_name() { + match pspec.name() { "repeat" => { let mut settings = self.settings.lock().unwrap(); settings.repeat = value.get_some().expect("type checked upstream"); @@ -171,7 +171,7 @@ impl ObjectImpl for GifEnc { } fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { - match pspec.get_name() { + match pspec.name() { "repeat" => { let settings = self.settings.lock().unwrap(); settings.repeat.to_value() @@ -260,7 +260,7 @@ impl VideoEncoderImpl for GifEnc { self.flush_encoder(element) .map_err(|_| gst::loggable_error!(CAT, "Failed to drain"))?; - let video_info = state.get_info(); + let video_info = state.info(); gst_debug!(CAT, obj: element, "Setting format {:?}", video_info); { @@ -296,12 +296,10 @@ impl VideoEncoderImpl for GifEnc { CAT, obj: element, "Sending frame {}", - frame.get_system_frame_number() + frame.system_frame_number() ); - let input_buffer = frame - .get_input_buffer() - .expect("frame without input buffer"); + let input_buffer = frame.input_buffer().expect("frame without input buffer"); { let in_frame = gst_video::VideoFrameRef::from_buffer_ref_readable( @@ -323,12 +321,12 @@ impl VideoEncoderImpl for GifEnc { // Calculate delay to new frame by calculating the difference between the current actual // presentation timestamp of the last frame within the gif, and the pts of the new frame. // This results in variable frame delays in the gif - but an overall constant fps. - state.last_actual_pts = in_frame.buffer().get_pts(); + state.last_actual_pts = in_frame.buffer().pts(); if state.gif_pts.is_none() { // First frame: use pts of first input frame as origin - state.gif_pts = Some(in_frame.buffer().get_pts()); + state.gif_pts = Some(in_frame.buffer().pts()); } - let frame_delay = in_frame.buffer().get_pts() - state.gif_pts.unwrap(); + let frame_delay = in_frame.buffer().pts() - state.gif_pts.unwrap(); if frame_delay.is_none() { gst::element_error!( element, diff --git a/video/gif/tests/gifenc.rs b/video/gif/tests/gifenc.rs index 65d4d1704..bae6e9f1c 100644 --- a/video/gif/tests/gifenc.rs +++ b/video/gif/tests/gifenc.rs @@ -63,6 +63,6 @@ fn test_encode(video_info: &gst_video::VideoInfo) { // last frame is the GIF trailer let buffer = h.pull().unwrap(); // Currently, every frame should be a full frame - assert!(!buffer.get_flags().contains(gst::BufferFlags::DELTA_UNIT)) + assert!(!buffer.flags().contains(gst::BufferFlags::DELTA_UNIT)) } } |