Skip to main content

gstreamer_base/auto/
base_sink.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::{
8    prelude::*,
9    signal::{SignalHandlerId, connect_raw},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    #[doc(alias = "GstBaseSink")]
16    pub struct BaseSink(Object<ffi::GstBaseSink, ffi::GstBaseSinkClass>) @extends gst::Element, gst::Object;
17
18    match fn {
19        type_ => || ffi::gst_base_sink_get_type(),
20    }
21}
22
23impl BaseSink {
24    pub const NONE: Option<&'static BaseSink> = None;
25}
26
27unsafe impl Send for BaseSink {}
28unsafe impl Sync for BaseSink {}
29
30pub trait BaseSinkExt: IsA<BaseSink> + 'static {
31    //#[doc(alias = "gst_base_sink_do_preroll")]
32    //fn do_preroll(&self, obj: /*Ignored*/&gst::MiniObject) -> Result<gst::FlowSuccess, gst::FlowError> {
33    //    unsafe { TODO: call ffi:gst_base_sink_do_preroll() }
34    //}
35
36    #[doc(alias = "gst_base_sink_get_blocksize")]
37    #[doc(alias = "get_blocksize")]
38    fn blocksize(&self) -> u32 {
39        unsafe { ffi::gst_base_sink_get_blocksize(self.as_ref().to_glib_none().0) }
40    }
41
42    #[doc(alias = "gst_base_sink_get_drop_out_of_segment")]
43    #[doc(alias = "get_drop_out_of_segment")]
44    fn drops_out_of_segment(&self) -> bool {
45        unsafe {
46            from_glib(ffi::gst_base_sink_get_drop_out_of_segment(
47                self.as_ref().to_glib_none().0,
48            ))
49        }
50    }
51
52    #[doc(alias = "gst_base_sink_get_last_sample")]
53    #[doc(alias = "get_last_sample")]
54    #[doc(alias = "last-sample")]
55    fn last_sample(&self) -> Option<gst::Sample> {
56        unsafe {
57            from_glib_full(ffi::gst_base_sink_get_last_sample(
58                self.as_ref().to_glib_none().0,
59            ))
60        }
61    }
62
63    #[doc(alias = "gst_base_sink_get_latency")]
64    #[doc(alias = "get_latency")]
65    fn latency(&self) -> gst::ClockTime {
66        unsafe {
67            try_from_glib(ffi::gst_base_sink_get_latency(
68                self.as_ref().to_glib_none().0,
69            ))
70            .expect("mandatory glib value is None")
71        }
72    }
73
74    #[doc(alias = "gst_base_sink_get_max_bitrate")]
75    #[doc(alias = "get_max_bitrate")]
76    #[doc(alias = "max-bitrate")]
77    fn max_bitrate(&self) -> u64 {
78        unsafe { ffi::gst_base_sink_get_max_bitrate(self.as_ref().to_glib_none().0) }
79    }
80
81    #[doc(alias = "gst_base_sink_get_max_lateness")]
82    #[doc(alias = "get_max_lateness")]
83    #[doc(alias = "max-lateness")]
84    fn max_lateness(&self) -> i64 {
85        unsafe { ffi::gst_base_sink_get_max_lateness(self.as_ref().to_glib_none().0) }
86    }
87
88    #[cfg(feature = "v1_16")]
89    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
90    #[doc(alias = "gst_base_sink_get_processing_deadline")]
91    #[doc(alias = "get_processing_deadline")]
92    #[doc(alias = "processing-deadline")]
93    fn processing_deadline(&self) -> gst::ClockTime {
94        unsafe {
95            try_from_glib(ffi::gst_base_sink_get_processing_deadline(
96                self.as_ref().to_glib_none().0,
97            ))
98            .expect("mandatory glib value is None")
99        }
100    }
101
102    #[doc(alias = "gst_base_sink_get_render_delay")]
103    #[doc(alias = "get_render_delay")]
104    #[doc(alias = "render-delay")]
105    fn render_delay(&self) -> gst::ClockTime {
106        unsafe {
107            try_from_glib(ffi::gst_base_sink_get_render_delay(
108                self.as_ref().to_glib_none().0,
109            ))
110            .expect("mandatory glib value is None")
111        }
112    }
113
114    #[cfg(feature = "v1_18")]
115    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
116    #[doc(alias = "gst_base_sink_get_stats")]
117    #[doc(alias = "get_stats")]
118    fn stats(&self) -> gst::Structure {
119        unsafe { from_glib_full(ffi::gst_base_sink_get_stats(self.as_ref().to_glib_none().0)) }
120    }
121
122    #[doc(alias = "gst_base_sink_get_sync")]
123    #[doc(alias = "get_sync")]
124    #[doc(alias = "sync")]
125    fn is_sync(&self) -> bool {
126        unsafe { from_glib(ffi::gst_base_sink_get_sync(self.as_ref().to_glib_none().0)) }
127    }
128
129    #[doc(alias = "gst_base_sink_get_throttle_time")]
130    #[doc(alias = "get_throttle_time")]
131    #[doc(alias = "throttle-time")]
132    fn throttle_time(&self) -> u64 {
133        unsafe { ffi::gst_base_sink_get_throttle_time(self.as_ref().to_glib_none().0) }
134    }
135
136    #[doc(alias = "gst_base_sink_get_ts_offset")]
137    #[doc(alias = "get_ts_offset")]
138    #[doc(alias = "ts-offset")]
139    fn ts_offset(&self) -> gst::ClockTimeDiff {
140        unsafe { ffi::gst_base_sink_get_ts_offset(self.as_ref().to_glib_none().0) }
141    }
142
143    #[doc(alias = "gst_base_sink_set_blocksize")]
144    #[doc(alias = "blocksize")]
145    fn set_blocksize(&self, blocksize: u32) {
146        unsafe {
147            ffi::gst_base_sink_set_blocksize(self.as_ref().to_glib_none().0, blocksize);
148        }
149    }
150
151    #[doc(alias = "gst_base_sink_set_drop_out_of_segment")]
152    fn set_drop_out_of_segment(&self, drop_out_of_segment: bool) {
153        unsafe {
154            ffi::gst_base_sink_set_drop_out_of_segment(
155                self.as_ref().to_glib_none().0,
156                drop_out_of_segment.into_glib(),
157            );
158        }
159    }
160
161    #[doc(alias = "gst_base_sink_set_max_bitrate")]
162    #[doc(alias = "max-bitrate")]
163    fn set_max_bitrate(&self, max_bitrate: u64) {
164        unsafe {
165            ffi::gst_base_sink_set_max_bitrate(self.as_ref().to_glib_none().0, max_bitrate);
166        }
167    }
168
169    #[doc(alias = "gst_base_sink_set_max_lateness")]
170    #[doc(alias = "max-lateness")]
171    fn set_max_lateness(&self, max_lateness: i64) {
172        unsafe {
173            ffi::gst_base_sink_set_max_lateness(self.as_ref().to_glib_none().0, max_lateness);
174        }
175    }
176
177    #[cfg(feature = "v1_16")]
178    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
179    #[doc(alias = "gst_base_sink_set_processing_deadline")]
180    #[doc(alias = "processing-deadline")]
181    fn set_processing_deadline(&self, processing_deadline: gst::ClockTime) {
182        unsafe {
183            ffi::gst_base_sink_set_processing_deadline(
184                self.as_ref().to_glib_none().0,
185                processing_deadline.into_glib(),
186            );
187        }
188    }
189
190    #[doc(alias = "gst_base_sink_set_render_delay")]
191    #[doc(alias = "render-delay")]
192    fn set_render_delay(&self, delay: gst::ClockTime) {
193        unsafe {
194            ffi::gst_base_sink_set_render_delay(self.as_ref().to_glib_none().0, delay.into_glib());
195        }
196    }
197
198    #[doc(alias = "gst_base_sink_set_sync")]
199    #[doc(alias = "sync")]
200    fn set_sync(&self, sync: bool) {
201        unsafe {
202            ffi::gst_base_sink_set_sync(self.as_ref().to_glib_none().0, sync.into_glib());
203        }
204    }
205
206    #[doc(alias = "gst_base_sink_set_throttle_time")]
207    #[doc(alias = "throttle-time")]
208    fn set_throttle_time(&self, throttle: u64) {
209        unsafe {
210            ffi::gst_base_sink_set_throttle_time(self.as_ref().to_glib_none().0, throttle);
211        }
212    }
213
214    #[doc(alias = "gst_base_sink_set_ts_offset")]
215    #[doc(alias = "ts-offset")]
216    fn set_ts_offset(&self, offset: gst::ClockTimeDiff) {
217        unsafe {
218            ffi::gst_base_sink_set_ts_offset(self.as_ref().to_glib_none().0, offset);
219        }
220    }
221
222    #[doc(alias = "gst_base_sink_wait")]
223    fn wait(
224        &self,
225        time: impl Into<Option<gst::ClockTime>>,
226    ) -> (Result<gst::FlowSuccess, gst::FlowError>, gst::ClockTimeDiff) {
227        unsafe {
228            let mut jitter = std::mem::MaybeUninit::uninit();
229            let ret = try_from_glib(ffi::gst_base_sink_wait(
230                self.as_ref().to_glib_none().0,
231                time.into().into_glib(),
232                jitter.as_mut_ptr(),
233            ));
234            (ret, jitter.assume_init())
235        }
236    }
237
238    #[doc(alias = "gst_base_sink_wait_clock")]
239    fn wait_clock(
240        &self,
241        time: gst::ClockTime,
242    ) -> (
243        Result<gst::ClockSuccess, gst::ClockError>,
244        gst::ClockTimeDiff,
245    ) {
246        unsafe {
247            let mut jitter = std::mem::MaybeUninit::uninit();
248            let ret = try_from_glib(ffi::gst_base_sink_wait_clock(
249                self.as_ref().to_glib_none().0,
250                time.into_glib(),
251                jitter.as_mut_ptr(),
252            ));
253            (ret, jitter.assume_init())
254        }
255    }
256
257    #[doc(alias = "gst_base_sink_wait_preroll")]
258    fn wait_preroll(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
259        unsafe {
260            try_from_glib(ffi::gst_base_sink_wait_preroll(
261                self.as_ref().to_glib_none().0,
262            ))
263        }
264    }
265
266    #[doc(alias = "async")]
267    fn is_async(&self) -> bool {
268        ObjectExt::property(self.as_ref(), "async")
269    }
270
271    #[doc(alias = "async")]
272    fn set_async(&self, async_: bool) {
273        ObjectExt::set_property(self.as_ref(), "async", async_)
274    }
275
276    #[doc(alias = "enable-last-sample")]
277    fn enables_last_sample(&self) -> bool {
278        ObjectExt::property(self.as_ref(), "enable-last-sample")
279    }
280
281    #[doc(alias = "enable-last-sample")]
282    fn set_enable_last_sample(&self, enable_last_sample: bool) {
283        ObjectExt::set_property(self.as_ref(), "enable-last-sample", enable_last_sample)
284    }
285
286    fn is_qos(&self) -> bool {
287        ObjectExt::property(self.as_ref(), "qos")
288    }
289
290    fn set_qos(&self, qos: bool) {
291        ObjectExt::set_property(self.as_ref(), "qos", qos)
292    }
293
294    #[doc(alias = "async")]
295    fn connect_async_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
296        unsafe extern "C" fn notify_async_trampoline<
297            P: IsA<BaseSink>,
298            F: Fn(&P) + Send + Sync + 'static,
299        >(
300            this: *mut ffi::GstBaseSink,
301            _param_spec: glib::ffi::gpointer,
302            f: glib::ffi::gpointer,
303        ) {
304            unsafe {
305                let f: &F = &*(f as *const F);
306                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
307            }
308        }
309        unsafe {
310            let f: Box_<F> = Box_::new(f);
311            connect_raw(
312                self.as_ptr() as *mut _,
313                c"notify::async".as_ptr() as *const _,
314                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
315                    notify_async_trampoline::<Self, F> as *const (),
316                )),
317                Box_::into_raw(f),
318            )
319        }
320    }
321
322    #[doc(alias = "blocksize")]
323    fn connect_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
324        &self,
325        f: F,
326    ) -> SignalHandlerId {
327        unsafe extern "C" fn notify_blocksize_trampoline<
328            P: IsA<BaseSink>,
329            F: Fn(&P) + Send + Sync + 'static,
330        >(
331            this: *mut ffi::GstBaseSink,
332            _param_spec: glib::ffi::gpointer,
333            f: glib::ffi::gpointer,
334        ) {
335            unsafe {
336                let f: &F = &*(f as *const F);
337                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
338            }
339        }
340        unsafe {
341            let f: Box_<F> = Box_::new(f);
342            connect_raw(
343                self.as_ptr() as *mut _,
344                c"notify::blocksize".as_ptr() as *const _,
345                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
346                    notify_blocksize_trampoline::<Self, F> as *const (),
347                )),
348                Box_::into_raw(f),
349            )
350        }
351    }
352
353    #[doc(alias = "enable-last-sample")]
354    fn connect_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
355        &self,
356        f: F,
357    ) -> SignalHandlerId {
358        unsafe extern "C" fn notify_enable_last_sample_trampoline<
359            P: IsA<BaseSink>,
360            F: Fn(&P) + Send + Sync + 'static,
361        >(
362            this: *mut ffi::GstBaseSink,
363            _param_spec: glib::ffi::gpointer,
364            f: glib::ffi::gpointer,
365        ) {
366            unsafe {
367                let f: &F = &*(f as *const F);
368                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
369            }
370        }
371        unsafe {
372            let f: Box_<F> = Box_::new(f);
373            connect_raw(
374                self.as_ptr() as *mut _,
375                c"notify::enable-last-sample".as_ptr() as *const _,
376                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
377                    notify_enable_last_sample_trampoline::<Self, F> as *const (),
378                )),
379                Box_::into_raw(f),
380            )
381        }
382    }
383
384    #[doc(alias = "last-sample")]
385    fn connect_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
386        &self,
387        f: F,
388    ) -> SignalHandlerId {
389        unsafe extern "C" fn notify_last_sample_trampoline<
390            P: IsA<BaseSink>,
391            F: Fn(&P) + Send + Sync + 'static,
392        >(
393            this: *mut ffi::GstBaseSink,
394            _param_spec: glib::ffi::gpointer,
395            f: glib::ffi::gpointer,
396        ) {
397            unsafe {
398                let f: &F = &*(f as *const F);
399                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
400            }
401        }
402        unsafe {
403            let f: Box_<F> = Box_::new(f);
404            connect_raw(
405                self.as_ptr() as *mut _,
406                c"notify::last-sample".as_ptr() as *const _,
407                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
408                    notify_last_sample_trampoline::<Self, F> as *const (),
409                )),
410                Box_::into_raw(f),
411            )
412        }
413    }
414
415    #[doc(alias = "max-bitrate")]
416    fn connect_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(
417        &self,
418        f: F,
419    ) -> SignalHandlerId {
420        unsafe extern "C" fn notify_max_bitrate_trampoline<
421            P: IsA<BaseSink>,
422            F: Fn(&P) + Send + Sync + 'static,
423        >(
424            this: *mut ffi::GstBaseSink,
425            _param_spec: glib::ffi::gpointer,
426            f: glib::ffi::gpointer,
427        ) {
428            unsafe {
429                let f: &F = &*(f as *const F);
430                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
431            }
432        }
433        unsafe {
434            let f: Box_<F> = Box_::new(f);
435            connect_raw(
436                self.as_ptr() as *mut _,
437                c"notify::max-bitrate".as_ptr() as *const _,
438                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
439                    notify_max_bitrate_trampoline::<Self, F> as *const (),
440                )),
441                Box_::into_raw(f),
442            )
443        }
444    }
445
446    #[doc(alias = "max-lateness")]
447    fn connect_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(
448        &self,
449        f: F,
450    ) -> SignalHandlerId {
451        unsafe extern "C" fn notify_max_lateness_trampoline<
452            P: IsA<BaseSink>,
453            F: Fn(&P) + Send + Sync + 'static,
454        >(
455            this: *mut ffi::GstBaseSink,
456            _param_spec: glib::ffi::gpointer,
457            f: glib::ffi::gpointer,
458        ) {
459            unsafe {
460                let f: &F = &*(f as *const F);
461                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
462            }
463        }
464        unsafe {
465            let f: Box_<F> = Box_::new(f);
466            connect_raw(
467                self.as_ptr() as *mut _,
468                c"notify::max-lateness".as_ptr() as *const _,
469                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
470                    notify_max_lateness_trampoline::<Self, F> as *const (),
471                )),
472                Box_::into_raw(f),
473            )
474        }
475    }
476
477    #[cfg(feature = "v1_16")]
478    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
479    #[doc(alias = "processing-deadline")]
480    fn connect_processing_deadline_notify<F: Fn(&Self) + Send + Sync + 'static>(
481        &self,
482        f: F,
483    ) -> SignalHandlerId {
484        unsafe extern "C" fn notify_processing_deadline_trampoline<
485            P: IsA<BaseSink>,
486            F: Fn(&P) + Send + Sync + 'static,
487        >(
488            this: *mut ffi::GstBaseSink,
489            _param_spec: glib::ffi::gpointer,
490            f: glib::ffi::gpointer,
491        ) {
492            unsafe {
493                let f: &F = &*(f as *const F);
494                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
495            }
496        }
497        unsafe {
498            let f: Box_<F> = Box_::new(f);
499            connect_raw(
500                self.as_ptr() as *mut _,
501                c"notify::processing-deadline".as_ptr() as *const _,
502                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
503                    notify_processing_deadline_trampoline::<Self, F> as *const (),
504                )),
505                Box_::into_raw(f),
506            )
507        }
508    }
509
510    #[doc(alias = "qos")]
511    fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
512        unsafe extern "C" fn notify_qos_trampoline<
513            P: IsA<BaseSink>,
514            F: Fn(&P) + Send + Sync + 'static,
515        >(
516            this: *mut ffi::GstBaseSink,
517            _param_spec: glib::ffi::gpointer,
518            f: glib::ffi::gpointer,
519        ) {
520            unsafe {
521                let f: &F = &*(f as *const F);
522                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
523            }
524        }
525        unsafe {
526            let f: Box_<F> = Box_::new(f);
527            connect_raw(
528                self.as_ptr() as *mut _,
529                c"notify::qos".as_ptr() as *const _,
530                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
531                    notify_qos_trampoline::<Self, F> as *const (),
532                )),
533                Box_::into_raw(f),
534            )
535        }
536    }
537
538    #[doc(alias = "render-delay")]
539    fn connect_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(
540        &self,
541        f: F,
542    ) -> SignalHandlerId {
543        unsafe extern "C" fn notify_render_delay_trampoline<
544            P: IsA<BaseSink>,
545            F: Fn(&P) + Send + Sync + 'static,
546        >(
547            this: *mut ffi::GstBaseSink,
548            _param_spec: glib::ffi::gpointer,
549            f: glib::ffi::gpointer,
550        ) {
551            unsafe {
552                let f: &F = &*(f as *const F);
553                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
554            }
555        }
556        unsafe {
557            let f: Box_<F> = Box_::new(f);
558            connect_raw(
559                self.as_ptr() as *mut _,
560                c"notify::render-delay".as_ptr() as *const _,
561                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
562                    notify_render_delay_trampoline::<Self, F> as *const (),
563                )),
564                Box_::into_raw(f),
565            )
566        }
567    }
568
569    #[cfg(feature = "v1_18")]
570    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
571    #[doc(alias = "stats")]
572    fn connect_stats_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
573        unsafe extern "C" fn notify_stats_trampoline<
574            P: IsA<BaseSink>,
575            F: Fn(&P) + Send + Sync + 'static,
576        >(
577            this: *mut ffi::GstBaseSink,
578            _param_spec: glib::ffi::gpointer,
579            f: glib::ffi::gpointer,
580        ) {
581            unsafe {
582                let f: &F = &*(f as *const F);
583                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
584            }
585        }
586        unsafe {
587            let f: Box_<F> = Box_::new(f);
588            connect_raw(
589                self.as_ptr() as *mut _,
590                c"notify::stats".as_ptr() as *const _,
591                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
592                    notify_stats_trampoline::<Self, F> as *const (),
593                )),
594                Box_::into_raw(f),
595            )
596        }
597    }
598
599    #[doc(alias = "sync")]
600    fn connect_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
601        unsafe extern "C" fn notify_sync_trampoline<
602            P: IsA<BaseSink>,
603            F: Fn(&P) + Send + Sync + 'static,
604        >(
605            this: *mut ffi::GstBaseSink,
606            _param_spec: glib::ffi::gpointer,
607            f: glib::ffi::gpointer,
608        ) {
609            unsafe {
610                let f: &F = &*(f as *const F);
611                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
612            }
613        }
614        unsafe {
615            let f: Box_<F> = Box_::new(f);
616            connect_raw(
617                self.as_ptr() as *mut _,
618                c"notify::sync".as_ptr() as *const _,
619                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
620                    notify_sync_trampoline::<Self, F> as *const (),
621                )),
622                Box_::into_raw(f),
623            )
624        }
625    }
626
627    #[doc(alias = "throttle-time")]
628    fn connect_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
629        &self,
630        f: F,
631    ) -> SignalHandlerId {
632        unsafe extern "C" fn notify_throttle_time_trampoline<
633            P: IsA<BaseSink>,
634            F: Fn(&P) + Send + Sync + 'static,
635        >(
636            this: *mut ffi::GstBaseSink,
637            _param_spec: glib::ffi::gpointer,
638            f: glib::ffi::gpointer,
639        ) {
640            unsafe {
641                let f: &F = &*(f as *const F);
642                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
643            }
644        }
645        unsafe {
646            let f: Box_<F> = Box_::new(f);
647            connect_raw(
648                self.as_ptr() as *mut _,
649                c"notify::throttle-time".as_ptr() as *const _,
650                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
651                    notify_throttle_time_trampoline::<Self, F> as *const (),
652                )),
653                Box_::into_raw(f),
654            )
655        }
656    }
657
658    #[doc(alias = "ts-offset")]
659    fn connect_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
660        &self,
661        f: F,
662    ) -> SignalHandlerId {
663        unsafe extern "C" fn notify_ts_offset_trampoline<
664            P: IsA<BaseSink>,
665            F: Fn(&P) + Send + Sync + 'static,
666        >(
667            this: *mut ffi::GstBaseSink,
668            _param_spec: glib::ffi::gpointer,
669            f: glib::ffi::gpointer,
670        ) {
671            unsafe {
672                let f: &F = &*(f as *const F);
673                f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
674            }
675        }
676        unsafe {
677            let f: Box_<F> = Box_::new(f);
678            connect_raw(
679                self.as_ptr() as *mut _,
680                c"notify::ts-offset".as_ptr() as *const _,
681                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
682                    notify_ts_offset_trampoline::<Self, F> as *const (),
683                )),
684                Box_::into_raw(f),
685            )
686        }
687    }
688}
689
690impl<O: IsA<BaseSink>> BaseSinkExt for O {}