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
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 /tutorial/src
parentc3fb55f235f7feb1ab737a64f8d3d53d03a81c7a (diff)
fix-getters-{def,calls} pass
Diffstat (limited to 'tutorial/src')
-rw-r--r--tutorial/src/progressbin/imp.rs12
-rw-r--r--tutorial/src/rgb2gray/imp.rs4
-rw-r--r--tutorial/src/sinesrc/imp.rs29
3 files changed, 21 insertions, 24 deletions
diff --git a/tutorial/src/progressbin/imp.rs b/tutorial/src/progressbin/imp.rs
index 428d14243..8139858e3 100644
--- a/tutorial/src/progressbin/imp.rs
+++ b/tutorial/src/progressbin/imp.rs
@@ -104,7 +104,7 @@ impl ObjectImpl for ProgressBin {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"output" => {
let mut output_type = self.output_type.lock().unwrap();
let new_output_type = value
@@ -126,7 +126,7 @@ impl ObjectImpl for ProgressBin {
// 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() {
"output" => {
let output_type = self.output_type.lock().unwrap();
output_type.to_value()
@@ -223,13 +223,13 @@ impl BinImpl for ProgressBin {
// handling of the parent class, i.e. forwarding to the parent
// bins and the application.
MessageView::Element(ref msg)
- if msg.get_src().as_ref() == Some(self.progress.upcast_ref())
+ if msg.src().as_ref() == Some(self.progress.upcast_ref())
&& msg
- .get_structure()
- .map(|s| s.get_name() == "progress")
+ .structure()
+ .map(|s| s.name() == "progress")
.unwrap_or(false) =>
{
- let s = msg.get_structure().unwrap();
+ let s = msg.structure().unwrap();
if let Ok(percent) = s.get_some::<f64>("percent-double") {
let output_type = *self.output_type.lock().unwrap();
match output_type {
diff --git a/tutorial/src/rgb2gray/imp.rs b/tutorial/src/rgb2gray/imp.rs
index ea5b58a37..d2dd7a578 100644
--- a/tutorial/src/rgb2gray/imp.rs
+++ b/tutorial/src/rgb2gray/imp.rs
@@ -134,7 +134,7 @@ impl ObjectImpl for Rgb2Gray {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"invert" => {
let mut settings = self.settings.lock().unwrap();
let invert = value.get_some().expect("type checked upstream");
@@ -166,7 +166,7 @@ impl ObjectImpl for Rgb2Gray {
// 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() {
"invert" => {
let settings = self.settings.lock().unwrap();
settings.invert.to_value()
diff --git a/tutorial/src/sinesrc/imp.rs b/tutorial/src/sinesrc/imp.rs
index ceb73e278..6d61c7f76 100644
--- a/tutorial/src/sinesrc/imp.rs
+++ b/tutorial/src/sinesrc/imp.rs
@@ -233,7 +233,7 @@ impl ObjectImpl for SineSrc {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"samples-per-buffer" => {
let mut settings = self.settings.lock().unwrap();
let samples_per_buffer = value.get_some().expect("type checked upstream");
@@ -304,7 +304,7 @@ impl ObjectImpl for SineSrc {
// 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() {
"samples-per-buffer" => {
let settings = self.settings.lock().unwrap();
settings.samples_per_buffer.to_value()
@@ -544,7 +544,7 @@ impl BaseSrcImpl for SineSrc {
// reverse playback is requested. These values will all be used during buffer creation
// and for calculating the timestamps, etc.
- if segment.get_rate() < 0.0 {
+ if segment.rate() < 0.0 {
gst_error!(CAT, obj: element, "Reverse playback not supported");
return false;
}
@@ -564,13 +564,13 @@ impl BaseSrcImpl for SineSrc {
use std::f64::consts::PI;
let sample_offset = segment
- .get_start()
+ .start()
.unwrap()
.mul_div_floor(rate, gst::SECOND_VAL)
.unwrap();
let sample_stop = segment
- .get_stop()
+ .stop()
.map(|v| v.mul_div_floor(rate, gst::SECOND_VAL).unwrap());
let accumulator =
@@ -606,8 +606,8 @@ impl BaseSrcImpl for SineSrc {
return false;
}
- let sample_offset = segment.get_start().unwrap();
- let sample_stop = segment.get_stop().0;
+ let sample_offset = segment.start().unwrap();
+ let sample_stop = segment.stop().0;
let accumulator =
(sample_offset as f64).rem(2.0 * PI * (settings.freq as f64) / (rate as f64));
@@ -635,7 +635,7 @@ impl BaseSrcImpl for SineSrc {
CAT,
obj: element,
"Can't seek in format {:?}",
- segment.get_format()
+ segment.format()
);
false
@@ -757,17 +757,14 @@ impl PushSrcImpl for SineSrc {
// with its own clock would require various translations between the two clocks.
// This is out of scope for the tutorial though.
if element.is_live() {
- let clock = match element.get_clock() {
+ let clock = match element.clock() {
None => return Ok(buffer),
Some(clock) => clock,
};
- let segment = element
- .get_segment()
- .downcast::<gst::format::Time>()
- .unwrap();
- let base_time = element.get_base_time();
- let running_time = segment.to_running_time(buffer.get_pts() + buffer.get_duration());
+ let segment = element.segment().downcast::<gst::format::Time>().unwrap();
+ let base_time = element.base_time();
+ let running_time = segment.to_running_time(buffer.pts() + buffer.duration());
// The last sample's clock time is the base time of the element plus the
// running time of the last sample
@@ -794,7 +791,7 @@ impl PushSrcImpl for SineSrc {
obj: element,
"Waiting until {}, now {}",
wait_until,
- clock.get_time()
+ clock.time()
);
let (res, jitter) = id.wait();
gst_log!(CAT, obj: element, "Waited res {:?} jitter {}", res, jitter);