fallbackswitch: update base/aggregator*

This commit is contained in:
François Laignel 2021-04-17 11:00:16 +02:00
parent 67c5871957
commit 3203f57748
2 changed files with 25 additions and 12 deletions

View file

@ -17,7 +17,7 @@ glib::wrapper! {
pub struct Aggregator(Object<ffi::GstAggregator, ffi::GstAggregatorClass>) @extends gst::Element, gst::Object;
match fn {
get_type => || ffi::gst_aggregator_get_type(),
type_ => || ffi::gst_aggregator_get_type(),
}
}
@ -36,14 +36,22 @@ pub trait AggregatorExt: 'static {
#[doc(alias = "gst_aggregator_get_latency")]
fn latency(&self) -> gst::ClockTime;
#[doc(alias = "gst_aggregator_negotiate")]
fn negotiate(&self) -> bool;
#[doc(alias = "gst_aggregator_set_latency")]
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime);
#[doc(alias = "gst_aggregator_set_src_caps")]
fn set_src_caps(&self, caps: &gst::Caps);
#[doc(alias = "gst_aggregator_simple_get_next_time")]
fn simple_get_next_time(&self) -> gst::ClockTime;
#[doc(alias = "get_property_start_time")]
fn start_time(&self) -> u64;
#[doc(alias = "set_property_start_time")]
fn set_start_time(&self, start_time: u64);
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
@ -55,8 +63,6 @@ pub trait AggregatorExt: 'static {
&self,
f: F,
) -> SignalHandlerId;
fn negotiate(&self) -> bool;
}
impl<O: IsA<Aggregator>> AggregatorExt for O {
@ -80,6 +86,14 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
}
}
fn negotiate(&self) -> bool {
unsafe {
from_glib(ffi::gst_aggregator_negotiate(
self.as_ref().to_glib_none().0,
))
}
}
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime) {
unsafe {
ffi::gst_aggregator_set_latency(
@ -182,12 +196,4 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
)
}
}
fn negotiate(&self) -> bool {
unsafe {
from_glib(ffi::gst_aggregator_negotiate(
self.as_ref().to_glib_none().0,
))
}
}
}

View file

@ -16,7 +16,7 @@ glib::wrapper! {
pub struct AggregatorPad(Object<ffi::GstAggregatorPad, ffi::GstAggregatorPadClass>) @extends gst::Pad, gst::Object;
match fn {
get_type => || ffi::gst_aggregator_pad_get_type(),
type_ => || ffi::gst_aggregator_pad_get_type(),
}
}
@ -26,18 +26,25 @@ unsafe impl Sync for AggregatorPad {}
pub const NONE_AGGREGATOR_PAD: Option<&AggregatorPad> = None;
pub trait AggregatorPadExt: 'static {
#[doc(alias = "gst_aggregator_pad_drop_buffer")]
fn drop_buffer(&self) -> bool;
#[doc(alias = "gst_aggregator_pad_has_buffer")]
fn has_buffer(&self) -> bool;
#[doc(alias = "gst_aggregator_pad_is_eos")]
fn is_eos(&self) -> bool;
#[doc(alias = "gst_aggregator_pad_peek_buffer")]
fn peek_buffer(&self) -> Option<gst::Buffer>;
#[doc(alias = "gst_aggregator_pad_pop_buffer")]
fn pop_buffer(&self) -> Option<gst::Buffer>;
#[doc(alias = "get_property_emit_signals")]
fn emits_signals(&self) -> bool;
#[doc(alias = "set_property_emit_signals")]
fn set_emit_signals(&self, emit_signals: bool);
fn connect_buffer_consumed<F: Fn(&Self, &gst::Buffer) + Send + Sync + 'static>(