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/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/audiofx/src/audioecho/imp.rs4
-rw-r--r--audio/audiofx/src/audioloudnorm/imp.rs14
-rw-r--r--audio/audiofx/src/audiornnoise/imp.rs10
-rw-r--r--audio/audiofx/src/ebur128level/imp.rs8
-rw-r--r--audio/audiofx/tests/audioloudnorm.rs6
-rw-r--r--audio/audiofx/tests/ebur128level.rs6
-rw-r--r--audio/claxon/tests/claxondec.rs6
-rw-r--r--audio/csound/examples/effect_example.rs8
-rw-r--r--audio/csound/src/filter/imp.rs26
-rw-r--r--audio/csound/tests/csound_filter.rs25
-rw-r--r--audio/lewton/tests/lewtondec.rs6
11 files changed, 58 insertions, 61 deletions
diff --git a/audio/audiofx/src/audioecho/imp.rs b/audio/audiofx/src/audioecho/imp.rs
index 5f873ec9b..565ebd55a 100644
--- a/audio/audiofx/src/audioecho/imp.rs
+++ b/audio/audiofx/src/audioecho/imp.rs
@@ -143,7 +143,7 @@ impl ObjectImpl for AudioEcho {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"max-delay" => {
let mut settings = self.settings.lock().unwrap();
if self.state.lock().unwrap().is_none() {
@@ -167,7 +167,7 @@ impl ObjectImpl for AudioEcho {
}
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"max-delay" => {
let settings = self.settings.lock().unwrap();
settings.max_delay.to_value()
diff --git a/audio/audiofx/src/audioloudnorm/imp.rs b/audio/audiofx/src/audioloudnorm/imp.rs
index 915774b92..47104a090 100644
--- a/audio/audiofx/src/audioloudnorm/imp.rs
+++ b/audio/audiofx/src/audioloudnorm/imp.rs
@@ -252,7 +252,7 @@ impl State {
let outbuf = outbuf.get_mut().unwrap();
outbuf.set_pts(pts);
outbuf.set_duration(
- (outbuf.get_size() as u64)
+ (outbuf.size() as u64)
.mul_div_floor(gst::SECOND_VAL, (self.info.bpf() * self.info.rate()) as u64)
.into(),
);
@@ -309,7 +309,7 @@ impl State {
let outbuf = outbuf.get_mut().unwrap();
outbuf.set_pts(pts);
outbuf.set_duration(
- (outbuf.get_size() as u64)
+ (outbuf.size() as u64)
.mul_div_floor(gst::SECOND_VAL, (self.info.bpf() * self.info.rate()) as u64)
.into(),
);
@@ -1560,7 +1560,7 @@ impl AudioLoudNorm {
};
let mut outbufs = vec![];
- if buffer.get_flags().contains(gst::BufferFlags::DISCONT) {
+ if buffer.flags().contains(gst::BufferFlags::DISCONT) {
gst_debug!(CAT, obj: element, "Draining on discontinuity");
match state.drain(element) {
Ok(outbuf) => {
@@ -1598,7 +1598,7 @@ impl AudioLoudNorm {
match event.view() {
EventView::Caps(c) => {
- let caps = c.get_caps();
+ let caps = c.caps();
gst_info!(CAT, obj: pad, "Got caps {:?}", caps);
let info = match gst_audio::AudioInfo::from_caps(caps) {
@@ -1687,7 +1687,7 @@ impl AudioLoudNorm {
QueryView::Latency(ref mut q) => {
let mut peer_query = gst::query::Latency::new();
if self.sinkpad.peer_query(&mut peer_query) {
- let (live, min_latency, max_latency) = peer_query.get_result();
+ let (live, min_latency, max_latency) = peer_query.result();
q.set(
live,
min_latency + 3 * gst::SECOND,
@@ -1810,7 +1810,7 @@ impl ObjectImpl for AudioLoudNorm {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"loudness-target" => {
let mut settings = self.settings.lock().unwrap();
settings.loudness_target = value.get_some().expect("type checked upstream");
@@ -1832,7 +1832,7 @@ impl ObjectImpl for AudioLoudNorm {
}
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"loudness-target" => {
let settings = self.settings.lock().unwrap();
settings.loudness_target.to_value()
diff --git a/audio/audiofx/src/audiornnoise/imp.rs b/audio/audiofx/src/audiornnoise/imp.rs
index fa7739224..1bdaa58aa 100644
--- a/audio/audiofx/src/audiornnoise/imp.rs
+++ b/audio/audiofx/src/audiornnoise/imp.rs
@@ -61,7 +61,7 @@ impl State {
gst::ClockTime(samples.mul_div_round(gst::SECOND_VAL, self.in_info.rate() as u64))
}
- fn get_current_pts(&self) -> gst::ClockTime {
+ fn current_pts(&self) -> gst::ClockTime {
// get the last seen pts and the amount of bytes
// since then
let (prev_pts, distance) = self.adapter.prev_pts();
@@ -137,7 +137,7 @@ impl AudioRNNoise {
})?;
let duration = state.buffer_duration(available as _);
- let pts = state.get_current_pts();
+ let pts = state.current_pts();
{
let ibuffer = state.adapter.take_buffer(available).unwrap();
@@ -167,7 +167,7 @@ impl AudioRNNoise {
let bpf = state.in_info.bpf() as usize;
let output_size = available - (available % (FRAME_SIZE * bpf));
let duration = state.buffer_duration(output_size as _);
- let pts = state.get_current_pts();
+ let pts = state.current_pts();
let mut buffer = gst::Buffer::with_size(output_size).map_err(|_| gst::FlowError::Error)?;
@@ -307,7 +307,7 @@ impl BaseTransformImpl for AudioRNNoise {
// if it is not the case, just notify the parent class to not generate
// an output
if let Some(buffer) = self.take_queued_buffer() {
- if buffer.get_flags() == gst::BufferFlags::DISCONT {
+ if buffer.flags() == gst::BufferFlags::DISCONT {
self.drain(element)?;
}
@@ -352,7 +352,7 @@ impl BaseTransformImpl for AudioRNNoise {
let sink_pad = element.get_static_pad("sink").expect("Sink pad not found");
let mut upstream_query = gst::query::Latency::new();
if sink_pad.peer_query(&mut upstream_query) {
- let (live, mut min, mut max) = upstream_query.get_result();
+ let (live, mut min, mut max) = upstream_query.result();
gst_debug!(
CAT,
obj: element,
diff --git a/audio/audiofx/src/ebur128level/imp.rs b/audio/audiofx/src/ebur128level/imp.rs
index f0b25b97e..65e5130d4 100644
--- a/audio/audiofx/src/ebur128level/imp.rs
+++ b/audio/audiofx/src/ebur128level/imp.rs
@@ -185,7 +185,7 @@ impl ObjectImpl for EbuR128Level {
pspec: &glib::ParamSpec,
) {
let mut settings = self.settings.lock().unwrap();
- match pspec.get_name() {
+ match pspec.name() {
"mode" => {
let mode = value.get_some().expect("type checked upstream");
gst_info!(
@@ -225,7 +225,7 @@ impl ObjectImpl for EbuR128Level {
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
let settings = self.settings.lock().unwrap();
- match pspec.get_name() {
+ match pspec.name() {
"mode" => settings.mode.to_value(),
"post-messages" => settings.post_messages.to_value(),
"interval" => settings.interval.to_value(),
@@ -432,8 +432,8 @@ impl BaseTransformImpl for EbuR128Level {
gst::FlowError::NotNegotiated
})?;
- let mut timestamp = buf.get_pts();
- let segment = element.get_segment().downcast::<gst::ClockTime>().ok();
+ let mut timestamp = buf.pts();
+ let segment = element.segment().downcast::<gst::ClockTime>().ok();
let buf = gst_audio::AudioBufferRef::from_buffer_ref_readable(&buf, &state.info).map_err(
|_| {
diff --git a/audio/audiofx/tests/audioloudnorm.rs b/audio/audiofx/tests/audioloudnorm.rs
index 05dfce8b4..3da526e5c 100644
--- a/audio/audiofx/tests/audioloudnorm.rs
+++ b/audio/audiofx/tests/audioloudnorm.rs
@@ -101,7 +101,7 @@ fn run_test(
pipeline.set_state(gst::State::Playing).unwrap();
let mut eos = false;
- let bus = pipeline.get_bus().unwrap();
+ let bus = pipeline.bus().unwrap();
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
use gst::MessageView;
match msg.view() {
@@ -131,9 +131,9 @@ fn run_test(
for sample in samples.iter() {
use std::cmp::Ordering;
- let buf = sample.get_buffer().unwrap();
+ let buf = sample.buffer().unwrap();
- let ts = buf.get_pts();
+ let ts = buf.pts();
match ts.cmp(&expected_ts) {
Ordering::Greater => {
assert!(
diff --git a/audio/audiofx/tests/ebur128level.rs b/audio/audiofx/tests/ebur128level.rs
index 2cb4f80f0..33befbd2f 100644
--- a/audio/audiofx/tests/ebur128level.rs
+++ b/audio/audiofx/tests/ebur128level.rs
@@ -104,7 +104,7 @@ fn run_test(layout: gst_audio::AudioLayout, format: gst_audio::AudioFormat) {
format.to_str()
));
let bus = gst::Bus::new();
- h.get_element().unwrap().set_bus(Some(&bus));
+ h.element().unwrap().set_bus(Some(&bus));
h.play();
// Pull all buffers until EOS
@@ -118,8 +118,8 @@ fn run_test(layout: gst_audio::AudioLayout, format: gst_audio::AudioFormat) {
while let Some(msg) = bus.pop() {
match msg.view() {
gst::MessageView::Element(msg) => {
- let s = msg.get_structure().unwrap();
- if s.get_name() == "ebur128-level" {
+ let s = msg.structure().unwrap();
+ if s.name() == "ebur128-level" {
num_msgs += 1;
let timestamp = s.get_some::<u64>("timestamp").unwrap();
let running_time = s.get_some::<u64>("running-time").unwrap();
diff --git a/audio/claxon/tests/claxondec.rs b/audio/claxon/tests/claxondec.rs
index 5a0bcc5e3..1e58df1bb 100644
--- a/audio/claxon/tests/claxondec.rs
+++ b/audio/claxon/tests/claxondec.rs
@@ -97,11 +97,11 @@ fn do_test(data: &'static [u8], packet_sizes: &[usize], decoded_samples: &[usize
continue;
}
let buffer = h.pull().unwrap();
- assert_eq!(buffer.get_size(), 4 * samples);
+ assert_eq!(buffer.size(), 4 * samples);
}
- h.get_sinkpad()
+ h.sinkpad()
.expect("harness has no sinkpad")
- .get_current_caps()
+ .current_caps()
.expect("pad has no caps")
}
diff --git a/audio/csound/examples/effect_example.rs b/audio/csound/examples/effect_example.rs
index 95285d11c..4993555a9 100644
--- a/audio/csound/examples/effect_example.rs
+++ b/audio/csound/examples/effect_example.rs
@@ -104,7 +104,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Box<dyn Error>> {
pipeline.set_state(gst::State::Playing)?;
let bus = pipeline
- .get_bus()
+ .bus()
.expect("Pipeline without bus. Shouldn't happen!");
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
@@ -115,9 +115,9 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Box<dyn Error>> {
MessageView::Error(err) => {
println!(
"Error from {:?}: {} ({:?})",
- msg.get_src().map(|s| s.get_path_string()),
- err.get_error(),
- err.get_debug()
+ msg.src().map(|s| s.path_string()),
+ err.error(),
+ err.debug()
);
break;
}
diff --git a/audio/csound/src/filter/imp.rs b/audio/csound/src/filter/imp.rs
index c50329fd1..00b384046 100644
--- a/audio/csound/src/filter/imp.rs
+++ b/audio/csound/src/filter/imp.rs
@@ -107,7 +107,7 @@ impl State {
gst::ClockTime(samples.mul_div_round(gst::SECOND_VAL, self.in_info.rate() as u64))
}
- fn get_current_pts(&self) -> gst::ClockTime {
+ fn current_pts(&self) -> gst::ClockTime {
// get the last seen pts and the amount of bytes
// since then
let (prev_pts, distance) = self.adapter.prev_pts();
@@ -128,8 +128,8 @@ impl State {
impl CsoundFilter {
fn process(&self, csound: &mut Csound, idata: &[f64], odata: &mut [f64]) -> bool {
- let spin = csound.get_spin().unwrap();
- let spout = csound.get_spout().unwrap();
+ let spin = csound.spin().unwrap();
+ let spout = csound.spout().unwrap();
let in_chunks = idata.chunks_exact(spin.len());
let out_chuncks = odata.chunks_exact_mut(spout.len());
@@ -190,8 +190,8 @@ impl CsoundFilter {
return Ok(gst::FlowSuccess::Ok);
}
- let mut spin = csound.get_spin().unwrap();
- let spout = csound.get_spout().unwrap();
+ let mut spin = csound.spin().unwrap();
+ let spout = csound.spout().unwrap();
let out_bytes =
(avail / state.in_info.channels() as usize) * state.out_info.channels() as usize;
@@ -208,7 +208,7 @@ impl CsoundFilter {
let buffer_mut = buffer.get_mut().ok_or(gst::FlowError::NotSupported)?;
- let pts = state.get_current_pts();
+ let pts = state.current_pts();
let duration = state.buffer_duration(out_bytes as _);
buffer_mut.set_pts(pts);
@@ -255,7 +255,7 @@ impl CsoundFilter {
let mut output = gst::Buffer::with_size(output_size).map_err(|_| gst::FlowError::Error)?;
let outbuf = output.get_mut().ok_or(gst::FlowError::Error)?;
- let pts = state.get_current_pts();
+ let pts = state.current_pts();
let duration = state.buffer_duration(output_size as _);
outbuf.set_pts(pts);
@@ -387,7 +387,7 @@ impl ObjectImpl for CsoundFilter {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"loop" => {
let mut settings = self.settings.lock().unwrap();
settings.loop_ = value.get_some().expect("type checked upstream");
@@ -419,7 +419,7 @@ impl ObjectImpl for CsoundFilter {
}
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"loop" => {
let settings = self.settings.lock().unwrap();
settings.loop_.to_value()
@@ -547,7 +547,7 @@ impl BaseTransformImpl for CsoundFilter {
if compiled {
let csound = self.csound.lock().unwrap();
// Use the sample rate and channels configured in the csound score
- let sr = csound.get_sample_rate() as i32;
+ let sr = csound.sample_rate() as i32;
let ichannels = csound.input_channels() as i32;
let ochannels = csound.output_channels() as i32;
for s in new_caps.make_mut().iter_mut() {
@@ -608,7 +608,7 @@ impl BaseTransformImpl for CsoundFilter {
let rate = in_info.rate();
// Check if the negotiated caps are the right ones
- if rate != out_info.rate() || rate != csound.get_sample_rate() as _ {
+ if rate != out_info.rate() || rate != csound.sample_rate() as _ {
return Err(loggable_error!(
CAT,
"Failed to negotiate caps: invalid sample rate {}",
@@ -628,7 +628,7 @@ impl BaseTransformImpl for CsoundFilter {
));
}
- let ksmps = csound.get_ksmps();
+ let ksmps = csound.ksmps();
let adapter = gst_base::UniqueAdapter::new();
@@ -651,7 +651,7 @@ impl BaseTransformImpl for CsoundFilter {
// if it is not the case, just notify the parent class to not generate
// an output
if let Some(buffer) = self.take_queued_buffer() {
- if buffer.get_flags() == gst::BufferFlags::DISCONT {
+ if buffer.flags() == gst::BufferFlags::DISCONT {
self.drain(element)?;
}
diff --git a/audio/csound/tests/csound_filter.rs b/audio/csound/tests/csound_filter.rs
index bf4d8d82a..1c0547632 100644
--- a/audio/csound/tests/csound_filter.rs
+++ b/audio/csound/tests/csound_filter.rs
@@ -147,10 +147,10 @@ fn csound_filter_eos() {
// Checks output buffer timestamp and duration
assert_eq!(
- buffer.as_ref().get_duration(),
+ buffer.as_ref().duration(),
duration_from_samples(in_process_samples, sr as _)
);
- assert_eq!(buffer.as_ref().get_pts(), expected_pts);
+ assert_eq!(buffer.as_ref().pts(), expected_pts);
// Get the number of samples that were not processed
samples_offset = in_samples % ksmps as u64;
@@ -177,7 +177,7 @@ fn csound_filter_eos() {
let samples_at_eos = (EOS_NUM_BUFFERS * EOS_NUM_SAMPLES) % ksmps;
assert_eq!(
- buffer.as_ref().get_pts(),
+ buffer.as_ref().pts(),
in_pts - duration_from_samples(samples_at_eos as _, sr as _)
);
@@ -254,10 +254,10 @@ fn csound_filter_underflow() {
for _ in 0..expected_buffers {
let buffer = h.pull().unwrap();
- let samples = buffer.get_size() / std::mem::size_of::<f64>();
+ let samples = buffer.size() / std::mem::size_of::<f64>();
- assert_eq!(buffer.as_ref().get_pts(), expected_pts);
- assert_eq!(buffer.as_ref().get_duration(), expected_duration);
+ assert_eq!(buffer.as_ref().pts(), expected_pts);
+ assert_eq!(buffer.as_ref().duration(), expected_duration);
assert_eq!(samples, UNDERFLOW_NUM_SAMPLES * 2);
// Output data is produced after 2 input buffers
// so that, the next output buffer's PTS should be
@@ -329,18 +329,18 @@ fn csound_filter_caps_negotiation() {
let buffer = h.pull().unwrap();
// Pushing a buffer without a timestamp should produce a no timestamp output
- assert!(buffer.as_ref().get_pts().is_none());
+ assert!(buffer.as_ref().pts().is_none());
// But It should have a duration
assert_eq!(
- buffer.as_ref().get_duration(),
+ buffer.as_ref().duration(),
duration_from_samples(1024 / std::mem::size_of::<f64>() as u64, sr as u64)
);
// get the negotiated harness sink caps
let harness_sink_caps = h
- .get_sinkpad()
+ .sinkpad()
.expect("harness has no sinkpad")
- .get_current_caps()
+ .current_caps()
.expect("pad has no caps");
// our expected caps at the harness sinkpad
@@ -407,10 +407,7 @@ fn csound_filter_caps_negotiation_fail() {
// The harness sinkpad end up not having defined caps
// so, the get_current_caps should be None
- let current_caps = h
- .get_sinkpad()
- .expect("harness has no sinkpad")
- .get_current_caps();
+ let current_caps = h.sinkpad().expect("harness has no sinkpad").current_caps();
assert!(current_caps.is_none());
}
diff --git a/audio/lewton/tests/lewtondec.rs b/audio/lewton/tests/lewtondec.rs
index 59118f039..e0985c80b 100644
--- a/audio/lewton/tests/lewtondec.rs
+++ b/audio/lewton/tests/lewtondec.rs
@@ -81,13 +81,13 @@ fn run_test(inline_headers: bool) {
continue;
}
let buffer = h.pull().unwrap();
- assert_eq!(buffer.get_size(), 4 * samples);
+ assert_eq!(buffer.size(), 4 * samples);
}
let caps = h
- .get_sinkpad()
+ .sinkpad()
.expect("harness has no sinkpad")
- .get_current_caps()
+ .current_caps()
.expect("pad has no caps");
assert_eq!(
caps,