gstreamer-rs/gstreamer-base/src/auto/aggregator.rs

347 lines
11 KiB
Rust
Raw Normal View History

// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
use crate::{AggregatorPad, AggregatorStartTimeSelection};
use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::{boxed::Box as Box_, mem::transmute};
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstAggregator")]
2020-11-21 17:59:12 +00:00
pub struct Aggregator(Object<ffi::GstAggregator, ffi::GstAggregatorClass>) @extends gst::Element, gst::Object;
match fn {
type_ => || ffi::gst_aggregator_get_type(),
}
}
2021-11-03 17:28:46 +00:00
impl Aggregator {
pub const NONE: Option<&'static Aggregator> = None;
}
2019-01-16 11:32:39 +00:00
2021-11-16 14:02:58 +00:00
unsafe impl Send for Aggregator {}
unsafe impl Sync for Aggregator {}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::Aggregator>> Sealed for T {}
}
pub trait AggregatorExt: IsA<Aggregator> + sealed::Sealed + 'static {
#[doc(alias = "gst_aggregator_finish_buffer")]
fn finish_buffer(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
try_from_glib(ffi::gst_aggregator_finish_buffer(
self.as_ref().to_glib_none().0,
buffer.into_glib_ptr(),
))
}
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_aggregator_finish_buffer_list")]
fn finish_buffer_list(
&self,
bufferlist: gst::BufferList,
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
try_from_glib(ffi::gst_aggregator_finish_buffer_list(
self.as_ref().to_glib_none().0,
bufferlist.into_glib_ptr(),
))
}
}
#[doc(alias = "gst_aggregator_get_buffer_pool")]
#[doc(alias = "get_buffer_pool")]
2021-04-11 19:38:18 +00:00
fn buffer_pool(&self) -> Option<gst::BufferPool> {
unsafe {
2020-11-21 17:59:12 +00:00
from_glib_full(ffi::gst_aggregator_get_buffer_pool(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(alias = "gst_aggregator_get_force_live")]
#[doc(alias = "get_force_live")]
fn is_force_live(&self) -> bool {
unsafe {
from_glib(ffi::gst_aggregator_get_force_live(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_aggregator_get_ignore_inactive_pads")]
#[doc(alias = "get_ignore_inactive_pads")]
2021-10-30 11:27:17 +00:00
fn ignores_inactive_pads(&self) -> bool {
unsafe {
from_glib(ffi::gst_aggregator_get_ignore_inactive_pads(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "gst_aggregator_get_latency")]
#[doc(alias = "get_latency")]
fn latency(&self) -> Option<gst::ClockTime> {
unsafe {
2020-11-21 17:59:12 +00:00
from_glib(ffi::gst_aggregator_get_latency(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_aggregator_negotiate")]
2020-04-30 16:51:41 +00:00
fn negotiate(&self) -> bool {
unsafe {
2020-11-21 17:59:12 +00:00
from_glib(ffi::gst_aggregator_negotiate(
2020-04-30 16:51:41 +00:00
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_aggregator_peek_next_sample")]
fn peek_next_sample(&self, pad: &impl IsA<AggregatorPad>) -> Option<gst::Sample> {
2020-08-11 07:49:37 +00:00
unsafe {
2020-11-21 17:59:12 +00:00
from_glib_full(ffi::gst_aggregator_peek_next_sample(
2020-08-11 07:49:37 +00:00
self.as_ref().to_glib_none().0,
pad.as_ref().to_glib_none().0,
))
}
}
#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(alias = "gst_aggregator_set_force_live")]
fn set_force_live(&self, force_live: bool) {
unsafe {
ffi::gst_aggregator_set_force_live(
self.as_ref().to_glib_none().0,
force_live.into_glib(),
);
}
}
#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_aggregator_set_ignore_inactive_pads")]
2021-10-30 11:27:17 +00:00
fn set_ignore_inactive_pads(&self, ignore: bool) {
unsafe {
ffi::gst_aggregator_set_ignore_inactive_pads(
self.as_ref().to_glib_none().0,
ignore.into_glib(),
);
}
}
#[doc(alias = "gst_aggregator_set_latency")]
fn set_latency(
&self,
min_latency: gst::ClockTime,
max_latency: impl Into<Option<gst::ClockTime>>,
) {
unsafe {
2020-11-21 17:59:12 +00:00
ffi::gst_aggregator_set_latency(
self.as_ref().to_glib_none().0,
min_latency.into_glib(),
max_latency.into().into_glib(),
);
}
}
#[doc(alias = "gst_aggregator_set_src_caps")]
fn set_src_caps(&self, caps: &gst::Caps) {
unsafe {
2020-11-21 17:59:12 +00:00
ffi::gst_aggregator_set_src_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0);
}
}
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "gst_aggregator_simple_get_next_time")]
fn simple_get_next_time(&self) -> Option<gst::ClockTime> {
2019-04-23 14:32:09 +00:00
unsafe {
2020-11-21 17:59:12 +00:00
from_glib(ffi::gst_aggregator_simple_get_next_time(
self.as_ref().to_glib_none().0,
))
2019-04-23 14:32:09 +00:00
}
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "emit-signals")]
2021-04-11 19:38:18 +00:00
fn emits_signals(&self) -> bool {
ObjectExt::property(self.as_ref(), "emit-signals")
2020-08-11 07:49:37 +00:00
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "emit-signals")]
2021-04-11 19:38:18 +00:00
fn set_emit_signals(&self, emit_signals: bool) {
ObjectExt::set_property(self.as_ref(), "emit-signals", emit_signals)
2020-08-11 07:49:37 +00:00
}
#[doc(alias = "start-time")]
2021-04-11 19:38:18 +00:00
fn start_time(&self) -> u64 {
ObjectExt::property(self.as_ref(), "start-time")
}
#[doc(alias = "start-time")]
2021-04-11 19:38:18 +00:00
fn set_start_time(&self, start_time: u64) {
ObjectExt::set_property(self.as_ref(), "start-time", start_time)
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "start-time-selection")]
2021-04-11 19:38:18 +00:00
fn start_time_selection(&self) -> AggregatorStartTimeSelection {
ObjectExt::property(self.as_ref(), "start-time-selection")
2020-07-06 08:37:14 +00:00
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "start-time-selection")]
2021-04-11 19:38:18 +00:00
fn set_start_time_selection(&self, start_time_selection: AggregatorStartTimeSelection) {
ObjectExt::set_property(self.as_ref(), "start-time-selection", start_time_selection)
2020-07-06 08:37:14 +00:00
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "emit-signals")]
fn connect_emit_signals_notify<F: Fn(&Self) + Send + Sync + 'static>(
2020-08-11 07:49:37 +00:00
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_emit_signals_trampoline<
P: IsA<Aggregator>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstAggregator,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2020-08-11 07:49:37 +00:00
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(Aggregator::from_glib_borrow(this).unsafe_cast_ref())
2020-08-11 07:49:37 +00:00
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::emit-signals\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_emit_signals_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "latency")]
fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_latency_trampoline<
P: IsA<Aggregator>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstAggregator,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2019-06-18 10:10:46 +00:00
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(Aggregator::from_glib_borrow(this).unsafe_cast_ref())
2019-06-18 10:10:46 +00:00
}
unsafe {
2019-01-29 13:53:44 +00:00
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::latency\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_latency_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "start-time")]
fn connect_start_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_start_time_trampoline<
P: IsA<Aggregator>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstAggregator,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2019-06-18 10:10:46 +00:00
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(Aggregator::from_glib_borrow(this).unsafe_cast_ref())
2019-06-18 10:10:46 +00:00
}
unsafe {
2019-01-29 13:53:44 +00:00
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::start-time\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_start_time_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
2020-07-06 08:37:14 +00:00
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "start-time-selection")]
fn connect_start_time_selection_notify<F: Fn(&Self) + Send + Sync + 'static>(
2020-07-06 08:37:14 +00:00
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_start_time_selection_trampoline<
P: IsA<Aggregator>,
2020-07-06 08:37:14 +00:00
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstAggregator,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2020-07-06 08:37:14 +00:00
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(Aggregator::from_glib_borrow(this).unsafe_cast_ref())
2020-07-06 08:37:14 +00:00
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::start-time-selection\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_start_time_selection_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl<O: IsA<Aggregator>> AggregatorExt for O {}