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/closedcaption | |
parent | c3fb55f235f7feb1ab737a64f8d3d53d03a81c7a (diff) |
fix-getters-{def,calls} pass
Diffstat (limited to 'video/closedcaption')
20 files changed, 185 insertions, 203 deletions
diff --git a/video/closedcaption/src/ccdetect/imp.rs b/video/closedcaption/src/ccdetect/imp.rs index 75b156760..f67ff0e42 100644 --- a/video/closedcaption/src/ccdetect/imp.rs +++ b/video/closedcaption/src/ccdetect/imp.rs @@ -261,7 +261,7 @@ impl ObjectImpl for CCDetect { value: &glib::Value, pspec: &glib::ParamSpec, ) { - match pspec.get_name() { + match pspec.name() { "window" => { let mut settings = self.settings.lock().unwrap(); settings.window = value.get_some().expect("type checked upstream"); @@ -271,7 +271,7 @@ impl ObjectImpl for CCDetect { } fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { - match pspec.get_name() { + match pspec.name() { "window" => { let settings = self.settings.lock().unwrap(); settings.window.to_value() @@ -350,7 +350,7 @@ impl BaseTransformImpl for CCDetect { ) -> Result<gst::FlowSuccess, gst::FlowError> { let map = buf.map_readable().map_err(|_| gst::FlowError::Error)?; - if buf.get_pts().is_none() { + if buf.pts().is_none() { gst::element_error!( element, gst::ResourceError::Read, @@ -377,7 +377,7 @@ impl BaseTransformImpl for CCDetect { } }; - self.maybe_update_properties(element, buf.get_pts(), cc_packet) + self.maybe_update_properties(element, buf.pts(), cc_packet) .map_err(|_| gst::FlowError::Error)?; Ok(gst::FlowSuccess::Ok) diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs index 47be3c8b6..81a98c12e 100644 --- a/video/closedcaption/src/cea608overlay/imp.rs +++ b/video/closedcaption/src/cea608overlay/imp.rs @@ -138,7 +138,7 @@ impl Cea608Overlay { layout.set_text( &"12345678901234567890123456789012\n2\n3\n4\n5\n6\n7\n8\n9\n0\n1\n2\n3\n4\n5", ); - let (_ink_rect, logical_rect) = layout.get_extents(); + let (_ink_rect, logical_rect) = layout.extents(); if logical_rect.width > video_info.width() as i32 * pango::SCALE || logical_rect.height > video_info.height() as i32 * pango::SCALE { @@ -160,7 +160,7 @@ impl Cea608Overlay { let video_info = state.video_info.as_ref().unwrap(); let layout = state.layout.as_ref().unwrap(); layout.set_text(text); - let (_ink_rect, logical_rect) = layout.get_extents(); + let (_ink_rect, logical_rect) = layout.extents(); let height = logical_rect.height / pango::SCALE; let width = logical_rect.width / pango::SCALE; @@ -189,7 +189,7 @@ impl Cea608Overlay { // Pass ownership of the buffer to the cairo surface but keep around // a raw pointer so we can later retrieve it again when the surface // is done - let buffer_ptr = unsafe { buffer.get_buffer().as_ptr() }; + let buffer_ptr = unsafe { buffer.buffer().as_ptr() }; let surface = cairo::ImageSurface::create_for_data( buffer, cairo::Format::ARgb32, @@ -436,8 +436,8 @@ impl Cea608Overlay { } for meta in buffer.iter_meta::<gst_video::VideoCaptionMeta>() { - if meta.get_caption_type() == gst_video::VideoCaptionType::Cea708Cdp { - match extract_cdp(meta.get_data()) { + if meta.caption_type() == gst_video::VideoCaptionType::Cea708Cdp { + match extract_cdp(meta.data()) { Ok(data) => { self.decode_cc_data(pad, element, &mut state, data); } @@ -446,12 +446,12 @@ impl Cea608Overlay { gst::element_warning!(element, gst::StreamError::Decode, [&e.to_string()]); } } - } else if meta.get_caption_type() == gst_video::VideoCaptionType::Cea708Raw { - self.decode_cc_data(pad, element, &mut state, meta.get_data()); - } else if meta.get_caption_type() == gst_video::VideoCaptionType::Cea608S3341a { - self.decode_s334_1a(pad, element, &mut state, meta.get_data()); - } else if meta.get_caption_type() == gst_video::VideoCaptionType::Cea608Raw { - let data = meta.get_data(); + } else if meta.caption_type() == gst_video::VideoCaptionType::Cea708Raw { + self.decode_cc_data(pad, element, &mut state, meta.data()); + } else if meta.caption_type() == gst_video::VideoCaptionType::Cea608S3341a { + self.decode_s334_1a(pad, element, &mut state, meta.data()); + } else if meta.caption_type() == gst_video::VideoCaptionType::Cea608Raw { + let data = meta.data(); assert!(data.len() % 2 == 0); for i in 0..data.len() / 2 { match state @@ -514,7 +514,7 @@ impl Cea608Overlay { match event.view() { EventView::Caps(c) => { let mut state = self.state.lock().unwrap(); - state.video_info = gst_video::VideoInfo::from_caps(c.get_caps()).ok(); + state.video_info = gst_video::VideoInfo::from_caps(c.caps()).ok(); self.srcpad.check_reconfigure(); match self.negotiate(element, &mut state) { Ok(_) => true, @@ -599,7 +599,7 @@ impl ObjectImpl for Cea608Overlay { value: &glib::Value, pspec: &glib::ParamSpec, ) { - match pspec.get_name() { + match pspec.name() { "field" => { let mut settings = self.settings.lock().unwrap(); let mut state = self.state.lock().unwrap(); @@ -615,7 +615,7 @@ impl ObjectImpl for Cea608Overlay { } fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { - match pspec.get_name() { + match pspec.name() { "field" => { let settings = self.settings.lock().unwrap(); settings.field.to_value() diff --git a/video/closedcaption/src/cea608tojson/imp.rs b/video/closedcaption/src/cea608tojson/imp.rs index 4e966e3d4..9712d57ac 100644 --- a/video/closedcaption/src/cea608tojson/imp.rs +++ b/video/closedcaption/src/cea608tojson/imp.rs @@ -748,13 +748,13 @@ impl Cea608ToJson { let mut state = self.state.borrow_mut(); - let pts = buffer.get_pts(); + let pts = buffer.pts(); if pts.is_none() { gst_error!(CAT, obj: pad, "Require timestamped buffers"); return Err(gst::FlowError::Error); } - let duration = buffer.get_duration(); + let duration = buffer.duration(); if duration.is_none() { gst_error!(CAT, obj: pad, "Require buffers with duration"); return Err(gst::FlowError::Error); diff --git a/video/closedcaption/src/cea608tott/imp.rs b/video/closedcaption/src/cea608tott/imp.rs index 1367b5165..bf073e9b1 100644 --- a/video/closedcaption/src/cea608tott/imp.rs +++ b/video/closedcaption/src/cea608tott/imp.rs @@ -76,7 +76,7 @@ impl Cea608ToTt { } }; - let buffer_pts = buffer.get_pts(); + let buffer_pts = buffer.pts(); if buffer_pts.is_none() { gst_error!(CAT, obj: pad, "Require timestamped buffers"); return Err(gst::FlowError::Error); @@ -284,8 +284,8 @@ impl Cea608ToTt { return true; } - let mut downstream_caps = match self.srcpad.get_allowed_caps() { - None => self.srcpad.get_pad_template_caps(), + let mut downstream_caps = match self.srcpad.allowed_caps() { + None => self.srcpad.pad_template_caps(), Some(caps) => caps, }; @@ -304,13 +304,13 @@ impl Cea608ToTt { ); let s = downstream_caps.get_structure(0).unwrap(); - let new_caps = if s.get_name() == "application/x-subtitle-vtt" { + let new_caps = if s.name() == "application/x-subtitle-vtt" { state.format = Some(Format::Vtt); gst::Caps::builder("application/x-subtitle-vtt").build() - } else if s.get_name() == "application/x-subtitle" { + } else if s.name() == "application/x-subtitle" { state.format = Some(Format::Srt); gst::Caps::builder("application/x-subtitle").build() - } else if s.get_name() == "text/x-raw" { + } else if s.name() == "text/x-raw" { state.format = Some(Format::Raw); gst::Caps::builder("text/x-raw") .field("format", &"utf8") diff --git a/video/closedcaption/src/line_reader.rs b/video/closedcaption/src/line_reader.rs index 7ab488335..3f0dd48a1 100644 --- a/video/closedcaption/src/line_reader.rs +++ b/video/closedcaption/src/line_reader.rs @@ -61,12 +61,12 @@ impl<T: AsRef<[u8]>> LineReader<T> { } #[allow(unused)] - pub fn get_line_or_drain(&mut self) -> Option<&[u8]> { + pub fn line_or_drain(&mut self) -> Option<&[u8]> { self.get_line_with_drain(true) } #[allow(unused)] - pub fn get_line(&mut self) -> Option<&[u8]> { + pub fn line(&mut self) -> Option<&[u8]> { self.get_line_with_drain(false) } @@ -247,10 +247,10 @@ mod tests { let mut r = LineReader::new(); r.push(Vec::from(b"abcd\nefgh\nijkl\n".as_ref())); - assert_eq!(r.get_line(), Some(b"abcd\n".as_ref())); - assert_eq!(r.get_line(), Some(b"efgh\n".as_ref())); - assert_eq!(r.get_line(), Some(b"ijkl\n".as_ref())); - assert_eq!(r.get_line(), None); + assert_eq!(r.line(), Some(b"abcd\n".as_ref())); + assert_eq!(r.line(), Some(b"efgh\n".as_ref())); + assert_eq!(r.line(), Some(b"ijkl\n".as_ref())); + assert_eq!(r.line(), None); } #[test] @@ -258,11 +258,11 @@ mod tests { let mut r = LineReader::new(); r.push(Vec::from(b"abcd\nefgh\n\nijkl\n".as_ref())); - assert_eq!(r.get_line(), Some(b"abcd\n".as_ref())); - assert_eq!(r.get_line(), Some(b"efgh\n".as_ref())); - assert_eq!(r.get_line(), Some(b"\n".as_ref())); - assert_eq!(r.get_line(), Some(b"ijkl\n".as_ref())); - assert_eq!(r.get_line(), None); + assert_eq!(r.line(), Some(b"abcd\n".as_ref())); + assert_eq!(r.line(), Some(b"efgh\n".as_ref())); + assert_eq!(r.line(), Some(b"\n".as_ref())); + assert_eq!(r.line(), Some(b"ijkl\n".as_ref())); + assert_eq!(r.line(), None); } #[test] @@ -271,10 +271,10 @@ mod tests { r.push(Vec::from(b"abcd\nef".as_ref())); r.push(Vec::from(b"gh\nijkl\n".as_ref())); - assert_eq!(r.get_line(), Some(b"abcd\n".as_ref())); - assert_eq!(r.get_line(), Some(b"efgh\n".as_ref())); - assert_eq!(r.get_line(), Some(b"ijkl\n".as_ref())); - assert_eq!(r.get_line(), None); + assert_eq!(r.line(), Some(b"abcd\n".as_ref())); + assert_eq!(r.line(), Some(b"efgh\n".as_ref())); + assert_eq!(r.line(), Some(b"ijkl\n".as_ref())); + assert_eq!(r.line(), None); } #[test] @@ -285,10 +285,10 @@ mod tests { r.push(Vec::from(b"g".as_ref())); r.push(Vec::from(b"h\nijkl\n".as_ref())); - assert_eq!(r.get_line(), Some(b"abcd\n".as_ref())); - assert_eq!(r.get_line(), Some(b"efgh\n".as_ref())); - assert_eq!(r.get_line(), Some(b"ijkl\n".as_ref())); - assert_eq!(r.get_line(), None); + assert_eq!(r.line(), Some(b"abcd\n".as_ref())); + assert_eq!(r.line(), Some(b"efgh\n".as_ref())); + assert_eq!(r.line(), Some(b"ijkl\n".as_ref())); + assert_eq!(r.line(), None); } #[test] @@ -296,11 +296,11 @@ mod tests { let mut r = LineReader::new(); r.push(Vec::from(b"abcd\nefgh\nijkl".as_ref())); - assert_eq!(r.get_line(), Some(b"abcd\n".as_ref())); - assert_eq!(r.get_line(), Some(b"efgh\n".as_ref())); - assert_eq!(r.get_line(), None); - assert_eq!(r.get_line_or_drain(), Some(b"ijkl".as_ref())); - assert_eq!(r.get_line_or_drain(), None); + assert_eq!(r.line(), Some(b"abcd\n".as_ref())); + assert_eq!(r.line(), Some(b"efgh\n".as_ref())); + assert_eq!(r.line(), None); + assert_eq!(r.line_or_drain(), Some(b"ijkl".as_ref())); + assert_eq!(r.line_or_drain(), None); } #[test] @@ -309,11 +309,11 @@ mod tests { r.push(Vec::from(b"abcd\nefgh\n".as_ref())); r.push(Vec::from(b"ijkl".as_ref())); - assert_eq!(r.get_line(), Some(b"abcd\n".as_ref())); - assert_eq!(r.get_line(), Some(b"efgh\n".as_ref())); - assert_eq!(r.get_line(), None); - assert_eq!(r.get_line_or_drain(), Some(b"ijkl".as_ref())); - assert_eq!(r.get_line_or_drain(), None); + assert_eq!(r.line(), Some(b"abcd\n".as_ref())); + assert_eq!(r.line(), Some(b"efgh\n".as_ref())); + assert_eq!(r.line(), None); + assert_eq!(r.line_or_drain(), Some(b"ijkl".as_ref())); + assert_eq!(r.line_or_drain(), None); } #[test] @@ -324,10 +324,10 @@ mod tests { r.push(Vec::from(b"k".as_ref())); r.push(Vec::from(b"l".as_ref())); - assert_eq!(r.get_line(), Some(b"abcd\n".as_ref())); - assert_eq!(r.get_line(), Some(b"efgh\n".as_ref())); - assert_eq!(r.get_line(), None); - assert_eq!(r.get_line_or_drain(), Some(b"ijkl".as_ref())); - assert_eq!(r.get_line_or_drain(), None); + assert_eq!(r.line(), Some(b"abcd\n".as_ref())); + assert_eq!(r.line(), Some(b"efgh\n".as_ref())); + assert_eq!(r.line(), None); + assert_eq!(r.line_or_drain(), Some(b"ijkl".as_ref())); + assert_eq!(r.line_or_drain(), None); } } diff --git a/video/closedcaption/src/mcc_enc/imp.rs b/video/closedcaption/src/mcc_enc/imp.rs index b822bbd27..07336de56 100644 --- a/video/closedcaption/src/mcc_enc/imp.rs +++ b/video/closedcaption/src/mcc_enc/imp.rs @@ -90,7 +90,7 @@ impl MccEnc { let caps = self .sinkpad - .get_current_caps() + .current_caps() .ok_or(gst::FlowError::NotNegotiated)?; let framerate = match caps .get_structure(0) @@ -125,17 +125,17 @@ impl MccEnc { if let Some(ref creation_date) = settings.creation_date { let creation_date = Utc .ymd( - creation_date.get_year() as i32, - creation_date.get_month() as u32, - creation_date.get_day_of_month() as u32, + creation_date.year() as i32, + creation_date.month() as u32, + creation_date.day_of_month() as u32, ) .and_hms( - creation_date.get_hour() as u32, - creation_date.get_minute() as u32, - creation_date.get_seconds() as u32, + creation_date.hour() as u32, + creation_date.minute() as u32, + creation_date.seconds() as u32, ) .with_timezone(&FixedOffset::east( - (creation_date.get_utc_offset() / 1_000_000) as i32, + (creation_date.utc_offset() / 1_000_000) as i32, )); let _ = write!( @@ -287,7 +287,7 @@ impl MccEnc { gst::FlowError::Error })?; - let _ = write!(outbuf, "{}\t", meta.get_tc()); + let _ = write!(outbuf, "{}\t", meta.tc()); let map = buffer.map_readable().map_err(|_| { gst::element_error!( @@ -369,7 +369,7 @@ impl MccEnc { match event.view() { EventView::Caps(ev) => { - let caps = ev.get_caps(); + let caps = ev.caps(); let s = caps.get_structure(0).unwrap(); let framerate = match s.get_some::<gst::Fraction>("framerate") { Ok(framerate) => framerate, @@ -381,7 +381,7 @@ impl MccEnc { }; let mut state = self.state.lock().unwrap(); - if s.get_name() == "closedcaption/x-cea-608" { + if s.name() == "closedcaption/x-cea-608" { state.format = Some(Format::Cea608); } else { state.format = Some(Format::Cea708Cdp); @@ -431,7 +431,7 @@ impl MccEnc { match query.view_mut() { QueryView::Seeking(mut q) => { // We don't support any seeking at all - let fmt = q.get_format(); + let fmt = q.format(); q.set( false, gst::GenericFormattedValue::Other(fmt, -1), @@ -527,7 +527,7 @@ impl ObjectImpl for MccEnc { value: &glib::Value, pspec: &glib::ParamSpec, ) { - match pspec.get_name() { + match pspec.name() { "uuid" => { let mut settings = self.settings.lock().unwrap(); settings.uuid = value.get().expect("type checked upstream"); @@ -541,7 +541,7 @@ impl ObjectImpl for MccEnc { } fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { - match pspec.get_name() { + match pspec.name() { "uuid" => { let settings = self.settings.lock().unwrap(); settings.uuid.to_value() diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs index fb3d07878..a6d449e9e 100644 --- a/video/closedcaption/src/mcc_parse/imp.rs +++ b/video/closedcaption/src/mcc_parse/imp.rs @@ -526,7 +526,7 @@ impl MccParse { state.last_timecode = Some(timecode); - if nsecs >= state.segment.get_start() { + if nsecs >= state.segment.start() { state.seeking = false; state.discont = true; state.replay_last_line = true; @@ -562,8 +562,8 @@ impl MccParse { // Update the last_timecode to the current one state.last_timecode = Some(timecode); - let send_eos = state.segment.get_stop().is_some() - && buffer.get_pts() + buffer.get_duration() >= state.segment.get_stop(); + let send_eos = state.segment.stop().is_some() + && buffer.pts() + buffer.duration() >= state.segment.stop(); // Drop our state mutex while we push out buffers or events drop(state); @@ -673,7 +673,7 @@ impl MccParse { return Err(loggable_error!(CAT, "Failed to query upstream duration")); } - let size = match q.get_result().try_into().unwrap() { + let size = match q.result().try_into().unwrap() { gst::format::Bytes(Some(size)) => size, gst::format::Bytes(None) => { return Err(loggable_error!(CAT, "Failed to query upstream duration")); @@ -937,7 +937,7 @@ impl MccParse { _ => { if event.is_sticky() && !self.srcpad.has_current_caps() - && event.get_type() > gst::EventType::Caps + && event.type_() > gst::EventType::Caps { gst_log!(CAT, obj: pad, "Deferring sticky event until we have caps"); let mut state = self.state.lock().unwrap(); @@ -984,7 +984,7 @@ impl MccParse { return false; } - let seek_seqnum = event.get_seqnum(); + let seek_seqnum = event.seqnum(); let event = gst::event::FlushStart::builder() .seqnum(seek_seqnum) @@ -1067,7 +1067,7 @@ impl MccParse { QueryView::Seeking(mut q) => { let state = self.state.lock().unwrap(); - let fmt = q.get_format(); + let fmt = q.format(); if fmt == gst::Format::Time { if let Some(pull) = state.pull.as_ref() { @@ -1086,7 +1086,7 @@ impl MccParse { } QueryView::Position(ref mut q) => { // For Time answer ourselfs, otherwise forward - if q.get_format() == gst::Format::Time { + if q.format() == gst::Format::Time { let state = self.state.lock().unwrap(); q.set(state.last_position); true @@ -1097,7 +1097,7 @@ impl MccParse { QueryView::Duration(ref mut q) => { // For Time answer ourselfs, otherwise forward let state = self.state.lock().unwrap(); - if q.get_format() == gst::Format::Time { + if q.format() == gst::Format::Time { if let Some(pull) = state.pull.as_ref() { if pull.duration.is_some() { q.set(state.pull.as_ref().unwrap().duration); diff --git a/video/closedcaption/src/mcc_parse/parser.rs b/video/closedcaption/src/mcc_parse/parser.rs index 7391e8cae..3ebef48a7 100644 --- a/video/closedcaption/src/mcc_parse/parser.rs +++ b/video/closedcaption/src/mcc_parse/parser.rs @@ -688,7 +688,7 @@ mod tests { reader.push(Vec::from(mcc_file.as_ref())); - while let Some(line) = reader.get_line() { + while let Some(line) = reader.line() { let res = match parser.parse_line(line, true) { Ok(res) => res, Err(err) => panic!("Couldn't parse line {}: {:?}", line_cnt, err), diff --git a/video/closedcaption/src/scc_enc/imp.rs b/video/closedcaption/src/scc_enc/imp.rs index 374c4a326..c5a5cc09c 100644 --- a/video/closedcaption/src/scc_enc/imp.rs +++ b/video/closedcaption/src/scc_enc/imp.rs @@ -78,11 +78,11 @@ impl State { assert!(self.internal_buffer.len() < MAXIMUM_PACKETES_PER_LINE); - if buffer.get_size() != 2 { + if buffer.size() != 2 { gst::element_error!( element, gst::StreamError::Format, - ["Wrongly sized CEA608 packet: {}", buffer.get_size()] + ["Wrongly sized CEA608 packet: {}", buffer.size()] ); return Err(gst::FlowError::Error); @@ -105,7 +105,7 @@ impl State { gst::FlowError::Error })? - .get_tc(); + .tc(); if self.expected_timecode.is_none() { self.expected_timecode = Some(timecode.clone()); @@ -173,7 +173,7 @@ impl State { // Checked already before the buffer has been pushed to the // internal_buffer .expect("Buffer without timecode") - .get_tc(); + .tc(); let _ = write!(outbuf, "{}\t", timecode); line_start = false; @@ -206,7 +206,7 @@ impl State { first_buf .copy_into(buf_mut, gst::BUFFER_COPY_METADATA, 0, None) .expect("Failed to copy buffer metadata"); - buf_mut.set_pts(first_buf.get_pts()); + buf_mut.set_pts(first_buf.pts()); buffer }; @@ -252,7 +252,7 @@ impl SccEnc { match event.view() { EventView::Caps(ev) => { - let caps = ev.get_caps(); + let caps = ev.caps(); let s = caps.get_structure(0).unwrap(); let framerate = match s.get_some::<gst::Fraction>("framerate") { Ok(framerate) => Some(framerate), @@ -319,7 +319,7 @@ impl SccEnc { match query.view_mut() { QueryView::Seeking(mut q) => { // We don't support any seeking at all - let fmt = q.get_format(); + let fmt = q.format(); q.set( false, gst::GenericFormattedValue::Other(fmt, -1), diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs index 1c8872d2a..32c1bfb04 100644 --- a/video/closedcaption/src/scc_parse/imp.rs +++ b/video/closedcaption/src/scc_parse/imp.rs @@ -375,7 +375,7 @@ impl SccParse { let mut timecode = state.handle_timecode(&tc, framerate, element)?; let start_time = gst::ClockTime::from(timecode.nsec_since_daily_jam()); - let segment_start = state.segment.get_start(); + let segment_start = state.segment.start(); let clip_buffers = if state.seeking { // If we are in the middle of seeking, check whether this line // contains start frame, and if so, unset seeking flag @@ -430,7 +430,7 @@ impl SccParse { timecode.increment_frame(); if clip_buffers { - let end_time = buffer.get_pts() + buffer.get_duration(); + let end_time = buffer.pts() + buffer.duration(); if end_time < segment_start { gst_trace!( CAT, @@ -443,8 +443,8 @@ impl SccParse { } } - send_eos = state.segment.get_stop().is_some() - && buffer.get_pts() + buffer.get_duration() >= state.segment.get_stop(); + send_eos = state.segment.stop().is_some() + && buffer.pts() + buffer.duration() >= state.segment.stop(); let buffers = buffers.get_mut().unwrap(); buffers.add(buffer); @@ -566,7 +566,7 @@ impl SccParse { return Err(loggable_error!(CAT, "Failed to query upstream duration")); } - let size = match q.get_result().try_into().unwrap() { + let size = match q.result().try_into().unwrap() { gst::format::Bytes(Some(size)) => size, gst::format::Bytes(None) => { return Err(loggable_error!(CAT, "Failed to query upstream duration")); @@ -817,7 +817,7 @@ impl SccParse { _ => { if event.is_sticky() && !self.srcpad.has_current_caps() - && event.get_type() > gst::EventType::Caps + && event.type_() > gst::EventType::Caps { gst_log!(CAT, obj: pad, "Deferring sticky event until we have caps"); let mut state = self.state.lock().unwrap(); @@ -864,7 +864,7 @@ impl SccParse { return false; } - let seek_seqnum = event.get_seqnum(); + let seek_seqnum = event.seqnum(); let event = gst::event::FlushStart::builder() .seqnum(seek_seqnum) @@ -947,7 +947,7 @@ impl SccParse { QueryView::Seeking(mut q) => { let state = self.state.lock().unwrap(); - let fmt = q.get_format(); + let fmt = q.format(); if fmt == gst::Format::Time { if let Some(pull) = state.pull.as_ref() { @@ -966,7 +966,7 @@ impl SccParse { } QueryView::Position(ref mut q) => { // For Time answer ourselfs, otherwise forward - if q.get_format() == gst::Format::Time { + if q.format() == gst::Format::Time { let state = self.state.lock().unwrap(); q.set(state.last_position); true @@ -977,7 +977,7 @@ impl SccParse { QueryView::Duration(ref mut q) => { // For Time answer ourselfs, otherwise forward let state = self.state.lock().unwrap(); - if q.get_format() == gst::Format::Time { + if q.format() == gst::Format::Time { if let Some(pull) = state.pull.as_ref() { if pull.duration.is_some() { q.set(state.pull.as_ref().unwrap().duration); diff --git a/video/closedcaption/src/scc_parse/parser.rs b/video/closedcaption/src/scc_parse/parser.rs index 53ccd4e8f..26c167e57 100644 --- a/video/closedcaption/src/scc_parse/parser.rs +++ b/video/closedcaption/src/scc_parse/parser.rs @@ -346,7 +346,7 @@ mod tests { reader.push(Vec::from(scc_file.as_ref())); - while let Some(line) = reader.get_line() { + while let Some(line) = reader.line() { let res = match parser.parse_line(line) { Ok(res) => res, Err(err) => panic!("Couldn't parse line {}: {:?}", line_cnt, err), diff --git a/video/closedcaption/src/tttocea608/imp.rs b/video/closedcaption/src/tttocea608/imp.rs index 3cb383bed..1ddd94146 100644 --- a/video/closedcaption/src/tttocea608/imp.rs +++ b/video/closedcaption/src/tttocea608/imp.rs @@ -789,7 +789,7 @@ impl TtToCea608 { element: &super::TtToCea608, buffer: gst::Buffer, ) -> Result<gst::FlowSuccess, gst::FlowError> { - let pts = match buffer.get_pts() { + let pts = match buffer.pts() { gst::CLOCK_TIME_NONE => { gst::element_error!( element, @@ -801,7 +801,7 @@ impl TtToCea608 { pts => Ok(pts), }?; - let duration = match buffer.get_duration() { + let duration = match buffer.duration() { gst::CLOCK_TIME_NONE => { gst::element_error!( element, @@ -884,8 +884,8 @@ impl TtToCea608 { match event.view() { EventView::Caps(e) => { - let mut downstream_caps = match self.srcpad.get_allowed_caps() { - None => self.srcpad.get_pad_template_caps(), + let mut downstream_caps = match self.srcpad.allowed_caps() { + None => self.srcpad.pad_template_caps(), Some(caps) => caps, }; @@ -906,9 +906,9 @@ impl TtToCea608 { let mut state = self.state.lock().unwrap(); state.framerate = s.get_some::<gst::Fraction>("framerate").unwrap(); - let upstream_caps = e.get_caps(); + let upstream_caps = e.caps(); let s = upstream_caps.get_structure(0).unwrap(); - state.json_input = s.get_name() == "application/x-json"; + state.json_input = s.name() == "application/x-json"; gst_debug!(CAT, obj: pad, "Pushing caps {}", caps); @@ -1066,7 +1066,7 @@ impl ObjectImpl for TtToCea608 { value: &glib::Value, pspec: &glib::ParamSpec, ) { - match pspec.get_name() { + match pspec.name() { "mode" => { let mut settings = self.settings.lock().unwrap(); settings.mode = value @@ -1091,7 +1091,7 @@ impl ObjectImpl for TtToCea608 { } fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { - match pspec.get_name() { + match pspec.name() { "mode" => { let settings = self.settings.lock().unwrap(); settings.mode.to_value() diff --git a/video/closedcaption/src/tttojson/imp.rs b/video/closedcaption/src/tttojson/imp.rs index d25fbf9ce..711ec0fdc 100644 --- a/video/closedcaption/src/tttojson/imp.rs +++ b/video/closedcaption/src/tttojson/imp.rs @@ -60,8 +60,8 @@ impl TtToJson { element: &super::TtToJson, buffer: gst::Buffer, ) -> Result<gst::FlowSuccess, gst::FlowError> { - let pts = buffer.get_pts(); - let duration = buffer.get_duration(); + let pts = buffer.pts(); + let duration = buffer.duration(); let buffer = buffer.into_mapped_buffer_readable().map_err(|_| { gst::element_error!( @@ -253,7 +253,7 @@ impl ObjectImpl for TtToJson { value: &glib::Value, pspec: &glib::ParamSpec, ) { - match pspec.get_name() { + match pspec.name() { "mode" => { let mut settings = self.settings.lock().unwrap(); settings.mode = value @@ -265,7 +265,7 @@ impl ObjectImpl for TtToJson { } fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { - match pspec.get_name() { + match pspec.name() { "mode" => { let settings = self.settings.lock().unwrap(); settings.mode.to_value() diff --git a/video/closedcaption/tests/ccdetect.rs b/video/closedcaption/tests/ccdetect.rs index 9935e869c..8a2834725 100644 --- a/video/closedcaption/tests/ccdetect.rs +++ b/video/closedcaption/tests/ccdetect.rs @@ -70,14 +70,14 @@ fn test_have_cc_data_notify() { let mut h = gst_check::Harness::new("ccdetect"); h.set_src_caps_str("closedcaption/x-cea-708,format=cc_data"); h.set_sink_caps_str("closedcaption/x-cea-708,format=cc_data"); - h.get_element() + h.element() .unwrap() .set_property("window", &(500_000_000u64)) .unwrap(); let state = Arc::new(Mutex::new(NotifyState::default())); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc608"), move |o, _pspec| { let mut state_guard = state_c.lock().unwrap(); @@ -85,7 +85,7 @@ fn test_have_cc_data_notify() { o.get_property("cc608").unwrap(); }); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc708"), move |o, _pspec| { let mut state_guard = state_c.lock().unwrap(); @@ -115,21 +115,21 @@ fn test_cc_data_window() { let mut h = gst_check::Harness::new("ccdetect"); h.set_src_caps_str("closedcaption/x-cea-708,format=cc_data"); h.set_sink_caps_str("closedcaption/x-cea-708,format=cc_data"); - h.get_element() + h.element() .unwrap() .set_property("window", &500_000_000u64) .unwrap(); let state = Arc::new(Mutex::new(NotifyState::default())); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc608"), move |_o, _pspec| { let mut state_guard = state_c.lock().unwrap(); state_guard.cc608_count += 1; }); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc708"), move |_o, _pspec| { let mut state_guard = state_c.lock().unwrap(); @@ -193,21 +193,21 @@ fn test_have_cdp_notify() { let mut h = gst_check::Harness::new("ccdetect"); h.set_src_caps_str("closedcaption/x-cea-708,format=cdp"); h.set_sink_caps_str("closedcaption/x-cea-708,format=cdp"); - h.get_element() + h.element() .unwrap() .set_property("window", &500_000_000u64) .unwrap(); let state = Arc::new(Mutex::new(NotifyState::default())); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc608"), move |_o, _pspec| { let mut state_guard = state_c.lock().unwrap(); state_guard.cc608_count += 1; }); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc708"), move |_o, _pspec| { let mut state_guard = state_c.lock().unwrap(); @@ -257,21 +257,18 @@ fn test_malformed_cdp_notify() { let mut h = gst_check::Harness::new("ccdetect"); h.set_src_caps_str("closedcaption/x-cea-708,format=cdp"); h.set_sink_caps_str("closedcaption/x-cea-708,format=cdp"); - h.get_element() - .unwrap() - .set_property("window", &0u64) - .unwrap(); + h.element().unwrap().set_property("window", &0u64).unwrap(); let state = Arc::new(Mutex::new(NotifyState::default())); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc608"), move |_o, _pspec| { let mut state_guard = state_c.lock().unwrap(); state_guard.cc608_count += 1; }); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc708"), move |_o, _pspec| { let mut state_guard = state_c.lock().unwrap(); @@ -297,21 +294,21 @@ fn test_gap_events() { let mut h = gst_check::Harness::new("ccdetect"); h.set_src_caps_str("closedcaption/x-cea-708,format=cc_data"); h.set_sink_caps_str("closedcaption/x-cea-708,format=cc_data"); - h.get_element() + h.element() .unwrap() .set_property("window", &500_000_000u64) .unwrap(); let state = Arc::new(Mutex::new(NotifyState::default())); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc608"), move |_o, _pspec| { let mut state_guard = state_c.lock().unwrap(); state_guard.cc608_count += 1; }); let state_c = state.clone(); - h.get_element() + h.element() .unwrap() .connect_notify(Some("cc708"), move |_o, _pspec| { let mut state_guard = state_c.lock().unwrap(); diff --git a/video/closedcaption/tests/cea608tott.rs b/video/closedcaption/tests/cea608tott.rs index dc8916669..ecdf59255 100644 --- a/video/closedcaption/tests/cea608tott.rs +++ b/video/closedcaption/tests/cea608tott.rs @@ -68,10 +68,10 @@ fn test_parse() { for (i, e) in expected.iter().enumerate() { let buf = h.try_pull().unwrap(); - assert_eq!(e.0, buf.get_pts(), "Unexpected PTS for {}th buffer", i + 1); + assert_eq!(e.0, buf.pts(), "Unexpected PTS for {}th buffer", i + 1); assert_eq!( e.1, - buf.get_duration(), + buf.duration(), "Unexpected duration for {}th buffer", i + 1 ); @@ -83,9 +83,9 @@ fn test_parse() { } let caps = h - .get_sinkpad() + .sinkpad() .expect("harness has no sinkpad") - .get_current_caps() + .current_caps() .expect("pad has no caps"); assert_eq!( caps, diff --git a/video/closedcaption/tests/mcc_enc.rs b/video/closedcaption/tests/mcc_enc.rs index 1244bacfa..4ce03d9c5 100644 --- a/video/closedcaption/tests/mcc_enc.rs +++ b/video/closedcaption/tests/mcc_enc.rs @@ -91,7 +91,7 @@ Time Code Rate=30DF\r\n\ let mut h = gst_check::Harness::new("mccenc"); { - let enc = h.get_element().expect("could not create encoder"); + let enc = h.element().expect("could not create encoder"); enc.set_property("uuid", &"14720C04-857D-40E2-86FC-F080DE44CE74") .unwrap(); enc.set_property( @@ -132,10 +132,10 @@ Time Code Rate=30DF\r\n\ let timecode = buf .get_meta::<gst_video::VideoTimeCodeMeta>() .expect("No timecode for buffer") - .get_tc(); + .tc(); assert_eq!(timecode, tc); - let pts = buf.get_pts(); + let pts = buf.pts(); assert_eq!(pts, gst::ClockTime::from_seconds(0)); let map = buf.map_readable().expect("Couldn't map buffer readable"); diff --git a/video/closedcaption/tests/mcc_parse.rs b/video/closedcaption/tests/mcc_parse.rs index 33db94f4f..40efde05e 100644 --- a/video/closedcaption/tests/mcc_parse.rs +++ b/video/closedcaption/tests/mcc_parse.rs @@ -64,10 +64,10 @@ fn test_parse() { rnd.gen_range(1..=data.len()) }; let buf = gst::Buffer::from_mut_slice(Vec::from(&data[0..l])); - input_len += buf.get_size(); + input_len += buf.size(); assert_eq!(h.push(buf), Ok(gst::FlowSuccess::Ok)); while let Some(buf) = h.try_pull() { - output_len += buf.get_size(); + output_len += buf.size(); checksum = checksum.wrapping_add( buf.map_readable() .unwrap() @@ -79,9 +79,9 @@ fn test_parse() { .get_meta::<gst_video::VideoTimeCodeMeta>() .expect("No timecode meta"); if let Some(ref timecode) = expected_timecode { - assert_eq!(&tc_meta.get_tc(), timecode); + assert_eq!(&tc_meta.tc(), timecode); } else { - expected_timecode = Some(tc_meta.get_tc()); + expected_timecode = Some(tc_meta.tc()); } if let Some(ref mut tc) = expected_timecode { tc.increment_frame(); @@ -92,7 +92,7 @@ fn test_parse() { h.push_event(gst::event::Eos::new()); while let Some(buf) = h.try_pull() { - output_len += buf.get_size(); + output_len += buf.size(); checksum = checksum.wrapping_add( buf.map_readable() .unwrap() @@ -104,9 +104,9 @@ fn test_parse() { .get_meta::<gst_video::VideoTimeCodeMeta>() .expect("No timecode meta"); if let Some(ref timecode) = expected_timecode { - assert_eq!(&tc_meta.get_tc(), timecode); + assert_eq!(&tc_meta.tc(), timecode); } else { - expected_timecode = Some(tc_meta.get_tc()); + expected_timecode = Some(tc_meta.tc()); } if let Some(ref mut tc) = expected_timecode { tc.increment_frame(); @@ -119,9 +119,9 @@ fn test_parse() { assert_eq!(checksum, 3_988_480); let caps = h - .get_sinkpad() + .sinkpad() .expect("harness has no sinkpad") - .get_current_caps() + .current_caps() .expect("pad has no caps"); assert_eq!( caps, @@ -185,7 +185,7 @@ fn test_pull() { while h.buffers_in_queue() != 0 { if let Ok(buffer) = h.pull() { - let pts = buffer.get_pts(); + let pts = buffer.pts(); assert!(pts > gst::SECOND && pts < 2 * gst::SECOND); } } diff --git a/video/closedcaption/tests/scc_enc.rs b/video/closedcaption/tests/scc_enc.rs index ee7e47caa..17c25256c 100644 --- a/video/closedcaption/tests/scc_enc.rs +++ b/video/closedcaption/tests/scc_enc.rs @@ -66,10 +66,10 @@ fn test_encode_single_packet() { let timecode = buf .get_meta::<gst_video::VideoTimeCodeMeta>() .expect("No timecode for buffer") - .get_tc(); + .tc(); assert_eq!(timecode, tc); - let pts = buf.get_pts(); + let pts = buf.pts(); assert_eq!(pts, gst::ClockTime::from_seconds(0)); let map = buf.map_readable().expect("Couldn't map buffer readable"); @@ -165,10 +165,10 @@ fn test_encode_multiple_packets() { let timecode = buf .get_meta::<gst_video::VideoTimeCodeMeta>() .expect("No timecode for buffer") - .get_tc(); + .tc(); assert_eq!(timecode, tc1); - let pts = buf.get_pts(); + let pts = buf.pts(); assert_eq!(pts, gst::ClockTime::from_seconds(0)); let map = buf.map_readable().expect("Couldn't map buffer readable"); @@ -183,7 +183,7 @@ fn test_encode_multiple_packets() { let timecode = buf .get_meta::<gst_video::VideoTimeCodeMeta>() .expect("No timecode for buffer") - .get_tc(); + .tc(); assert_eq!(timecode, tc2); // let pts = buf.get_pts(); @@ -212,7 +212,7 @@ fn test_encode_multiple_packets() { let timecode = buf .get_meta::<gst_video::VideoTimeCodeMeta>() .expect("No timecode for buffer") - .get_tc(); + .tc(); assert_eq!(timecode, tc3); // let pts = buf.get_pts(); diff --git a/video/closedcaption/tests/scc_parse.rs b/video/closedcaption/tests/scc_parse.rs index 464f9afa1..781a414ed 100644 --- a/video/closedcaption/tests/scc_parse.rs +++ b/video/closedcaption/tests/scc_parse.rs @@ -65,10 +65,10 @@ fn test_parse() { rnd.gen_range(1..=data.len()) }; let buf = gst::Buffer::from_mut_slice(Vec::from(&data[0..l])); - input_len += buf.get_size(); + input_len += buf.size(); assert_eq!(h.push(buf), Ok(gst::FlowSuccess::Ok)); while let Some(buf) = h.try_pull() { - output_len += buf.get_size(); + output_len += buf.size(); checksum = checksum.wrapping_add( buf.map_readable() .unwrap() @@ -81,7 +81,7 @@ fn test_parse() { h.push_event(gst::event::Eos::new()); while let Some(buf) = h.try_pull() { - output_len += buf.get_size(); + output_len += buf.size(); checksum = checksum.wrapping_add( buf.map_readable() .unwrap() @@ -95,9 +95,9 @@ fn test_parse() { assert_eq!(checksum, 12_554_799); let caps = h - .get_sinkpad() + .sinkpad() .expect("harness has no sinkpad") - .get_current_caps() + .current_caps() .expect("pad has no caps"); assert_eq!( caps, @@ -160,7 +160,7 @@ fn test_timecodes() { let buf = gst::Buffer::from_mut_slice(Vec::from(data)); assert_eq!(h.push(buf), Ok(gst::FlowSuccess::Ok)); while let Some(buf) = h.try_pull() { - output_len += buf.get_size(); + output_len += buf.size(); checksum = checksum.wrapping_add( buf.map_readable() .unwrap() @@ -172,7 +172,7 @@ fn test_timecodes() { let tc = buf .get_meta::<gst_video::VideoTimeCodeMeta>() .expect("No timecode meta") - .get_tc(); + .tc(); // if the timecode matches one of expected codes, // pop the valid_timecodes deque and set expected_timecode, @@ -189,9 +189,9 @@ fn test_timecodes() { assert_eq!(checksum, 174_295); let caps = h - .get_sinkpad() + .sinkpad() .expect("harness has no sinkpad") - .get_current_caps() + .current_caps() .expect("pad has no caps"); assert_eq!( caps, @@ -255,8 +255,8 @@ fn test_pull() { while h.buffers_in_queue() != 0 { if let Ok(buffer) = h.pull() { - let pts = buffer.get_pts(); - let end_time = pts + buffer.get_duration(); + let pts = buffer.pts(); + let end_time = pts + buffer.duration(); assert!(end_time >= 18 * gst::SECOND && pts < 19 * gst::SECOND); } diff --git a/video/closedcaption/tests/tttocea608.rs b/video/closedcaption/tests/tttocea608.rs index 658c77cb4..0ed5d994a 100644 --- a/video/closedcaption/tests/tttocea608.rs +++ b/video/closedcaption/tests/tttocea608.rs @@ -69,7 +69,7 @@ fn test_one_timed_buffer_and_eos() { loop { let outbuf = h.pull().unwrap(); - if outbuf.get_pts() + outbuf.get_duration() >= gst::SECOND { + if outbuf.pts() + outbuf.duration() >= gst::SECOND { break; } @@ -90,15 +90,10 @@ fn test_one_timed_buffer_and_eos() { for (i, e) in expected.iter().enumerate() { let outbuf = h.try_pull().unwrap(); - assert_eq!( - e.0, - outbuf.get_pts(), - "Unexpected PTS for {}th buffer", - i + 1 - ); + assert_eq!(e.0, outbuf.pts(), "Unexpected PTS for {}th buffer", i + 1); assert_eq!( e.1, - outbuf.get_duration(), + outbuf.duration(), "Unexpected duration for {}th buffer", i + 1 ); @@ -115,7 +110,7 @@ fn test_one_timed_buffer_and_eos() { loop { let outbuf = h.try_pull().unwrap(); let data = outbuf.map_readable().unwrap(); - if outbuf.get_pts() == 2_200_000_000.into() { + if outbuf.pts() == 2_200_000_000.into() { assert_eq!(&*data, &[0x94, 0x2c]); break; } else { @@ -126,7 +121,7 @@ fn test_one_timed_buffer_and_eos() { assert_eq!(h.events_in_queue() == 1, true); let event = h.pull_event().unwrap(); - assert_eq!(event.get_type(), gst::EventType::Eos); + assert_eq!(event.type_(), gst::EventType::Eos); } /* Here we test that the erase_display_memory control code @@ -155,7 +150,7 @@ fn test_erase_display_memory_non_spliced() { while h.buffers_in_queue() > 0 { let outbuf = h.pull().unwrap(); - if outbuf.get_pts() == 2_200_000_000.into() { + if outbuf.pts() == 2_200_000_000.into() { let data = outbuf.map_readable().unwrap(); assert_eq!(&*data, &[0x94, 0x2c]); erase_display_buffers += 1; @@ -193,15 +188,15 @@ fn test_erase_display_memory_spliced() { let outbuf = h.pull().unwrap(); /* Check that our timestamps are strictly ascending */ - assert!(outbuf.get_pts() >= prev_pts); + assert!(outbuf.pts() >= prev_pts); - if outbuf.get_pts() == 2_000_000_000.into() { + if outbuf.pts() == 2_000_000_000.into() { let data = outbuf.map_readable().unwrap(); assert_eq!(&*data, &[0x94, 0x2c]); erase_display_buffers += 1; } - prev_pts = outbuf.get_pts(); + prev_pts = outbuf.pts(); } assert_eq!(erase_display_buffers, 1); @@ -232,7 +227,7 @@ fn test_output_gaps() { /* Padding */ loop { let outbuf = h.pull().unwrap(); - if outbuf.get_pts() + outbuf.get_duration() >= gst::SECOND { + if outbuf.pts() + outbuf.duration() >= gst::SECOND { break; } @@ -243,7 +238,7 @@ fn test_output_gaps() { /* Hello */ loop { let outbuf = h.pull().unwrap(); - if outbuf.get_pts() + outbuf.get_duration() >= 1_233_333_333.into() { + if outbuf.pts() + outbuf.duration() >= 1_233_333_333.into() { break; } @@ -254,12 +249,12 @@ fn test_output_gaps() { /* Padding */ loop { let outbuf = h.pull().unwrap(); - if outbuf.get_pts() + outbuf.get_duration() >= 3_000_000_000.into() { + if outbuf.pts() + outbuf.duration() >= 3_000_000_000.into() { break; } let data = outbuf.map_readable().unwrap(); - if outbuf.get_pts() == 2_200_000_000.into() { + if outbuf.pts() == 2_200_000_000.into() { /* Erase display one second after Hello */ assert_eq!(&*data, &[0x94, 0x2C]); } else { @@ -270,7 +265,7 @@ fn test_output_gaps() { /* World */ loop { let outbuf = h.pull().unwrap(); - if outbuf.get_pts() + outbuf.get_duration() >= 3_233_333_333.into() { + if outbuf.pts() + outbuf.duration() >= 3_233_333_333.into() { break; } @@ -281,7 +276,7 @@ fn test_output_gaps() { assert_eq!(h.events_in_queue(), 1); let event = h.pull_event().unwrap(); - assert_eq!(event.get_type(), gst::EventType::Eos); + assert_eq!(event.type_(), gst::EventType::Eos); } #[test] @@ -304,7 +299,7 @@ fn test_one_timed_buffer_and_eos_roll_up2() { /* Padding */ loop { let outbuf = h.pull().unwrap(); - if outbuf.get_pts() + outbuf.get_duration() >= gst::SECOND { + if outbuf.pts() + outbuf.duration() >= gst::SECOND { break; } @@ -323,15 +318,10 @@ fn test_one_timed_buffer_and_eos_roll_up2() { for (i, e) in expected.iter().enumerate() { let outbuf = h.try_pull().unwrap(); - assert_eq!( - e.0, - outbuf.get_pts(), - "Unexpected PTS for {}th buffer", - i + 1 - ); + assert_eq!(e.0, outbuf.pts(), "Unexpected PTS for {}th buffer", i + 1); assert_eq!( e.1, - outbuf.get_duration(), + outbuf.duration(), "Unexpected duration for {}th buffer", i + 1 ); @@ -343,7 +333,7 @@ fn test_one_timed_buffer_and_eos_roll_up2() { /* Padding */ loop { let outbuf = h.pull().unwrap(); - if outbuf.get_pts() + outbuf.get_duration() >= 2 * gst::SECOND { + if outbuf.pts() + outbuf.duration() >= 2 * gst::SECOND { break; } @@ -360,15 +350,10 @@ fn test_one_timed_buffer_and_eos_roll_up2() { for (i, e) in expected.iter().enumerate() { let outbuf = h.try_pull().unwrap(); - assert_eq!( - e.0, - outbuf.get_pts(), - "Unexpected PTS for {}th buffer", - i + 1 - ); + assert_eq!(e.0, outbuf.pts(), "Unexpected PTS for {}th buffer", i + 1); assert_eq!( e.1, - outbuf.get_duration(), + outbuf.duration(), "Unexpected duration for {}th buffer", i + 1 ); @@ -384,5 +369,5 @@ fn test_one_timed_buffer_and_eos_roll_up2() { assert_eq!(h.events_in_queue(), 1); let event = h.pull_event().unwrap(); - assert_eq!(event.get_type(), gst::EventType::Eos); + assert_eq!(event.type_(), gst::EventType::Eos); } |