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/utils
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 /utils
parentc3fb55f235f7feb1ab737a64f8d3d53d03a81c7a (diff)
fix-getters-{def,calls} pass
Diffstat (limited to 'utils')
-rw-r--r--utils/fallbackswitch/examples/gtk_fallbackswitch.rs14
-rw-r--r--utils/fallbackswitch/src/base/aggregator.rs8
-rw-r--r--utils/fallbackswitch/src/base/aggregator_pad.rs4
-rw-r--r--utils/fallbackswitch/src/base/subclass/aggregator.rs76
-rw-r--r--utils/fallbackswitch/src/base/subclass/aggregator_pad.rs8
-rw-r--r--utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs27
-rw-r--r--utils/fallbackswitch/src/fallbacksrc/imp.rs109
-rw-r--r--utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs10
-rw-r--r--utils/fallbackswitch/src/fallbackswitch/imp.rs89
-rw-r--r--utils/fallbackswitch/tests/fallbackswitch.rs24
-rw-r--r--utils/togglerecord/examples/gtk_recording.rs8
-rw-r--r--utils/togglerecord/src/togglerecord/imp.rs115
-rw-r--r--utils/togglerecord/tests/tests.rs16
13 files changed, 245 insertions, 263 deletions
diff --git a/utils/fallbackswitch/examples/gtk_fallbackswitch.rs b/utils/fallbackswitch/examples/gtk_fallbackswitch.rs
index 061f1cac9..48a698f8e 100644
--- a/utils/fallbackswitch/examples/gtk_fallbackswitch.rs
+++ b/utils/fallbackswitch/examples/gtk_fallbackswitch.rs
@@ -49,12 +49,12 @@ fn create_pipeline() -> (gst::Pipeline, gst::Pad, gst::Element, gtk::Widget) {
let videoconvert_clone = videoconvert.clone();
decodebin.connect_pad_added(move |_, pad| {
- let caps = pad.get_current_caps().unwrap();
+ let caps = pad.current_caps().unwrap();
let s = caps.get_structure(0).unwrap();
let sinkpad = videoconvert_clone.get_static_pad("sink").unwrap();
- if s.get_name() == "video/x-raw" && !sinkpad.is_linked() {
+ if s.name() == "video/x-raw" && !sinkpad.is_linked() {
pad.link(&sinkpad).unwrap();
}
});
@@ -147,7 +147,7 @@ fn create_ui(app: &gtk::Application) {
None => return,
};
- let drop = drop_button.get_active();
+ let drop = drop_button.active();
if drop {
let mut drop_id = drop_id.borrow_mut();
if drop_id.is_none() {
@@ -170,7 +170,7 @@ fn create_ui(app: &gtk::Application) {
Inhibit(false)
});
- let bus = pipeline.get_bus().unwrap();
+ let bus = pipeline.bus().unwrap();
let app_weak = app.downgrade();
bus.add_watch_local(move |_, msg| {
use gst::MessageView;
@@ -185,9 +185,9 @@ fn create_ui(app: &gtk::Application) {
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()
);
app.quit();
}
diff --git a/utils/fallbackswitch/src/base/aggregator.rs b/utils/fallbackswitch/src/base/aggregator.rs
index 6688f8192..6f8344445 100644
--- a/utils/fallbackswitch/src/base/aggregator.rs
+++ b/utils/fallbackswitch/src/base/aggregator.rs
@@ -18,10 +18,10 @@ use std::mem;
use std::ptr;
pub trait AggregatorExtManual: 'static {
- fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
+ fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn finish_buffer(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError>;
- fn get_property_min_upstream_latency(&self) -> gst::ClockTime;
+ fn property_min_upstream_latency(&self) -> gst::ClockTime;
fn set_property_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime);
@@ -32,7 +32,7 @@ pub trait AggregatorExtManual: 'static {
}
impl<O: IsA<Aggregator>> AggregatorExtManual for O {
- fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
+ fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe {
let mut allocator = ptr::null_mut();
let mut params = mem::zeroed();
@@ -55,7 +55,7 @@ impl<O: IsA<Aggregator>> AggregatorExtManual for O {
ret.into_result()
}
- fn get_property_min_upstream_latency(&self) -> gst::ClockTime {
+ fn property_min_upstream_latency(&self) -> gst::ClockTime {
unsafe {
let mut value = Value::from_type(<gst::ClockTime as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
diff --git a/utils/fallbackswitch/src/base/aggregator_pad.rs b/utils/fallbackswitch/src/base/aggregator_pad.rs
index f1f2304ba..ecdbd4d03 100644
--- a/utils/fallbackswitch/src/base/aggregator_pad.rs
+++ b/utils/fallbackswitch/src/base/aggregator_pad.rs
@@ -12,11 +12,11 @@ use glib::object::IsA;
use glib::translate::*;
pub trait AggregatorPadExtManual: 'static {
- fn get_segment(&self) -> gst::Segment;
+ fn segment(&self) -> gst::Segment;
}
impl<O: IsA<AggregatorPad>> AggregatorPadExtManual for O {
- fn get_segment(&self) -> gst::Segment {
+ fn segment(&self) -> gst::Segment {
unsafe {
let ptr: &ffi::GstAggregatorPad = &*(self.as_ptr() as *const _);
let _guard = super::utils::MutexGuard::lock(&ptr.parent.object.lock);
diff --git a/utils/fallbackswitch/src/base/subclass/aggregator.rs b/utils/fallbackswitch/src/base/subclass/aggregator.rs
index 25623d115..499dc8e47 100644
--- a/utils/fallbackswitch/src/base/subclass/aggregator.rs
+++ b/utils/fallbackswitch/src/base/subclass/aggregator.rs
@@ -245,7 +245,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_flush(&self, aggregator: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class)
.flush
.map(|f| {
@@ -267,7 +267,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Option<gst::Buffer> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
match (*parent_class).clip {
None => Some(buffer),
Some(ref func) => from_glib_full(func(
@@ -286,7 +286,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.finish_buffer
.expect("Missing parent function `finish_buffer`");
@@ -306,7 +306,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> bool {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.sink_event
.expect("Missing parent function `sink_event`");
@@ -326,7 +326,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.sink_event_pre_queue
.expect("Missing parent function `sink_event_pre_queue`");
@@ -347,7 +347,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> bool {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.sink_query
.expect("Missing parent function `sink_query`");
@@ -367,7 +367,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> bool {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.sink_query_pre_queue
.expect("Missing parent function `sink_query`");
@@ -382,7 +382,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_src_event(&self, aggregator: &Self::Type, event: gst::Event) -> bool {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.src_event
.expect("Missing parent function `src_event`");
@@ -396,7 +396,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_src_query(&self, aggregator: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.src_query
.expect("Missing parent function `src_query`");
@@ -415,7 +415,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<(), gst::LoggableError> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
match (*parent_class).src_activate {
None => Ok(()),
Some(f) => gst::result_from_gboolean!(
@@ -438,7 +438,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.aggregate
.expect("Missing parent function `aggregate`");
@@ -453,7 +453,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_start(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class)
.start
.map(|f| {
@@ -477,7 +477,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_stop(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class)
.stop
.map(|f| {
@@ -501,7 +501,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_get_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class)
.get_next_time
.map(|f| {
@@ -523,7 +523,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Option<AggregatorPad> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.create_new_pad
.expect("Missing parent function `create_new_pad`");
@@ -543,7 +543,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<gst::Caps, gst::FlowError> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.update_src_caps
.expect("Missing parent function `update_src_caps`");
@@ -561,7 +561,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_fixate_src_caps(&self, aggregator: &Self::Type, caps: gst::Caps) -> gst::Caps {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class)
.fixate_src_caps
@@ -580,7 +580,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<(), gst::LoggableError> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class)
.negotiated_src_caps
.map(|f| {
@@ -600,7 +600,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_negotiate(&self, aggregator: &Self::Type) -> bool {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class)
.negotiate
.map(|f| {
@@ -650,7 +650,7 @@ unsafe extern "C" fn aggregator_flush<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator,
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@@ -665,7 +665,7 @@ unsafe extern "C" fn aggregator_clip<T: AggregatorImpl>(
buffer: *mut gst::ffi::GstBuffer,
) -> *mut gst::ffi::GstBuffer {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
let ret = gst::panic_to_error!(&wrap, &imp.panicked(), None, {
@@ -684,7 +684,7 @@ unsafe extern "C" fn aggregator_finish_buffer<T: AggregatorImpl>(
buffer: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@@ -700,7 +700,7 @@ unsafe extern "C" fn aggregator_sink_event<T: AggregatorImpl>(
event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(wrap, &imp.panicked(), false, {
@@ -719,7 +719,7 @@ unsafe extern "C" fn aggregator_sink_event_pre_queue<T: AggregatorImpl>(
event: *mut gst::ffi::GstEvent,
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@@ -739,7 +739,7 @@ unsafe extern "C" fn aggregator_sink_query<T: AggregatorImpl>(
query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@@ -758,7 +758,7 @@ unsafe extern "C" fn aggregator_sink_query_pre_queue<T: AggregatorImpl>(
query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@@ -776,7 +776,7 @@ unsafe extern "C" fn aggregator_src_event<T: AggregatorImpl>(
event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@@ -790,7 +790,7 @@ unsafe extern "C" fn aggregator_src_query<T: AggregatorImpl>(
query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@@ -805,7 +805,7 @@ unsafe extern "C" fn aggregator_src_activate<T: AggregatorImpl>(
active: glib::ffi::gboolean,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@@ -825,7 +825,7 @@ unsafe extern "C" fn aggregator_aggregate<T: AggregatorImpl>(
timeout: glib::ffi::gboolean,
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@@ -839,7 +839,7 @@ unsafe extern "C" fn aggregator_start<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@@ -858,7 +858,7 @@ unsafe extern "C" fn aggregator_stop<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@@ -877,7 +877,7 @@ unsafe extern "C" fn aggregator_get_next_time<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator,
) -> gst::ffi::GstClockTime {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::CLOCK_TIME_NONE, {
@@ -893,7 +893,7 @@ unsafe extern "C" fn aggregator_create_new_pad<T: AggregatorImpl>(
caps: *const gst::ffi::GstCaps,
) -> *mut ffi::GstAggregatorPad {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), None, {
@@ -917,7 +917,7 @@ unsafe extern "C" fn aggregator_update_src_caps<T: AggregatorImpl>(
res: *mut *mut gst::ffi::GstCaps,
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
*res = ptr::null_mut();
@@ -939,7 +939,7 @@ unsafe extern "C" fn aggregator_fixate_src_caps<T: AggregatorImpl>(
caps: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), {
@@ -953,7 +953,7 @@ unsafe extern "C" fn aggregator_negotiated_src_caps<T: AggregatorImpl>(
caps: *mut gst::ffi::GstCaps,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@@ -972,7 +972,7 @@ unsafe extern "C" fn aggregator_negotiate<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
diff --git a/utils/fallbackswitch/src/base/subclass/aggregator_pad.rs b/utils/fallbackswitch/src/base/subclass/aggregator_pad.rs
index 68a706f4b..7af2547a1 100644
--- a/utils/fallbackswitch/src/base/subclass/aggregator_pad.rs
+++ b/utils/fallbackswitch/src/base/subclass/aggregator_pad.rs
@@ -59,7 +59,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorPadClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorPadClass;
(*parent_class)
.flush
.map(|f| {
@@ -84,7 +84,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
) -> bool {
unsafe {
let data = T::type_data();
- let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorPadClass;
+ let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorPadClass;
(*parent_class)
.skip_buffer
.map(|f| {
@@ -119,7 +119,7 @@ unsafe extern "C" fn aggregator_pad_flush<T: AggregatorPadImpl>(
aggregator: *mut ffi::GstAggregator,
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<AggregatorPad> = from_glib_borrow(ptr);
let res: gst::FlowReturn = imp
@@ -134,7 +134,7 @@ unsafe extern "C" fn aggregator_pad_skip_buffer<T: AggregatorPadImpl>(
buffer: *mut gst::ffi::GstBuffer,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
- let imp = instance.get_impl();
+ let imp = instance.impl_();
let wrap: Borrowed<AggregatorPad> = from_glib_borrow(ptr);
imp.skip_buffer(
diff --git a/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs b/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs
index f634553fb..70eeddab3 100644
--- a/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs
+++ b/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs
@@ -83,7 +83,7 @@ impl ObjectImpl for CustomSource {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"source" => {
let source = value.get::<gst::Element>().unwrap().unwrap();
self.source.set(source.clone()).unwrap();
@@ -178,11 +178,11 @@ impl CustomSource {
gst_debug!(CAT, obj: element, "Starting");
let source = self.source.get().unwrap();
- let templates = source.get_pad_template_list();
+ let templates = source.pad_template_list();
if templates
.iter()
- .any(|templ| templ.get_property_presence() == gst::PadPresence::Request)
+ .any(|templ| templ.property_presence() == gst::PadPresence::Request)
{
gst_error!(CAT, obj: element, "Request pads not supported");
gst::element_error!(
@@ -195,10 +195,10 @@ impl CustomSource {
let has_sometimes_pads = templates
.iter()
- .any(|templ| templ.get_property_presence() == gst::PadPresence::Sometimes);
+ .any(|templ| templ.property_presence() == gst::PadPresence::Sometimes);
// Handle all source pads that already exist
- for pad in source.get_src_pads() {
+ for pad in source.src_pads() {
if let Err(msg) = self.handle_source_pad_added(&element, &pad) {
element.post_error_message(msg);
return Err(gst::StateChangeError);
@@ -253,7 +253,7 @@ impl CustomSource {
element: &super::CustomSource,
pad: &gst::Pad,
) -> Result<(), gst::ErrorMessage> {
- gst_debug!(CAT, obj: element, "Source added pad {}", pad.get_name());
+ gst_debug!(CAT, obj: element, "Source added pad {}", pad.name());
let mut state = self.state.lock().unwrap();
@@ -262,19 +262,16 @@ impl CustomSource {
// Take stream type from stream-start event if we can
if let Some(event) = pad.get_sticky_event(gst::EventType::StreamStart, 0) {
if let gst::EventView::StreamStart(ev) = event.view() {
- stream_type = ev.get_stream().map(|s| s.get_stream_type());
+ stream_type = ev.stream().map(|s| s.stream_type());
}
}
// Otherwise from the caps
if stream_type.is_none() {
- let caps = match pad
- .get_current_caps()
- .unwrap_or_else(|| pad.query_caps(None))
- {
+ let caps = match pad.current_caps().unwrap_or_else(|| pad.query_caps(None)) {
caps if !caps.is_any() && !caps.is_empty() => caps,
_ => {
- gst_error!(CAT, obj: element, "Pad {} had no caps", pad.get_name());
+ gst_error!(CAT, obj: element, "Pad {} had no caps", pad.name());
return Err(gst::error_msg!(
gst::CoreError::Negotiation,
["Pad had no caps"]
@@ -284,9 +281,9 @@ impl CustomSource {
let s = caps.get_structure(0).unwrap();
- if s.get_name().starts_with("audio/") {
+ if s.name().starts_with("audio/") {
stream_type = Some(gst::StreamType::AUDIO);
- } else if s.get_name().starts_with("video/") {
+ } else if s.name().starts_with("video/") {
stream_type = Some(gst::StreamType::VIDEO);
} else {
return Ok(());
@@ -325,7 +322,7 @@ impl CustomSource {
}
fn handle_source_pad_removed(&self, element: &super::CustomSource, pad: &gst::Pad) {
- gst_debug!(CAT, obj: element, "Source removed pad {}", pad.get_name());
+ gst_debug!(CAT, obj: element, "Source removed pad {}", pad.name());
let mut state = self.state.lock().unwrap();
let (i, stream) = match state
diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs
index d85cef12b..93fb5d90e 100644
--- a/utils/fallbackswitch/src/fallbacksrc/imp.rs
+++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs
@@ -299,7 +299,7 @@ impl ObjectImpl for FallbackSrc {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"enable-audio" => {
let mut settings = self.settings.lock().unwrap();
let new_value = value.get_some().expect("type checked upstream");
@@ -440,7 +440,7 @@ impl ObjectImpl for FallbackSrc {
// at any time from any thread.
#[allow(clippy::blocks_in_if_conditions)]
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"enable-audio" => {
let settings = self.settings.lock().unwrap();
settings.enable_audio.to_value()
@@ -501,9 +501,9 @@ impl ObjectImpl for FallbackSrc {
if let Some(ref streams) = state.streams {
for stream in streams.iter() {
have_audio =
- have_audio || stream.get_stream_type().contains(gst::StreamType::AUDIO);
+ have_audio || stream.stream_type().contains(gst::StreamType::AUDIO);
have_video =
- have_video || stream.get_stream_type().contains(gst::StreamType::VIDEO);
+ have_video || stream.stream_type().contains(gst::StreamType::VIDEO);
}
}
@@ -537,7 +537,7 @@ impl ObjectImpl for FallbackSrc {
let settings = self.settings.lock().unwrap();
settings.buffer_duration.to_value()
}
- "statistics" => self.get_stats().to_value(),
+ "statistics" => self.stats().to_value(),
_ => unimplemented!(),
}
}
@@ -831,7 +831,7 @@ impl FallbackSrc {
let templ = element
.get_pad_template(if is_audio { "audio" } else { "video" })
.unwrap();
- let ghostpad = gst::GhostPad::builder_with_template(&templ, Some(&templ.get_name()))
+ let ghostpad = gst::GhostPad::builder_with_template(&templ, Some(&templ.name()))
.proxy_pad_chain_function({
let element_weak = element.downgrade();
move |pad, _parent, buffer| {
@@ -1096,7 +1096,7 @@ impl FallbackSrc {
element: &super::FallbackSrc,
pad: &gst::Pad,
) -> Result<(), gst::ErrorMessage> {
- gst_debug!(CAT, obj: element, "Pad {} added to source", pad.get_name(),);
+ gst_debug!(CAT, obj: element, "Pad {} added to source", pad.name(),);
let mut state_guard = self.state.lock().unwrap();
let state = match &mut *state_guard {
@@ -1106,23 +1106,20 @@ impl FallbackSrc {
Some(state) => state,
};
- let (type_, stream) = match pad.get_name() {
+ let (type_, stream) = match pad.name() {
x if x.starts_with("audio_") => ("audio", &mut state.audio_stream),
x if x.starts_with("video_") => ("video", &mut state.video_stream),
_ => {
- let caps = match pad
- .get_current_caps()
- .unwrap_or_else(|| pad.query_caps(None))
- {
+ let caps = match pad.current_caps().unwrap_or_else(|| pad.query_caps(None)) {
caps if !caps.is_any() && !caps.is_empty() => caps,
_ => return Ok(()),
};
let s = caps.get_structure(0).unwrap();
- if s.get_name().starts_with("audio/") {
+ if s.name().starts_with("audio/") {
("audio", &mut state.audio_stream)
- } else if s.get_name().starts_with("video/") {
+ } else if s.name().starts_with("video/") {
("video", &mut state.video_stream)
} else {
// TODO: handle subtitles etc
@@ -1171,14 +1168,12 @@ impl FallbackSrc {
let src = FallbackSrc::from_instance(&element);
match info.data {
- Some(gst::PadProbeData::Event(ref ev))
- if ev.get_type() == gst::EventType::Eos =>
- {
+ Some(gst::PadProbeData::Event(ref ev)) if ev.type_() == gst::EventType::Eos => {
gst_debug!(
CAT,
obj: &element,
"Received EOS from source on pad {}, restarting",
- pad.get_name()
+ pad.name()
);
let mut state_guard = src.state.lock().unwrap();
@@ -1218,7 +1213,7 @@ impl FallbackSrc {
CAT,
obj: element,
"Adding probe to pad {}",
- stream.source_srcpad.as_ref().unwrap().get_name()
+ stream.source_srcpad.as_ref().unwrap().name()
);
let element_weak = element.downgrade();
@@ -1234,7 +1229,7 @@ impl FallbackSrc {
Some(element) => element,
};
let pts = match info.data {
- Some(gst::PadProbeData::Buffer(ref buffer)) => buffer.get_pts(),
+ Some(gst::PadProbeData::Buffer(ref buffer)) => buffer.pts(),
Some(gst::PadProbeData::Event(ref ev)) => match ev.view() {
gst::EventView::Gap(ref ev) => ev.get().0,
_ => return gst::PadProbeReturn::Pass,
@@ -1288,7 +1283,7 @@ impl FallbackSrc {
CAT,
obj: element,
"Called probe on pad {}",
- stream.source_srcpad.as_ref().unwrap().get_name()
+ stream.source_srcpad.as_ref().unwrap().name()
);
stream
} else if let Some(stream) = state
@@ -1300,7 +1295,7 @@ impl FallbackSrc {
CAT,
obj: element,
"Called probe on pad {}",
- stream.source_srcpad.as_ref().unwrap().get_name()
+ stream.source_srcpad.as_ref().unwrap().name()
);
stream
} else {
@@ -1324,7 +1319,7 @@ impl FallbackSrc {
CAT,
obj: element,
"Removing pad probe for pad {}",
- source_srcpad.get_name()
+ source_srcpad.name()
);
block.pad.remove_probe(block.probe_id);
}
@@ -1352,7 +1347,7 @@ impl FallbackSrc {
};
let segment = match ev.view() {
- gst::EventView::Segment(s) => s.get_segment(),
+ gst::EventView::Segment(s) => s.segment(),
_ => unreachable!(),
};
let segment = segment.downcast_ref::<gst::ClockTime>().ok_or_else(|| {
@@ -1360,10 +1355,10 @@ impl FallbackSrc {
gst::error_msg!(gst::CoreError::Clock, ["Have no time segment"])
})?;
- let running_time = if pts < segment.get_start() {
- segment.get_start()
- } else if segment.get_stop().is_some() && pts >= segment.get_stop() {
- segment.get_stop()
+ let running_time = if pts < segment.start() {
+ segment.start()
+ } else if segment.stop().is_some() && pts >= segment.stop() {
+ segment.stop()
} else {
segment.to_running_time(pts)
};
@@ -1410,8 +1405,8 @@ impl FallbackSrc {
let mut have_audio = false;
let mut have_video = false;
for stream in streams.iter() {
- have_audio = have_audio || stream.get_stream_type().contains(gst::StreamType::AUDIO);
- have_video = have_video || stream.get_stream_type().contains(gst::StreamType::VIDEO);
+ have_audio = have_audio || stream.stream_type().contains(gst::StreamType::AUDIO);
+ have_video = have_video || stream.stream_type().contains(gst::StreamType::VIDEO);
}
let want_audio = state.settings.enable_audio;
@@ -1439,18 +1434,18 @@ impl FallbackSrc {
let audio_is_eos = audio_srcpad
.as_ref()
- .map(|p| p.get_pad_flags().contains(gst::PadFlags::EOS))
+ .map(|p| p.pad_flags().contains(gst::PadFlags::EOS))
.unwrap_or(false);
let video_is_eos = video_srcpad
.as_ref()
- .map(|p| p.get_pad_flags().contains(gst::PadFlags::EOS))
+ .map(|p| p.pad_flags().contains(gst::PadFlags::EOS))
.unwrap_or(false);
// If we need both, wait for both and take the minimum, otherwise take the one we need.
// Also consider EOS, we'd never get a new running time after EOS so don't need to wait.
// FIXME: All this surely can be simplified somehow
- let current_running_time = element.get_current_running_time();
+ let current_running_time = element.current_running_time();
if have_audio && want_audio && have_video && want_video {
if audio_running_time.is_none()
@@ -1587,12 +1582,7 @@ impl FallbackSrc {
}
fn handle_source_pad_removed(&self, element: &super::FallbackSrc, pad: &gst::Pad) {
- gst_debug!(
- CAT,
- obj: element,
- "Pad {} removed from source",
- pad.get_name()
- );
+ gst_debug!(CAT, obj: element, "Pad {} removed from source", pad.name());
let mut state_guard = self.state.lock().unwrap();
let state = match &mut *state_guard {
@@ -1643,9 +1633,9 @@ impl FallbackSrc {
return;
}
- gst_debug!(CAT, obj: element, "Got buffering {}%", m.get_percent());
+ gst_debug!(CAT, obj: element, "Got buffering {}%", m.percent());
- state.stats.buffering_percent = m.get_percent();
+ state.stats.buffering_percent = m.percent();
if state.stats.buffering_percent < 100 {
state.last_buffering_update = Some(Instant::now());
// Block source pads if needed to pause
@@ -1682,7 +1672,7 @@ impl FallbackSrc {
Some(state) => state,
};
- let streams = m.get_stream_collection();
+ let streams = m.stream_collection();
gst_debug!(
CAT,
@@ -1694,8 +1684,8 @@ impl FallbackSrc {
let mut have_audio = false;
let mut have_video = false;
for stream in streams.iter() {
- have_audio = have_audio || stream.get_stream_type().contains(gst::StreamType::AUDIO);
- have_video = have_video || stream.get_stream_type().contains(gst::StreamType::VIDEO);
+ have_audio = have_audio || stream.stream_type().contains(gst::StreamType::AUDIO);
+ have_video = have_video || stream.stream_type().contains(gst::StreamType::VIDEO);
}
if !have_audio && state.settings.enable_audio {
@@ -1742,7 +1732,7 @@ impl FallbackSrc {
Some(state) => state,
};
- let src = match m.get_src().and_then(|s| s.downcast::<gst::Element>().ok()) {
+ let src = match m.src().and_then(|s| s.downcast::<gst::Element>().ok()) {
None => return false,
Some(src) => src,
};
@@ -1751,7 +1741,7 @@ impl FallbackSrc {
CAT,
obj: element,
"Got error message from {}",
- src.get_path_string()
+ src.path_string()
);
if src == state.source || src.has_as_ancestor(&state.source) {
@@ -1799,7 +1789,7 @@ impl FallbackSrc {
CAT,
obj: element,
"Give up for error message from {}",
- src.get_path_string()
+ src.path_string()
);
false
@@ -1833,12 +1823,12 @@ impl FallbackSrc {
// Drop any EOS events from any source pads of the source that might happen because of the
// error. We don't need to remove these pad probes because restarting the source will also
// remove/add the pads again.
- for pad in state.source.get_src_pads() {
+ for pad in state.source.src_pads() {
pad.add_probe(
gst::PadProbeType::EVENT_DOWNSTREAM,
|_pad, info| match info.data {
Some(gst::PadProbeData::Event(ref event)) => {
- if event.get_type() == gst::EventType::Eos {
+ if event.type_() == gst::EventType::Eos {
gst::PadProbeReturn::Drop
} else {
gst::PadProbeReturn::Ok
@@ -1888,7 +1878,7 @@ impl FallbackSrc {
CAT,
obj: element,
"Removing pad probe for pad {}",
- source_srcpad.get_name()
+ source_srcpad.name()
);
block.pad.remove_probe(block.probe_id);
}
@@ -1922,7 +1912,7 @@ impl FallbackSrc {
gst_debug!(CAT, obj: element, "Waiting for 1s before retrying");
let clock = gst::SystemClock::obtain();
- let wait_time = clock.get_time() + gst::SECOND;
+ let wait_time = clock.time() + gst::SECOND;
assert!(wait_time.is_some());
assert!(state.source_pending_restart_timeout.is_none());
@@ -2035,9 +2025,8 @@ impl FallbackSrc {
}
let clock = gst::SystemClock::obtain();
- let wait_time = clock.get_time()
- + gst::ClockTime::from_nseconds(state.settings.restart_timeout)
- - elapsed;
+ let wait_time =
+ clock.time() + gst::ClockTime::from_nseconds(state.settings.restart_timeout) - elapsed;
assert!(wait_time.is_some());
gst_debug!(
CAT,
@@ -2110,10 +2099,8 @@ impl FallbackSrc {
let mut have_video = false;
if let Some(ref streams) = state.streams {
for stream in streams.iter() {
- have_audio =
- have_audio || stream.get_stream_type().contains(gst::StreamType::AUDIO);
- have_video =
- have_video || stream.get_stream_type().contains(gst::StreamType::VIDEO);
+ have_audio = have_audio || stream.stream_type().contains(gst::StreamType::AUDIO);
+ have_video = have_video || stream.stream_type().contains(gst::StreamType::VIDEO);
}
}
@@ -2132,7 +2119,7 @@ impl FallbackSrc {
.get::<gst::Pad>()
.unwrap()
})
- .map(|p| p.get_name() == "fallback_sink")
+ .map(|p| p.name() == "fallback_sink")
.unwrap_or(true))
|| (have_video
&& state.video_stream.is_some()
@@ -2146,7 +2133,7 @@ impl FallbackSrc {
.get::<gst::Pad>()
.unwrap()
})
- .map(|p| p.get_name() == "fallback_sink")
+ .map(|p| p.name() == "fallback_sink")
.unwrap_or(true))
}
@@ -2186,7 +2173,7 @@ impl FallbackSrc {
}
}
- fn get_stats(&self) -> gst::Structure {
+ fn stats(&self) -> gst::Structure {
let state_guard = self.state.lock().unwrap();
let state = match &*state_guard {
diff --git a/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs b/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs
index 800018507..821aab28a 100644
--- a/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs
+++ b/utils/fallbackswitch/src/fallbacksrc/video_fallback/imp.rs
@@ -69,7 +69,7 @@ impl ObjectSubclass for VideoFallbackSource {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.get_pad_template("src").unwrap();
- let srcpad = gst::GhostPad::builder_with_template(&templ, Some(&templ.get_name())).build();
+ let srcpad = gst::GhostPad::builder_with_template(&templ, Some(&templ.name())).build();
Self {
srcpad,
@@ -113,7 +113,7 @@ impl ObjectImpl for VideoFallbackSource {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"uri" => {
let mut settings = self.settings.lock().unwrap();
let new_value = value.get().expect("type checked upstream");
@@ -143,7 +143,7 @@ impl ObjectImpl for VideoFallbackSource {
}
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"uri" => {
let settings = self.settings.lock().unwrap();
settings.uri.to_value()
@@ -379,10 +379,10 @@ impl VideoFallbackSource {
let s = caps.get_structure(0).unwrap();
let decoder;
- if s.get_name() == "image/jpeg" {
+ if s.name() == "image/jpeg" {
decoder = gst::ElementFactory::make("jpegdec", Some("decoder"))
.expect("jpegdec not found");
- } else if s.get_name() == "image/png" {
+ } else if s.name() == "image/png" {
decoder = gst::ElementFactory::make("pngdec", Some("decoder"))
.expect("pngdec not found");
} else {
diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs
index 0b191a257..d999f5b3e 100644
--- a/utils/fallbackswitch/src/fallbackswitch/imp.rs
+++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs
@@ -187,10 +187,10 @@ impl FallbackSwitch {
pad: &gst_base::AggregatorPad,
target_running_time: gst::ClockTime,
) -> Result<(), gst::FlowError> {
- let segment = pad.get_segment();
+ let segment = pad.segment();
/* No segment yet - no data */
- if segment.get_format() == gst::Format::Undefined {
+ if segment.format() == gst::Format::Undefined {
return Ok(());
}
@@ -202,7 +202,7 @@ impl FallbackSwitch {
let mut running_time = gst::ClockTime::none();
while let Some(buffer) = pad.peek_buffer() {
- let pts = buffer.get_dts_or_pts();
+ let pts = buffer.dts_or_pts();
let new_running_time = segment.to_running_time(pts);
if pts.is_none() || new_running_time <= target_running_time {
@@ -239,30 +239,30 @@ impl FallbackSwitch {
CAT,
obj: preferred_pad,
"Got buffer on pad {} - {:?}",
- preferred_pad.get_name(),
+ preferred_pad.name(),
buffer
);
- if buffer.get_pts().is_none() {
+ if buffer.pts().is_none() {
gst_error!(CAT, obj: preferred_pad, "Only buffers with PTS supported");
return Err(gst::FlowError::Error);
}
let segment = preferred_pad
- .get_segment()
+ .segment()
.downcast::<gst::ClockTime>()
.map_err(|_| {
gst_error!(CAT, obj: preferred_pad, "Only TIME segments supported");
gst::FlowError::Error
})?;
- let running_time = segment.to_running_time(buffer.get_dts_or_pts());
+ let running_time = segment.to_running_time(buffer.dts_or_pts());
{
// FIXME: This will not work correctly for negative DTS
let buffer = buffer.make_mut();
- buffer.set_pts(segment.to_running_time(buffer.get_pts()));
- buffer.set_dts(segment.to_running_time(buffer.get_dts()));
+ buffer.set_pts(segment.to_running_time(buffer.pts()));
+ buffer.set_dts(segment.to_running_time(buffer.dts()));
}
if preferred_pad == &self.primary_sinkpad {
@@ -273,7 +273,7 @@ impl FallbackSwitch {
let is_late = {
if cur_running_time != gst::ClockTime::none() {
- let latency = agg.get_latency();
+ let latency = agg.latency();
if latency.is_some() {
let deadline = running_time + latency + 40 * gst::MSECOND;
@@ -320,12 +320,12 @@ impl FallbackSwitch {
&& active_sinkpad.as_ref() != Some(preferred_pad.upcast_ref::<gst::Pad>());
if pad_change {
- if buffer.get_flags().contains(gst::BufferFlags::DELTA_UNIT) {
+ if buffer.flags().contains(gst::BufferFlags::DELTA_UNIT) {
gst_info!(
CAT,
obj: preferred_pad,
"Can't change back to sinkpad {}, waiting for keyframe",
- preferred_pad.get_name()
+ preferred_pad.name()
);
preferred_pad.push_event(
gst_video::UpstreamForceKeyUnitEvent::builder()
@@ -380,25 +380,26 @@ impl FallbackSwitch {
buffer
);
- if buffer.get_pts().is_none() {
+ if buffer.pts().is_none() {
gst_error!(CAT, obj: backup_pad, "Only buffers with PTS supported");
return Err(gst::FlowError::Error);
}
- let backup_segment = backup_pad
- .get_segment()
- .downcast::<gst::ClockTime>()
- .map_err(|_| {
- gst_error!(CAT, obj: backup_pad, "Only TIME segments supported");
- gst::FlowError::Error
- })?;
- let running_time = backup_segment.to_running_time(buffer.get_dts_or_pts());
+ let backup_segment =
+ backup_pad
+ .segment()
+ .downcast::<gst::ClockTime>()
+ .map_err(|_| {
+ gst_error!(CAT, obj: backup_pad, "Only TIME segments supported");
+ gst::FlowError::Error
+ })?;
+ let running_time = backup_segment.to_running_time(buffer.dts_or_pts());
{
// FIXME: This will not work correctly for negative DTS
let buffer = buffer.make_mut();
- buffer.set_pts(backup_segment.to_running_time(buffer.get_pts()));
- buffer.set_dts(backup_segment.to_running_time(buffer.get_dts()));
+ buffer.set_pts(backup_segment.to_running_time(buffer.pts()));
+ buffer.set_dts(backup_segment.to_running_time(buffer.dts()));
}
// If we never had a real buffer, initialize with the running time of the fallback
@@ -439,12 +440,12 @@ impl FallbackSwitch {
let pad_change = settings.auto_switch
&& active_sinkpad.as_ref() != Some(backup_pad.upcast_ref::<gst::Pad>());
if pad_change {
- if buffer.get_flags().contains(gst::BufferFlags::DELTA_UNIT) {
+ if buffer.flags().contains(gst::BufferFlags::DELTA_UNIT) {
gst_info!(
CAT,
obj: backup_pad,
"Can't change to sinkpad {} yet, waiting for keyframe",
- backup_pad.get_name()
+ backup_pad.name()
);
backup_pad.push_event(
gst_video::UpstreamForceKeyUnitEvent::builder()
@@ -522,11 +523,11 @@ impl FallbackSwitch {
)
};
- let clock = agg.get_clock();
- let base_time = agg.get_base_time();
+ let clock = agg.clock();
+ let base_time = agg.base_time();
let cur_running_time = if let Some(clock) = clock {
- clock.get_time() - base_time
+ clock.time() - base_time
} else {
gst::ClockTime::none()
};
@@ -727,7 +728,7 @@ impl ObjectImpl for FallbackSwitch {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"timeout" => {
let mut settings = self.settings.lock().unwrap();
let timeout = value.get_some().expect("type checked upstream");
@@ -769,7 +770,7 @@ impl ObjectImpl for FallbackSwitch {
}
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"timeout" => {
let settings = self.settings.lock().unwrap();
settings.timeout.to_value()
@@ -945,15 +946,15 @@ impl AggregatorImpl for FallbackSwitch {
match event.view() {
EventView::Caps(caps) => {
- let caps = caps.get_caps_owned();
+ let caps = caps.caps_owned();
gst_debug!(CAT, obj: agg_pad, "Received caps {}", caps);
let audio_info;
let video_info;
- if caps.get_structure(0).unwrap().get_name() == "audio/x-raw" {
+ if caps.get_structure(0).unwrap().name() == "audio/x-raw" {
audio_info = gst_audio::AudioInfo::from_caps(&caps).ok();
video_info = None;
- } else if caps.get_structure(0).unwrap().get_name() == "video/x-raw" {
+ } else if caps.get_structure(0).unwrap().name() == "video/x-raw" {
audio_info = None;
video_info = gst_video::VideoInfo::from_caps(&caps).ok();
} else {
@@ -1013,7 +1014,7 @@ impl AggregatorImpl for FallbackSwitch {
CAT,
obj: agg,
"Have buffer on sinkpad {}, immediate timeout",
- preferred_pad.get_name()
+ preferred_pad.name()
);
0.into()
} else if self.primary_sinkpad.is_eos() {
@@ -1023,13 +1024,13 @@ impl AggregatorImpl for FallbackSwitch {
.as_ref()
.and_then(|p| p.peek_buffer().map(|buffer| (buffer, p)))
{
- if buffer.get_pts().is_none() {
+ if buffer.pts().is_none() {
gst_error!(CAT, obj: agg, "Only buffers with PTS supported");
// Trigger aggregate immediately to error out immediately
return 0.into();
}
- let segment = match backup_sinkpad.get_segment().downcast::<gst::ClockTime>() {
+ let segment = match backup_sinkpad.segment().downcast::<gst::ClockTime>() {
Ok(segment) => segment,
Err(_) => {
gst_error!(CAT, obj: agg, "Only TIME segments supported");
@@ -1038,12 +1039,12 @@ impl AggregatorImpl for FallbackSwitch {
}
};
- let running_time = segment.to_running_time(buffer.get_dts_or_pts());
+ let running_time = segment.to_running_time(buffer.dts_or_pts());
gst_debug!(
CAT,
obj: agg,
"Have buffer on {} pad, timeout at {}",
- backup_sinkpad.get_name(),
+ backup_sinkpad.name(),
running_time
);
running_time
@@ -1061,7 +1062,7 @@ impl AggregatorImpl for FallbackSwitch {
agg_pad: &gst_base::AggregatorPad,
mut buffer: gst::Buffer,
) -> Option<gst::Buffer> {
- let segment = match agg_pad.get_segment().downcast::<gst::ClockTime>() {
+ let segment = match agg_pad.segment().downcast::<gst::ClockTime>() {
Ok(segment) => segment,
Err(_) => {
gst_error!(CAT, obj: agg, "Only TIME segments supported");
@@ -1069,7 +1070,7 @@ impl AggregatorImpl for FallbackSwitch {
}
};
- let pts = buffer.get_pts();
+ let pts = buffer.pts();
if pts.is_none() {
gst_error!(CAT, obj: agg, "Only buffers with PTS supported");
return Some(buffer);
@@ -1091,12 +1092,12 @@ impl AggregatorImpl for FallbackSwitch {
return Some(buffer);
}
- let duration = if buffer.get_duration().is_some() {
- buffer.get_duration()
+ let duration = if buffer.duration().is_some() {
+ buffer.duration()
} else if let Some(ref audio_info) = pad_state.audio_info {
gst::SECOND
.mul_div_floor(
- buffer.get_size() as u64,
+ buffer.size() as u64,
audio_info.rate() as u64 * audio_info.bpf() as u64,
)
.unwrap()
@@ -1178,7 +1179,7 @@ impl AggregatorImpl for FallbackSwitch {
let (mut buffer, active_caps, pad_change) = res?;
- let current_src_caps = agg.get_static_pad("src").unwrap().get_current_caps();
+ let current_src_caps = agg.get_static_pad("src").unwrap().current_caps();
if Some(&active_caps) != current_src_caps.as_ref() {
gst_info!(
CAT,
diff --git a/utils/fallbackswitch/tests/fallbackswitch.rs b/utils/fallbackswitch/tests/fallbackswitch.rs
index ce0139b4a..2ec10eef0 100644
--- a/utils/fallbackswitch/tests/fallbackswitch.rs
+++ b/utils/fallbackswitch/tests/fallbackswitch.rs
@@ -41,15 +41,15 @@ fn init() {
macro_rules! assert_fallback_buffer {
($buffer:expr, $ts:expr) => {
- assert_eq!($buffer.get_pts(), $ts);
- assert_eq!($buffer.get_size(), 160 * 120 * 4);
+ assert_eq!($buffer.pts(), $ts);
+ assert_eq!($buffer.size(), 160 * 120 * 4);
};
}
macro_rules! assert_buffer {
($buffer:expr, $ts:expr) => {
- assert_eq!($buffer.get_pts(), $ts);
- assert_eq!($buffer.get_size(), 320 * 240 * 4);
+ assert_eq!($buffer.pts(), $ts);
+ assert_eq!($buffer.size(), 320 * 240 * 4);
};
}
@@ -412,16 +412,16 @@ fn setup_pipeline(with_live_fallback: Option<bool>) -> Pipeline {
loop {
while let Some(clock_id) = clock.peek_next_pending_id().and_then(|clock_id| {
// Process if the clock ID is in the past or now
- if clock.get_time() >= clock_id.get_time() {
+ if clock.time() >= clock_id.time() {
Some(clock_id)
} else {
None
}
}) {
- gst_debug!(TEST_CAT, "Processing clock ID at {}", clock_id.get_time());
+ gst_debug!(TEST_CAT, "Processing clock ID at {}", clock_id.time());
if let Some(clock_id) = clock.process_next_clock_id() {
- gst_debug!(TEST_CAT, "Processed clock ID at {}", clock_id.get_time());
- if clock_id.get_time() == 0.into() {
+ gst_debug!(TEST_CAT, "Processed clock ID at {}", clock_id.time());
+ if clock_id.time() == 0.into() {
gst_debug!(TEST_CAT, "Stopping clock thread");
return;
}
@@ -432,7 +432,7 @@ fn setup_pipeline(with_live_fallback: Option<bool>) -> Pipeline {
// at the top of the queue. We don't want to do a busy loop here.
while clock.peek_next_pending_id().iter().any(|clock_id| {
// Sleep if the clock ID is in the future
- clock.get_time() < clock_id.get_time()
+ clock.time() < clock_id.time()
}) {
use std::{thread, time};
@@ -504,12 +504,12 @@ fn pull_buffer(pipeline: &Pipeline) -> gst::Buffer {
.downcast::<gst_app::AppSink>()
.unwrap();
let sample = sink.pull_sample().unwrap();
- sample.get_buffer_owned().unwrap()
+ sample.buffer_owned().unwrap()
}
fn set_time(pipeline: &Pipeline, time: gst::ClockTime) {
let clock = pipeline
- .get_clock()
+ .clock()
.unwrap()
.downcast::<gst_check::TestClock>()
.unwrap();
@@ -540,7 +540,7 @@ fn stop_pipeline(mut pipeline: Pipeline) {
pipeline.set_state(gst::State::Null).unwrap();
let clock = pipeline
- .get_clock()
+ .clock()
.unwrap()
.downcast::<gst_check::TestClock>()
.unwrap();
diff --git a/utils/togglerecord/examples/gtk_recording.rs b/utils/togglerecord/examples/gtk_recording.rs
index 13dee1daf..bd322c8a7 100644
--- a/utils/togglerecord/examples/gtk_recording.rs
+++ b/utils/togglerecord/examples/gtk_recording.rs
@@ -291,7 +291,7 @@ fn create_ui(app: &gtk::Application) {
Inhibit(false)
});
- let bus = pipeline.get_bus().unwrap();
+ let bus = pipeline.bus().unwrap();
let app_weak = app.downgrade();
bus.add_watch_local(move |_, msg| {
use gst::MessageView;
@@ -306,9 +306,9 @@ fn create_ui(app: &gtk::Application) {
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()
);
app.quit();
}
diff --git a/utils/togglerecord/src/togglerecord/imp.rs b/utils/togglerecord/src/togglerecord/imp.rs
index 58b24cf06..15cb8d47e 100644
--- a/utils/togglerecord/src/togglerecord/imp.rs
+++ b/utils/togglerecord/src/togglerecord/imp.rs
@@ -158,14 +158,14 @@ enum HandleResult<T> {
}
trait HandleData: Sized {
- fn get_pts(&self) -> gst::ClockTime;
- fn get_dts(&self) -> gst::ClockTime;
- fn get_dts_or_pts(&self) -> gst::ClockTime {
- let dts = self.get_dts();
+ fn pts(&self) -> gst::ClockTime;
+ fn dts(&self) -> gst::ClockTime;
+ fn dts_or_pts(&self) -> gst::ClockTime {
+ let dts = self.dts();
if dts.is_some() {
dts
} else {
- self.get_pts()
+ self.pts()
}
}
fn get_duration(&self, state: &StreamState) -> gst::ClockTime;
@@ -179,11 +179,11 @@ trait HandleData: Sized {
}
impl HandleData for (gst::ClockTime, gst::ClockTime) {
- fn get_pts(&self) -> gst::ClockTime {
+ fn pts(&self) -> gst::ClockTime {
self.0
}
- fn get_dts(&self) -> gst::ClockTime {
+ fn dts(&self) -> gst::ClockTime {
self.0
}
@@ -217,11 +217,11 @@ impl HandleData for (gst::ClockTime, gst::ClockTime) {
}
impl HandleData for gst::Buffer {
- fn get_pts(&self) -> gst::ClockTime {
+ fn pts(&self) -> gst::ClockTime {
gst::BufferRef::get_pts(self)
}
- fn get_dts(&self) -> gst::ClockTime {
+ fn dts(&self) -> gst::ClockTime {
gst::BufferRef::get_dts(self)
}
@@ -246,7 +246,7 @@ impl HandleData for gst::Buffer {
return gst::CLOCK_TIME_NONE;
}
- let size = self.get_size() as u64;
+ let size = self.size() as u64;
let num_samples = size / audio_info.bpf() as u64;
gst::SECOND
.mul_div_floor(num_samples, audio_info.rate() as u64)
@@ -273,7 +273,7 @@ impl HandleData for gst::Buffer {
} else if let Some(ref video_info) = state.video_info {
if video_info.format() == gst_video::VideoFormat::Unknown
|| video_info.format() == gst_video::VideoFormat::Encoded
- || self.get_dts_or_pts() != self.get_pts()
+ || self.dts_or_pts() != self.pts()
{
return false;
}
@@ -355,7 +355,7 @@ impl ToggleRecord {
) -> Result<HandleResult<T>, gst::FlowError> {
let mut state = stream.state.lock();
- let mut dts_or_pts = data.get_dts_or_pts();
+ let mut dts_or_pts = data.dts_or_pts();
let duration = data.get_duration(&state);
if !dts_or_pts.is_some() {
@@ -382,11 +382,11 @@ impl ToggleRecord {
};
// This will only do anything for non-raw data
- dts_or_pts = state.in_segment.get_start().max(dts_or_pts).unwrap();
- dts_or_pts_end = state.in_segment.get_start().max(dts_or_pts_end).unwrap();
- if state.in_segment.get_stop().is_some() {
- dts_or_pts = state.in_segment.get_stop().min(dts_or_pts).unwrap();
- dts_or_pts_end = state.in_segment.get_stop().min(dts_or_pts_end).unwrap();
+ dts_or_pts = state.in_segment.start().max(dts_or_pts).unwrap();
+ dts_or_pts_end = state.in_segment.start().max(dts_or_pts_end).unwrap();
+ if state.in_segment.stop().is_some() {
+ dts_or_pts = state.in_segment.stop().min(dts_or_pts).unwrap();
+ dts_or_pts_end = state.in_segment.stop().min(dts_or_pts_end).unwrap();
}
let current_running_time = state.in_segment.to_running_time(dts_or_pts);
@@ -609,7 +609,7 @@ impl ToggleRecord {
// Calculate end pts & current running time and make sure we stay in the segment
let mut state = stream.state.lock();
- let mut pts = data.get_pts();
+ let mut pts = data.pts();
let duration = data.get_duration(&state);
if pts.is_none() {
@@ -617,7 +617,7 @@ impl ToggleRecord {
return Err(gst::FlowError::Error);
}
- let dts = data.get_dts();
+ let dts = data.dts();
if dts.is_some() && pts.is_some() && dts != pts {
gst::element_error!(
element,
@@ -651,11 +651,11 @@ impl ToggleRecord {
};
// This will only do anything for non-raw data
- pts = state.in_segment.get_start().max(pts).unwrap();
- pts_end = state.in_segment.get_start().max(pts_end).unwrap();
- if state.in_segment.get_stop().is_some() {
- pts = state.in_segment.get_stop().min(pts).unwrap();
- pts_end = state.in_segment.get_stop().min(pts_end).unwrap();
+ pts = state.in_segment.start().max(pts).unwrap();
+ pts_end = state.in_segment.start().max(pts_end).unwrap();
+ if state.in_segment.stop().is_some() {
+ pts = state.in_segment.stop().min(pts).unwrap();
+ pts_end = state.in_segment.stop().min(pts_end).unwrap();
}
let current_running_time = state.in_segment.to_running_time(pts);
@@ -762,13 +762,13 @@ impl ToggleRecord {
.in_segment
.position_from_running_time(rec_state.last_recording_start);
if clip_start.is_none() {
- clip_start = state.in_segment.get_start();
+ clip_start = state.in_segment.start();
}
let mut clip_stop = state
.in_segment
.position_from_running_time(rec_state.last_recording_stop);
if clip_stop.is_none() {
- clip_stop = state.in_segment.get_stop();
+ clip_stop = state.in_segment.stop();
}
let mut segment = state.in_segment.clone();
segment.set_start(clip_start);
@@ -813,13 +813,13 @@ impl ToggleRecord {
.in_segment
.position_from_running_time(rec_state.last_recording_start);
if clip_start.is_none() {
- clip_start = state.in_segment.get_start();
+ clip_start = state.in_segment.start();
}
let mut clip_stop = state
.in_segment
.position_from_running_time(rec_state.last_recording_stop);
if clip_stop.is_none() {
- clip_stop = state.in_segment.get_stop();
+ clip_stop = state.in_segment.stop();
}
let mut segment = state.in_segment.clone();
segment.set_start(clip_start);
@@ -928,7 +928,7 @@ impl ToggleRecord {
.in_segment
.position_from_running_time(rec_state.last_recording_stop);
if clip_stop.is_none() {
- clip_stop = state.in_segment.get_stop();
+ clip_stop = state.in_segment.stop();
}
let mut segment = state.in_segment.clone();
segment.set_stop(clip_stop);
@@ -1004,7 +1004,7 @@ impl ToggleRecord {
.in_segment
.position_from_running_time(rec_state.last_recording_start);
if clip_start.is_none() {
- clip_start = state.in_segment.get_start();
+ clip_start = state.in_segment.start();
}
let mut segment = state.in_segment.clone();
segment.set_start(clip_start);
@@ -1084,7 +1084,7 @@ impl ToggleRecord {
gst::element_error!(
element,
gst::CoreError::Pad,
- ["Unknown pad {:?}", pad.get_name()]
+ ["Unknown pad {:?}", pad.name()]
);
gst::FlowError::Error
})?;
@@ -1172,7 +1172,7 @@ impl ToggleRecord {
events.append(&mut state.pending_events);
- let out_running_time = state.out_segment.to_running_time(buffer.get_pts());
+ let out_running_time = state.out_segment.to_running_time(buffer.pts());
// Unlock before pushing
drop(state);
@@ -1207,7 +1207,7 @@ impl ToggleRecord {
gst::element_error!(
element,
gst::CoreError::Pad,
- ["Unknown pad {:?}", pad.get_name()]
+ ["Unknown pad {:?}", pad.name()]
);
return false;
}
@@ -1244,13 +1244,13 @@ impl ToggleRecord {
}
EventView::Caps(c) => {
let mut state = stream.state.lock();
- let caps = c.get_caps();
+ let caps = c.caps();
let s = caps.get_structure(0).unwrap();
- if s.get_name().starts_with("audio/") {
+ if s.name().starts_with("audio/") {
state.audio_info = gst_audio::AudioInfo::from_caps(caps).ok();
gst_log!(CAT, obj: pad, "Got audio caps {:?}", state.audio_info);
state.video_info = None;
- } else if s.get_name().starts_with("video/") {
+ } else if s.name().starts_with("video/") {
state.audio_info = None;
state.video_info = gst_video::VideoInfo::from_caps(caps).ok();
gst_log!(CAT, obj: pad, "Got video caps {:?}", state.video_info);
@@ -1262,35 +1262,32 @@ impl ToggleRecord {
EventView::Segment(e) => {
let mut state = stream.state.lock();
- let segment = match e.get_segment().clone().downcast::<gst::ClockTime>() {
+ let segment = match e.segment().clone().downcast::<gst::ClockTime>() {
Err(segment) => {
gst::element_error!(
element,
gst::StreamError::Format,
- [
- "Only Time segments supported, got {:?}",
- segment.get_format(),
- ]
+ ["Only Time segments supported, got {:?}", segment.format(),]
);
return false;
}
Ok(segment) => segment,
};
- if (segment.get_rate() - 1.0).abs() > f64::EPSILON {
+ if (segment.rate() - 1.0).abs() > f64::EPSILON {
gst::element_error!(
element,
gst::StreamError::Format,
[
"Only rate==1.0 segments supported, got {:?}",
- segment.get_rate(),
+ segment.rate(),
]
);
return false;
}
state.in_segment = segment;
- state.segment_seqnum = event.get_seqnum();
+ state.segment_seqnum = event.seqnum();
state.segment_pending = true;
state.current_running_time = gst::CLOCK_TIME_NONE;
state.current_running_time_end = gst::CLOCK_TIME_NONE;
@@ -1358,7 +1355,7 @@ impl ToggleRecord {
// If a serialized event and coming after Segment and a new Segment is pending,
// queue up and send at a later time (buffer/gap) after we sent the Segment
- let type_ = event.get_type();
+ let type_ = event.type_();
if forward
&& type_ != gst::EventType::Eos
&& type_.is_serialized()
@@ -1413,7 +1410,7 @@ impl ToggleRecord {
gst::element_error!(
element,
gst::CoreError::Pad,
- ["Unknown pad {:?}", pad.get_name()]
+ ["Unknown pad {:?}", pad.name()]
);
return false;
}
@@ -1441,7 +1438,7 @@ impl ToggleRecord {
gst::element_error!(
element,
gst::CoreError::Pad,
- ["Unknown pad {:?}", pad.get_name()]
+ ["Unknown pad {:?}", pad.name()]
);
return false;
}
@@ -1454,7 +1451,7 @@ impl ToggleRecord {
let rec_state = self.state.lock();
let running_time_offset = rec_state.running_time_offset.unwrap_or(0) as i64;
- let offset = event.get_running_time_offset();
+ let offset = event.running_time_offset();
event
.make_mut()
.set_running_time_offset(offset + running_time_offset);
@@ -1482,7 +1479,7 @@ impl ToggleRecord {
gst::element_error!(
element,
gst::CoreError::Pad,
- ["Unknown pad {:?}", pad.get_name()]
+ ["Unknown pad {:?}", pad.name()]
);
return false;
}
@@ -1500,34 +1497,34 @@ impl ToggleRecord {
gst_log!(CAT, obj: pad, "Downstream returned {:?}", new_query);
- let (flags, min, max, align) = new_query.get_result();
+ let (flags, min, max, align) = new_query.result();
q.set(flags, min, max, align);
q.add_scheduling_modes(
&new_query
- .get_scheduling_modes()
+ .scheduling_modes()
.iter()
.cloned()
.filter(|m| m != &gst::PadMode::Pull)
.collect::<Vec<_>>(),
);
- gst_log!(CAT, obj: pad, "Returning {:?}", q.get_mut_query());
+ gst_log!(CAT, obj: pad, "Returning {:?}", q.query_mut());
true
}
QueryView::Seeking(ref mut q) => {
// Seeking is not possible here
- let format = q.get_format();
+ let format = q.format();
q.set(
false,
gst::GenericFormattedValue::new(format, -1),
gst::GenericFormattedValue::new(format, -1),
);
- gst_log!(CAT, obj: pad, "Returning {:?}", q.get_mut_query());
+ gst_log!(CAT, obj: pad, "Returning {:?}", q.query_mut());
true
}
// Position and duration is always the current recording position
QueryView::Position(ref mut q) => {
- if q.get_format() == gst::Format::Time {
+ if q.format() == gst::Format::Time {
let state = stream.state.lock();
let rec_state = self.state.lock();
let mut recording_duration = rec_state.recording_duration;
@@ -1556,7 +1553,7 @@ impl ToggleRecord {
}
}
QueryView::Duration(ref mut q) => {
- if q.get_format() == gst::Format::Time {
+ if q.format() == gst::Format::Time {
let state = stream.state.lock();
let rec_state = self.state.lock();
let mut recording_duration = rec_state.recording_duration;
@@ -1601,7 +1598,7 @@ impl ToggleRecord {
gst::element_error!(
element,
gst::CoreError::Pad,
- ["Unknown pad {:?}", pad.get_name()]
+ ["Unknown pad {:?}", pad.name()]
);
return gst::Iterator::from_vec(vec![]);
}
@@ -1728,7 +1725,7 @@ impl ObjectImpl for ToggleRecord {
value: &glib::Value,
pspec: &glib::ParamSpec,
) {
- match pspec.get_name() {
+ match pspec.name() {
"record" => {
let mut settings = self.settings.lock();
let record = value.get_some().expect("type checked upstream");
@@ -1747,7 +1744,7 @@ impl ObjectImpl for ToggleRecord {
}
fn get_property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
- match pspec.get_name() {
+ match pspec.name() {
"record" => {
let settings = self.settings.lock();
settings.record.to_value()
diff --git a/utils/togglerecord/tests/tests.rs b/utils/togglerecord/tests/tests.rs
index 75e9e16bb..3f6d2fa1d 100644
--- a/utils/togglerecord/tests/tests.rs
+++ b/utils/togglerecord/tests/tests.rs
@@ -214,9 +214,9 @@ fn recv_buffers(
match val {
Left(buffer) => {
res.push((
- segment.to_running_time(buffer.get_pts()),
- buffer.get_pts(),
- buffer.get_duration(),
+ segment.to_running_time(buffer.pts()),
+ buffer.pts(),
+ buffer.duration(),
));
n_buffers += 1;
if wait_buffers > 0 && n_buffers == wait_buffers {
@@ -241,7 +241,7 @@ fn recv_buffers(
return (res, saw_eos);
}
EventView::Segment(ref e) => {
- *segment = e.get_segment().clone().downcast().unwrap();
+ *segment = e.segment().clone().downcast().unwrap();
}
_ => (),
}
@@ -266,12 +266,12 @@ fn test_create_pads() {
let sinkpad = togglerecord.get_request_pad("sink_%u").unwrap();
let srcpad = sinkpad.iterate_internal_links().next().unwrap().unwrap();
- assert_eq!(sinkpad.get_name(), "sink_0");
- assert_eq!(srcpad.get_name(), "src_0");
+ assert_eq!(sinkpad.name(), "sink_0");
+ assert_eq!(srcpad.name(), "src_0");
togglerecord.release_request_pad(&sinkpad);
- assert!(sinkpad.get_parent().is_none());
- assert!(srcpad.get_parent().is_none());
+ assert!(sinkpad.parent().is_none());
+ assert!(srcpad.parent().is_none());
}
#[test]