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

653 lines
21 KiB
Rust
Raw Normal View History

2018-04-23 17:34:22 +00:00
// 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
use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::boxed::Box as Box_;
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstBaseSink")]
2020-11-21 17:59:12 +00:00
pub struct BaseSink(Object<ffi::GstBaseSink, ffi::GstBaseSinkClass>) @extends gst::Element, gst::Object;
match fn {
type_ => || ffi::gst_base_sink_get_type(),
}
}
2021-11-03 17:28:46 +00:00
impl BaseSink {
pub const NONE: Option<&'static BaseSink> = None;
}
2019-01-16 11:32:39 +00:00
2021-11-16 14:02:58 +00:00
unsafe impl Send for BaseSink {}
unsafe impl Sync for BaseSink {}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::BaseSink>> Sealed for T {}
}
pub trait BaseSinkExt: IsA<BaseSink> + sealed::Sealed + 'static {
//#[doc(alias = "gst_base_sink_do_preroll")]
//fn do_preroll(&self, obj: /*Ignored*/&gst::MiniObject) -> Result<gst::FlowSuccess, gst::FlowError> {
2020-11-21 17:59:12 +00:00
// unsafe { TODO: call ffi:gst_base_sink_do_preroll() }
//}
#[doc(alias = "gst_base_sink_get_blocksize")]
#[doc(alias = "get_blocksize")]
2021-04-11 19:38:18 +00:00
fn blocksize(&self) -> u32 {
2020-11-21 17:59:12 +00:00
unsafe { ffi::gst_base_sink_get_blocksize(self.as_ref().to_glib_none().0) }
}
#[doc(alias = "gst_base_sink_get_drop_out_of_segment")]
#[doc(alias = "get_drop_out_of_segment")]
fn drops_out_of_segment(&self) -> bool {
unsafe {
2020-11-21 17:59:12 +00:00
from_glib(ffi::gst_base_sink_get_drop_out_of_segment(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "gst_base_sink_get_last_sample")]
#[doc(alias = "get_last_sample")]
2021-04-11 19:38:18 +00:00
fn last_sample(&self) -> Option<gst::Sample> {
unsafe {
2020-11-21 17:59:12 +00:00
from_glib_full(ffi::gst_base_sink_get_last_sample(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "gst_base_sink_get_latency")]
#[doc(alias = "get_latency")]
2021-04-11 19:38:18 +00:00
fn latency(&self) -> gst::ClockTime {
unsafe {
try_from_glib(ffi::gst_base_sink_get_latency(
self.as_ref().to_glib_none().0,
))
.expect("mandatory glib value is None")
}
}
#[doc(alias = "gst_base_sink_get_max_bitrate")]
#[doc(alias = "get_max_bitrate")]
2021-04-11 19:38:18 +00:00
fn max_bitrate(&self) -> u64 {
2020-11-21 17:59:12 +00:00
unsafe { ffi::gst_base_sink_get_max_bitrate(self.as_ref().to_glib_none().0) }
}
#[doc(alias = "gst_base_sink_get_max_lateness")]
#[doc(alias = "get_max_lateness")]
2021-04-11 19:38:18 +00:00
fn max_lateness(&self) -> i64 {
2020-11-21 17:59:12 +00:00
unsafe { ffi::gst_base_sink_get_max_lateness(self.as_ref().to_glib_none().0) }
}
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "gst_base_sink_get_processing_deadline")]
#[doc(alias = "get_processing_deadline")]
2021-04-11 19:38:18 +00:00
fn processing_deadline(&self) -> gst::ClockTime {
2019-04-23 14:32:09 +00:00
unsafe {
try_from_glib(ffi::gst_base_sink_get_processing_deadline(
self.as_ref().to_glib_none().0,
))
.expect("mandatory glib value is None")
2019-04-23 14:32:09 +00:00
}
}
#[doc(alias = "gst_base_sink_get_render_delay")]
#[doc(alias = "get_render_delay")]
2021-04-11 19:38:18 +00:00
fn render_delay(&self) -> gst::ClockTime {
unsafe {
try_from_glib(ffi::gst_base_sink_get_render_delay(
self.as_ref().to_glib_none().0,
))
.expect("mandatory glib value is None")
}
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_base_sink_get_stats")]
#[doc(alias = "get_stats")]
2021-04-11 19:38:18 +00:00
fn stats(&self) -> gst::Structure {
2020-11-21 17:59:12 +00:00
unsafe { from_glib_full(ffi::gst_base_sink_get_stats(self.as_ref().to_glib_none().0)) }
2020-04-30 16:51:41 +00:00
}
#[doc(alias = "gst_base_sink_get_sync")]
#[doc(alias = "get_sync")]
2021-04-11 19:38:18 +00:00
fn is_sync(&self) -> bool {
2020-11-21 17:59:12 +00:00
unsafe { from_glib(ffi::gst_base_sink_get_sync(self.as_ref().to_glib_none().0)) }
}
#[doc(alias = "gst_base_sink_get_throttle_time")]
#[doc(alias = "get_throttle_time")]
2021-04-11 19:38:18 +00:00
fn throttle_time(&self) -> u64 {
2020-11-21 17:59:12 +00:00
unsafe { ffi::gst_base_sink_get_throttle_time(self.as_ref().to_glib_none().0) }
}
#[doc(alias = "gst_base_sink_get_ts_offset")]
#[doc(alias = "get_ts_offset")]
2021-04-11 19:38:18 +00:00
fn ts_offset(&self) -> gst::ClockTimeDiff {
2020-11-21 17:59:12 +00:00
unsafe { ffi::gst_base_sink_get_ts_offset(self.as_ref().to_glib_none().0) }
}
#[doc(alias = "gst_base_sink_set_blocksize")]
fn set_blocksize(&self, blocksize: u32) {
unsafe {
2020-11-21 17:59:12 +00:00
ffi::gst_base_sink_set_blocksize(self.as_ref().to_glib_none().0, blocksize);
}
}
#[doc(alias = "gst_base_sink_set_drop_out_of_segment")]
fn set_drop_out_of_segment(&self, drop_out_of_segment: bool) {
unsafe {
2020-11-21 17:59:12 +00:00
ffi::gst_base_sink_set_drop_out_of_segment(
self.as_ref().to_glib_none().0,
drop_out_of_segment.into_glib(),
);
}
}
#[doc(alias = "gst_base_sink_set_max_bitrate")]
fn set_max_bitrate(&self, max_bitrate: u64) {
unsafe {
2020-11-21 17:59:12 +00:00
ffi::gst_base_sink_set_max_bitrate(self.as_ref().to_glib_none().0, max_bitrate);
}
}
#[doc(alias = "gst_base_sink_set_max_lateness")]
fn set_max_lateness(&self, max_lateness: i64) {
unsafe {
2020-11-21 17:59:12 +00:00
ffi::gst_base_sink_set_max_lateness(self.as_ref().to_glib_none().0, max_lateness);
}
}
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "gst_base_sink_set_processing_deadline")]
2019-04-23 14:32:09 +00:00
fn set_processing_deadline(&self, processing_deadline: gst::ClockTime) {
unsafe {
2020-11-21 17:59:12 +00:00
ffi::gst_base_sink_set_processing_deadline(
self.as_ref().to_glib_none().0,
processing_deadline.into_glib(),
);
2019-04-23 14:32:09 +00:00
}
}
#[doc(alias = "gst_base_sink_set_render_delay")]
fn set_render_delay(&self, delay: gst::ClockTime) {
unsafe {
ffi::gst_base_sink_set_render_delay(self.as_ref().to_glib_none().0, delay.into_glib());
}
}
#[doc(alias = "gst_base_sink_set_sync")]
fn set_sync(&self, sync: bool) {
unsafe {
ffi::gst_base_sink_set_sync(self.as_ref().to_glib_none().0, sync.into_glib());
}
}
#[doc(alias = "gst_base_sink_set_throttle_time")]
fn set_throttle_time(&self, throttle: u64) {
unsafe {
2020-11-21 17:59:12 +00:00
ffi::gst_base_sink_set_throttle_time(self.as_ref().to_glib_none().0, throttle);
}
}
#[doc(alias = "gst_base_sink_set_ts_offset")]
fn set_ts_offset(&self, offset: gst::ClockTimeDiff) {
unsafe {
2020-11-21 17:59:12 +00:00
ffi::gst_base_sink_set_ts_offset(self.as_ref().to_glib_none().0, offset);
}
}
#[doc(alias = "gst_base_sink_wait")]
fn wait(
&self,
time: impl Into<Option<gst::ClockTime>>,
) -> (Result<gst::FlowSuccess, gst::FlowError>, gst::ClockTimeDiff) {
unsafe {
let mut jitter = std::mem::MaybeUninit::uninit();
2021-05-23 16:27:13 +00:00
let ret = try_from_glib(ffi::gst_base_sink_wait(
self.as_ref().to_glib_none().0,
time.into().into_glib(),
jitter.as_mut_ptr(),
));
2022-05-18 20:27:53 +00:00
(ret, jitter.assume_init())
}
}
#[doc(alias = "gst_base_sink_wait_clock")]
fn wait_clock(
&self,
time: gst::ClockTime,
) -> (
Result<gst::ClockSuccess, gst::ClockError>,
gst::ClockTimeDiff,
) {
unsafe {
let mut jitter = std::mem::MaybeUninit::uninit();
2021-05-23 16:27:13 +00:00
let ret = try_from_glib(ffi::gst_base_sink_wait_clock(
self.as_ref().to_glib_none().0,
time.into_glib(),
jitter.as_mut_ptr(),
));
2022-05-18 20:27:53 +00:00
(ret, jitter.assume_init())
}
}
#[doc(alias = "gst_base_sink_wait_preroll")]
fn wait_preroll(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
2021-05-23 16:27:13 +00:00
try_from_glib(ffi::gst_base_sink_wait_preroll(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "async")]
2021-04-11 19:38:18 +00:00
fn is_async(&self) -> bool {
ObjectExt::property(self.as_ref(), "async")
}
#[doc(alias = "async")]
2021-04-11 19:38:18 +00:00
fn set_async(&self, async_: bool) {
ObjectExt::set_property(self.as_ref(), "async", async_)
}
#[doc(alias = "enable-last-sample")]
2021-04-11 19:38:18 +00:00
fn enables_last_sample(&self) -> bool {
ObjectExt::property(self.as_ref(), "enable-last-sample")
}
#[doc(alias = "enable-last-sample")]
2021-04-11 19:38:18 +00:00
fn set_enable_last_sample(&self, enable_last_sample: bool) {
ObjectExt::set_property(self.as_ref(), "enable-last-sample", enable_last_sample)
}
2021-04-11 19:38:18 +00:00
fn is_qos(&self) -> bool {
ObjectExt::property(self.as_ref(), "qos")
}
2021-04-11 19:38:18 +00:00
fn set_qos(&self, qos: bool) {
ObjectExt::set_property(self.as_ref(), "qos", qos)
}
#[doc(alias = "async")]
fn connect_async_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_async_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::async\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_async_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "blocksize")]
fn connect_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_blocksize_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::blocksize\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_blocksize_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "enable-last-sample")]
fn connect_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_enable_last_sample_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::enable-last-sample\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_enable_last_sample_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "last-sample")]
fn connect_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_last_sample_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::last-sample\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_last_sample_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "max-bitrate")]
fn connect_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_bitrate_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::max-bitrate\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_max_bitrate_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "max-lateness")]
fn connect_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_lateness_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::max-lateness\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_max_lateness_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "processing-deadline")]
fn connect_processing_deadline_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_processing_deadline_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
2019-06-18 10:10:46 +00:00
}
2019-04-23 14:32:09 +00:00
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::processing-deadline\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_processing_deadline_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "qos")]
fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::qos\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_qos_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "render-delay")]
fn connect_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_render_delay_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::render-delay\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_render_delay_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "stats")]
fn connect_stats_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_stats_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2020-04-30 16:51:41 +00:00
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
2020-04-30 16:51:41 +00:00
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::stats\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-30 16:51:41 +00:00
notify_stats_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "sync")]
fn connect_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_sync_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::sync\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_sync_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "throttle-time")]
fn connect_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_throttle_time_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::throttle-time\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_throttle_time_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "ts-offset")]
fn connect_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_ts_offset_trampoline<
P: IsA<BaseSink>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 17:59:12 +00:00
this: *mut ffi::GstBaseSink,
_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(BaseSink::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::ts-offset\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
2020-04-13 16:11:33 +00:00
notify_ts_offset_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl<O: IsA<BaseSink>> BaseSinkExt for O {}