Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorFrançois Laignel <fengalin@free.fr>2021-04-12 15:49:54 +0300
committerFrançois Laignel <fengalin@free.fr>2021-04-12 16:57:19 +0300
commit06accc8d98cc2876bcacfc6f9e097af690b4e64f (patch)
treee4f056143e5257d49b367dd28ef5fecaa1df9ebc /video
parentc3fb55f235f7feb1ab737a64f8d3d53d03a81c7a (diff)
fix-getters-{def,calls} pass
Diffstat (limited to 'video')
-rw-r--r--video/cdg/src/cdgdec/imp.rs14
-rw-r--r--video/cdg/src/cdgparse/imp.rs16
-rw-r--r--video/cdg/src/typefind.rs2
-rw-r--r--video/cdg/tests/cdgdec.rs10
-rw-r--r--video/closedcaption/src/ccdetect/imp.rs8
-rw-r--r--video/closedcaption/src/cea608overlay/imp.rs28
-rw-r--r--video/closedcaption/src/cea608tojson/imp.rs4
-rw-r--r--video/closedcaption/src/cea608tott/imp.rs12
-rw-r--r--video/closedcaption/src/line_reader.rs68
-rw-r--r--video/closedcaption/src/mcc_enc/imp.rs28
-rw-r--r--video/closedcaption/src/mcc_parse/imp.rs18
-rw-r--r--video/closedcaption/src/mcc_parse/parser.rs2
-rw-r--r--video/closedcaption/src/scc_enc/imp.rs14
-rw-r--r--video/closedcaption/src/scc_parse/imp.rs20
-rw-r--r--video/closedcaption/src/scc_parse/parser.rs2
-rw-r--r--video/closedcaption/src/tttocea608/imp.rs16
-rw-r--r--video/closedcaption/src/tttojson/imp.rs8
-rw-r--r--video/closedcaption/tests/ccdetect.rs33
-rw-r--r--video/closedcaption/tests/cea608tott.rs8
-rw-r--r--video/closedcaption/tests/mcc_enc.rs6
-rw-r--r--video/closedcaption/tests/mcc_parse.rs20
-rw-r--r--video/closedcaption/tests/scc_enc.rs12
-rw-r--r--video/closedcaption/tests/scc_parse.rs22
-rw-r--r--video/closedcaption/tests/tttocea608.rs59
-rw-r--r--video/dav1d/src/dav1ddec/imp.rs32
-rw-r--r--video/flavors/src/flvdemux/imp.rs18
-rw-r--r--video/gif/examples/testvideosrc2gif.rs8
-rw-r--r--video/gif/src/gifenc/imp.rs18
-rw-r--r--video/gif/tests/gifenc.rs2
-rw-r--r--video/hsv/src/hsvdetector/imp.rs4
-rw-r--r--video/hsv/src/hsvfilter/imp.rs4
-rw-r--r--video/rav1e/src/rav1enc/imp.rs18
-rw-r--r--video/rav1e/tests/rav1enc.rs4
-rw-r--r--video/rspng/examples/pngenc.rs8
-rw-r--r--video/rspng/src/pngenc/imp.rs12
-rw-r--r--video/rspng/tests/pngenc.rs2
-rw-r--r--video/webp/src/dec/imp.rs12
-rw-r--r--video/webp/tests/webpdec.rs8
38 files changed, 277 insertions, 303 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,
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);
}
diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs
index af75b0a6b..2e92d1d16 100644
--- a/video/dav1d/src/dav1ddec/imp.rs
+++ b/video/dav1d/src/dav1ddec/imp.rs
@@ -118,10 +118,10 @@ impl Dav1dDec {
element.set_output_state(format, pic.width(), pic.height(), input_state)
}?;
element.negotiate(output_state)?;
- let out_state = element.get_output_state().unwrap();
+ let out_state = element.output_state().unwrap();
{
let mut negotiation_infos = self.negotiation_infos.lock().unwrap();
- negotiation_infos.output_info = Some(out_state.get_info());
+ negotiation_infos.output_info = Some(out_state.info());
}
Ok(())
@@ -138,16 +138,16 @@ impl Dav1dDec {
frame: &gst_video::VideoCodecFrame,
) -> Result<Vec<(dav1d::Picture, gst_video::VideoFormat)>, gst::FlowError> {
let mut decoder = self.decoder.lock().unwrap();
- let timestamp = match frame.get_dts().0 {
+ let timestamp = match frame.dts().0 {
Some(ts) => Some(ts as i64),
None => None,
};
- let duration = match frame.get_duration().0 {
+ let duration = match frame.duration().0 {
Some(d) => Some(d as i64),
None => None,
};
- let frame_number = Some(frame.get_system_frame_number() as i64);
+ let frame_number = Some(frame.system_frame_number() as i64);
let input_data = input_buffer
.map_readable()
.map_err(|_| gst::FlowError::Error)?;
@@ -181,7 +181,7 @@ impl Dav1dDec {
let video_meta_supported = self.negotiation_infos.lock().unwrap().video_meta_supported;
- let info = output_state.get_info();
+ let info = output_state.info();
let mut out_buffer = gst::Buffer::new();
let mut_buffer = out_buffer.get_mut().unwrap();
@@ -222,7 +222,7 @@ impl Dav1dDec {
}
writable_mem.into_memory()
};
- let mem_size = mem.get_size();
+ let mem_size = mem.size();
mut_buffer.append_memory(mem);
strides.push(src_stride as i32);
@@ -262,7 +262,7 @@ impl Dav1dDec {
self.handle_resolution_change(element, &pic, format)?;
let output_state = element
- .get_output_state()
+ .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) {
@@ -278,18 +278,18 @@ 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);
}
}
- fn get_pending_pictures(
+ fn pending_pictures(
&self,
) -> Result<Vec<(dav1d::Picture, gst_video::VideoFormat)>, 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);
@@ -303,7 +303,7 @@ impl Dav1dDec {
&self,
element: &super::Dav1dDec,
) -> Result<gst::FlowSuccess, gst::FlowError> {
- for (pic, format) in self.get_pending_pictures()? {
+ for (pic, format) in self.pending_pictures()? {
self.handle_picture(element, &pic, format)?;
}
Ok(gst::FlowSuccess::Ok)
@@ -438,9 +438,7 @@ impl VideoDecoderImpl for Dav1dDec {
element: &Self::Type,
frame: gst_video::VideoCodecFrame,
) -> Result<gst::FlowSuccess, gst::FlowError> {
- let input_buffer = frame
- .get_input_buffer()
- .expect("frame without input buffer");
+ let input_buffer = frame.input_buffer().expect("frame without input buffer");
for (pic, format) in self.decode(input_buffer, &frame)? {
self.handle_picture(element, &pic, format)?;
}
@@ -479,9 +477,9 @@ impl VideoDecoderImpl for Dav1dDec {
.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/flavors/src/flvdemux/imp.rs b/video/flavors/src/flvdemux/imp.rs
index 662217af6..5e4c351b1 100644
--- a/video/flavors/src/flvdemux/imp.rs
+++ b/video/flavors/src/flvdemux/imp.rs
@@ -405,9 +405,9 @@ impl FlvDemux {
match query.view_mut() {
QueryView::Position(ref mut q) => {
- let fmt = q.get_format();
+ let fmt = q.format();
if fmt == gst::Format::Time {
- if self.sinkpad.peer_query(q.get_mut_query()) {
+ if self.sinkpad.peer_query(q.query_mut()) {
return true;
}
@@ -424,9 +424,9 @@ impl FlvDemux {
}
}
QueryView::Duration(ref mut q) => {
- let fmt = q.get_format();
+ let fmt = q.format();
if fmt == gst::Format::Time {
- if self.sinkpad.peer_query(q.get_mut_query()) {
+ if self.sinkpad.peer_query(q.query_mut()) {
return true;
}
@@ -637,7 +637,7 @@ impl FlvDemux {
}
fn create_srcpad(&self, element: &super::FlvDemux, name: &str, caps: &gst::Caps) -> gst::Pad {
- let templ = element.get_element_class().get_pad_template(name).unwrap();
+ let templ = element.element_class().get_pad_template(name).unwrap();
let srcpad = gst::Pad::builder_with_template(&templ, Some(name))
.event_function(|pad, parent, event| {
FlvDemux::catch_panic_pad_function(
@@ -1196,11 +1196,11 @@ impl StreamingState {
}
fn update_position(&mut self, buffer: &gst::Buffer) {
- if buffer.get_pts().is_some() {
- let pts = buffer.get_pts();
+ if buffer.pts().is_some() {
+ let pts = buffer.pts();
self.last_position = self.last_position.max(pts).unwrap_or(pts);
- } else if buffer.get_dts().is_some() {
- let dts = buffer.get_dts();
+ } else if buffer.dts().is_some() {
+ let dts = buffer.dts();
self.last_position = self.last_position.max(dts).unwrap_or(dts);
}
}
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))
}
}
diff --git a/video/hsv/src/hsvdetector/imp.rs b/video/hsv/src/hsvdetector/imp.rs
index 805765d69..15b0b1301 100644
--- a/video/hsv/src/hsvdetector/imp.rs
+++ b/video/hsv/src/hsvdetector/imp.rs
@@ -153,7 +153,7 @@ impl ObjectImpl for HsvDetector {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"hue-ref" => {
let mut settings = self.settings.lock().unwrap();
let hue_ref = value.get_some().expect("type checked upstream");
@@ -233,7 +233,7 @@ impl ObjectImpl for HsvDetector {
// Called whenever a value of a property is read. It can be called
// at any time from any thread.
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"hue-ref" => {
let settings = self.settings.lock().unwrap();
settings.hue_ref.to_value()
diff --git a/video/hsv/src/hsvfilter/imp.rs b/video/hsv/src/hsvfilter/imp.rs
index 8759f8213..fe7fd3226 100644
--- a/video/hsv/src/hsvfilter/imp.rs
+++ b/video/hsv/src/hsvfilter/imp.rs
@@ -139,7 +139,7 @@ impl ObjectImpl for HsvFilter {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"hue-shift" => {
let mut settings = self.settings.lock().unwrap();
let hue_shift = value.get_some().expect("type checked upstream");
@@ -207,7 +207,7 @@ impl ObjectImpl for HsvFilter {
// Called whenever a value of a property is read. It can be called
// at any time from any thread.
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"hue-shift" => {
let settings = self.settings.lock().unwrap();
settings.hue_shift.to_value()
diff --git a/video/rav1e/src/rav1enc/imp.rs b/video/rav1e/src/rav1enc/imp.rs
index e1a639c49..8af990ca6 100644
--- a/video/rav1e/src/rav1enc/imp.rs
+++ b/video/rav1e/src/rav1enc/imp.rs
@@ -316,7 +316,7 @@ impl ObjectImpl for Rav1Enc {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"speed-preset" => {
let mut settings = self.settings.lock().unwrap();
settings.speed_preset = value.get_some().expect("type checked upstream");
@@ -365,7 +365,7 @@ impl ObjectImpl for Rav1Enc {
}
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"speed-preset" => {
let settings = self.settings.lock().unwrap();
settings.speed_preset.to_value()
@@ -497,7 +497,7 @@ impl VideoEncoderImpl for Rav1Enc {
self.finish(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);
let settings = self.settings.lock().unwrap();
@@ -680,12 +680,10 @@ impl VideoEncoderImpl for Rav1Enc {
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(&*input_buffer, &state.video_info)
@@ -699,9 +697,9 @@ impl VideoEncoderImpl for Rav1Enc {
})?;
match state.context.send_frame(
- Some((frame.get_system_frame_number(), &in_frame)),
+ Some((frame.system_frame_number(), &in_frame)),
frame
- .get_flags()
+ .flags()
.contains(gst_video::VideoCodecFrameFlags::FORCE_KEYFRAME),
) {
Ok(_) => {
@@ -709,7 +707,7 @@ impl VideoEncoderImpl for Rav1Enc {
CAT,
obj: element,
"Sent frame {}",
- frame.get_system_frame_number()
+ frame.system_frame_number()
);
}
Err(data::EncoderStatus::Failure) => {
diff --git a/video/rav1e/tests/rav1enc.rs b/video/rav1e/tests/rav1enc.rs
index 40e456ad7..4e65e59cb 100644
--- a/video/rav1e/tests/rav1enc.rs
+++ b/video/rav1e/tests/rav1enc.rs
@@ -120,7 +120,7 @@ fn test_encode_i444_12() {
fn test_encode(video_info: &gst_video::VideoInfo) {
let mut h = gst_check::Harness::new("rav1enc");
{
- let rav1enc = h.get_element().unwrap();
+ let rav1enc = h.element().unwrap();
rav1enc.set_property("speed-preset", &10u32).unwrap();
}
h.play();
@@ -180,7 +180,7 @@ fn test_encode(video_info: &gst_video::VideoInfo) {
for i in 0..5 {
let buffer = h.pull().unwrap();
if i == 0 {
- assert!(!buffer.get_flags().contains(gst::BufferFlags::DELTA_UNIT))
+ assert!(!buffer.flags().contains(gst::BufferFlags::DELTA_UNIT))
}
}
}
diff --git a/video/rspng/examples/pngenc.rs b/video/rspng/examples/pngenc.rs
index 23deb8b25..09fd4819c 100644
--- a/video/rspng/examples/pngenc.rs
+++ b/video/rspng/examples/pngenc.rs
@@ -16,7 +16,7 @@ fn main() {
gstrspng::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)
@@ -30,9 +30,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/rspng/src/pngenc/imp.rs b/video/rspng/src/pngenc/imp.rs
index 9d90d65ab..1e8f213a2 100644
--- a/video/rspng/src/pngenc/imp.rs
+++ b/video/rspng/src/pngenc/imp.rs
@@ -205,7 +205,7 @@ impl ObjectImpl for PngEncoder {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"compression-level" => {
let mut settings = self.settings.lock();
settings.compression = value
@@ -223,7 +223,7 @@ impl ObjectImpl for PngEncoder {
}
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"compression-level" => {
let settings = self.settings.lock();
settings.compression.to_value()
@@ -311,7 +311,7 @@ impl VideoEncoderImpl for PngEncoder {
element: &Self::Type,
state: &gst_video::VideoCodecState<'static, gst_video::video_codec_state::Readable>,
) -> Result<(), gst::LoggableError> {
- let video_info = state.get_info();
+ let video_info = state.info();
gst_debug!(CAT, obj: element, "Setting format {:?}", video_info);
{
let settings = self.settings.lock();
@@ -340,12 +340,10 @@ impl VideoEncoderImpl for PngEncoder {
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 input_map = input_buffer.map_readable().unwrap();
let data = input_map.as_slice();
diff --git a/video/rspng/tests/pngenc.rs b/video/rspng/tests/pngenc.rs
index 4668633c1..55c87e7a7 100644
--- a/video/rspng/tests/pngenc.rs
+++ b/video/rspng/tests/pngenc.rs
@@ -85,6 +85,6 @@ fn test_png_encode(video_info: &gst_video::VideoInfo) {
(0..5).for_each(|_| {
let buffer = h.pull().unwrap();
- assert!(!buffer.get_flags().contains(gst::BufferFlags::DELTA_UNIT))
+ assert!(!buffer.flags().contains(gst::BufferFlags::DELTA_UNIT))
});
}
diff --git a/video/webp/src/dec/imp.rs b/video/webp/src/dec/imp.rs
index 5fe7b1d6c..a81778aac 100644
--- a/video/webp/src/dec/imp.rs
+++ b/video/webp/src/dec/imp.rs
@@ -99,7 +99,7 @@ impl<'a> Decoder<'_> {
unsafe { ffi::WebPAnimDecoderHasMoreFrames(self.decoder) != 0 }
}
- fn get_info(&self) -> Option<Info> {
+ fn info(&self) -> Option<Info> {
let mut info = std::mem::MaybeUninit::zeroed();
unsafe {
if ffi::WebPAnimDecoderGetInfo(self.decoder, info.as_mut_ptr()) == 0 {
@@ -114,12 +114,12 @@ impl<'a> Decoder<'_> {
}
}
- fn get_next(&mut self) -> Option<Frame> {
+ fn next(&mut self) -> Option<Frame> {
let mut buf = std::ptr::null_mut();
let buf_ptr: *mut *mut u8 = &mut buf;
let mut timestamp: i32 = 0;
- if let Some(info) = self.get_info() {
+ if let Some(info) = self.info() {
unsafe {
if ffi::WebPAnimDecoderGetNext(self.decoder, buf_ptr, &mut timestamp) == 0 {
return None;
@@ -162,7 +162,7 @@ impl WebPDec {
let mut state = self.state.lock().unwrap();
- state.total_size += buffer.get_size();
+ state.total_size += buffer.size();
state.buffers.push(buffer);
Ok(gst::FlowSuccess::Ok)
@@ -191,7 +191,7 @@ impl WebPDec {
gst::error_msg!(gst::StreamError::Decode, ["Failed to decode picture"])
})?;
- let info = decoder.get_info().ok_or_else(|| {
+ let info = decoder.info().ok_or_else(|| {
gst::error_msg!(gst::StreamError::Decode, ["Failed to get animation info"])
})?;
@@ -219,7 +219,7 @@ impl WebPDec {
let _ = self.srcpad.push_event(gst::event::Segment::new(&segment));
while decoder.has_more_frames() {
- let frame = decoder.get_next().ok_or_else(|| {
+ let frame = decoder.next().ok_or_else(|| {
gst::error_msg!(gst::StreamError::Decode, ["Failed to get next frame"])
})?;
diff --git a/video/webp/tests/webpdec.rs b/video/webp/tests/webpdec.rs
index cdf51ab77..24edec9c4 100644
--- a/video/webp/tests/webpdec.rs
+++ b/video/webp/tests/webpdec.rs
@@ -45,8 +45,8 @@ fn test_decode() {
let expected_duration: gst::ClockTime = 40_000_000.into();
while let Some(buf) = h.try_pull() {
- assert_eq!(buf.get_pts(), expected_timestamp);
- assert_eq!(buf.get_duration(), expected_duration);
+ assert_eq!(buf.pts(), expected_timestamp);
+ assert_eq!(buf.duration(), expected_duration);
expected_timestamp += expected_duration;
count += 1;
@@ -55,9 +55,9 @@ fn test_decode() {
assert_eq!(count, 10);
let caps = h
- .get_sinkpad()
+ .sinkpad()
.expect("harness has no sinkpad")
- .get_current_caps()
+ .current_caps()
.expect("pad has no caps");
assert_eq!(
caps,