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/cdg | |
parent | c3fb55f235f7feb1ab737a64f8d3d53d03a81c7a (diff) |
fix-getters-{def,calls} pass
Diffstat (limited to 'video/cdg')
-rw-r--r-- | video/cdg/src/cdgdec/imp.rs | 14 | ||||
-rw-r--r-- | video/cdg/src/cdgparse/imp.rs | 16 | ||||
-rw-r--r-- | video/cdg/src/typefind.rs | 2 | ||||
-rw-r--r-- | video/cdg/tests/cdgdec.rs | 10 |
4 files changed, 21 insertions, 21 deletions
diff --git a/video/cdg/src/cdgdec/imp.rs b/video/cdg/src/cdgdec/imp.rs index 110b57bc5..e4e576648 100644 --- a/video/cdg/src/cdgdec/imp.rs +++ b/video/cdg/src/cdgdec/imp.rs @@ -119,13 +119,13 @@ impl VideoDecoderImpl for CdgDec { element.negotiate(output_state)?; - let out_state = element.get_output_state().unwrap(); - *out_info = Some(out_state.get_info()); + let out_state = element.output_state().unwrap(); + *out_info = Some(out_state.info()); } } let cmd = { - let input = frame.get_input_buffer().unwrap(); + let input = frame.input_buffer().unwrap(); let map = input.map_readable().map_err(|_| { gst::element_error!( element, @@ -153,7 +153,7 @@ impl VideoDecoderImpl for CdgDec { element.allocate_output_frame(&mut frame, None)?; { - let output = frame.get_output_buffer_mut().unwrap(); + let output = frame.output_buffer_mut().unwrap(); let info = self.output_info.lock().unwrap(); let mut out_frame = @@ -187,7 +187,7 @@ impl VideoDecoderImpl for CdgDec { } } - gst_debug!(CAT, obj: element, "Finish frame pts={}", frame.get_pts()); + gst_debug!(CAT, obj: element, "Finish frame pts={}", frame.pts()); element.finish_frame(frame) } @@ -202,9 +202,9 @@ impl VideoDecoderImpl for CdgDec { .find_allocation_meta::<gst_video::VideoMeta>() .is_some() { - let pools = allocation.get_allocation_pools(); + let pools = allocation.allocation_pools(); if let Some((Some(ref pool), _, _, _)) = pools.first() { - let mut config = pool.get_config(); + let mut config = pool.config(); config.add_option(&gst_video::BUFFER_POOL_OPTION_VIDEO_META); pool.set_config(config) .map_err(|e| gst::error_msg!(gst::CoreError::Negotiation, [&e.message]))?; diff --git a/video/cdg/src/cdgparse/imp.rs b/video/cdg/src/cdgparse/imp.rs index 65e7cef00..8f7dde79a 100644 --- a/video/cdg/src/cdgparse/imp.rs +++ b/video/cdg/src/cdgparse/imp.rs @@ -119,9 +119,9 @@ impl BaseParseImpl for CdgParse { /* Set duration */ let mut query = gst::query::Duration::new(gst::Format::Bytes); - let pad = element.get_src_pad(); + let pad = element.src_pad(); if pad.query(&mut query) { - let size = query.get_result(); + let size = query.result(); let duration = bytes_to_time(size.try_into().unwrap()); element.set_duration(duration, 0); } @@ -134,8 +134,8 @@ impl BaseParseImpl for CdgParse { element: &Self::Type, mut frame: gst_base::BaseParseFrame, ) -> Result<(gst::FlowSuccess, u32), gst::FlowError> { - let pad = element.get_src_pad(); - if pad.get_current_caps().is_none() { + let pad = element.src_pad(); + if pad.current_caps().is_none() { // Set src pad caps let src_caps = gst::Caps::new_simple( "video/x-cdg", @@ -151,7 +151,7 @@ impl BaseParseImpl for CdgParse { } // Scan for CDG instruction - let input = frame.get_buffer().unwrap(); + let input = frame.buffer().unwrap(); let skip = { let map = input.map_readable().map_err(|_| { gst::element_error!( @@ -167,7 +167,7 @@ impl BaseParseImpl for CdgParse { .enumerate() .find(|(_, byte)| (*byte & CDG_MASK == CDG_COMMAND)) .map(|(i, _)| i) - .unwrap_or_else(|| input.get_size()) // skip the whole buffer + .unwrap_or_else(|| input.size()) // skip the whole buffer as u32 }; @@ -198,8 +198,8 @@ impl BaseParseImpl for CdgParse { } }; - let pts = bytes_to_time(Bytes(Some(frame.get_offset()))); - let buffer = frame.get_buffer_mut().unwrap(); + let pts = bytes_to_time(Bytes(Some(frame.offset()))); + let buffer = frame.buffer_mut().unwrap(); buffer.set_pts(pts); if !keyframe { diff --git a/video/cdg/src/typefind.rs b/video/cdg/src/typefind.rs index e81438497..4b9077778 100644 --- a/video/cdg/src/typefind.rs +++ b/video/cdg/src/typefind.rs @@ -43,7 +43,7 @@ fn compute_probability(typefind: &mut TypeFind) -> TypeFindProbability { let mut best = TypeFindProbability::None; // Try looking at the start of the file if its length isn't available let len = typefind - .get_length() + .length() .unwrap_or(TYPEFIND_SEARCH_WINDOW as u64 * NB_WINDOWS); let step = len / NB_WINDOWS; diff --git a/video/cdg/tests/cdgdec.rs b/video/cdg/tests/cdgdec.rs index 9dd8b1a2e..0c9ee6fda 100644 --- a/video/cdg/tests/cdgdec.rs +++ b/video/cdg/tests/cdgdec.rs @@ -66,7 +66,7 @@ fn test_cdgdec() { .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 map = buffer.map_readable().map_err(|_| gst::FlowError::Error)?; // First frame fully blue @@ -83,17 +83,17 @@ fn test_cdgdec() { .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, |