1use 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_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 #[cfg(feature = "v1_30")]
287 #[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
288 #[doc(alias = "enable-last-sample-notify")]
289 fn enables_last_sample_notify(&self) -> bool {
290 ObjectExt::property(self.as_ref(), "enable-last-sample-notify")
291 }
292
293 #[cfg(feature = "v1_30")]
294 #[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
295 #[doc(alias = "enable-last-sample-notify")]
296 fn set_enable_last_sample_notify(&self, enable_last_sample_notify: bool) {
297 ObjectExt::set_property(
298 self.as_ref(),
299 "enable-last-sample-notify",
300 enable_last_sample_notify,
301 )
302 }
303
304 fn is_qos(&self) -> bool {
305 ObjectExt::property(self.as_ref(), "qos")
306 }
307
308 fn set_qos(&self, qos: bool) {
309 ObjectExt::set_property(self.as_ref(), "qos", qos)
310 }
311
312 #[doc(alias = "async")]
313 fn connect_async_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
314 unsafe extern "C" fn notify_async_trampoline<
315 P: IsA<BaseSink>,
316 F: Fn(&P) + Send + Sync + 'static,
317 >(
318 this: *mut ffi::GstBaseSink,
319 _param_spec: glib::ffi::gpointer,
320 f: glib::ffi::gpointer,
321 ) {
322 unsafe {
323 let f: &F = &*(f as *const F);
324 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
325 }
326 }
327 unsafe {
328 let f: Box_<F> = Box_::new(f);
329 connect_raw(
330 self.as_ptr() as *mut _,
331 c"notify::async".as_ptr(),
332 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
333 notify_async_trampoline::<Self, F> as *const (),
334 )),
335 Box_::into_raw(f),
336 )
337 }
338 }
339
340 #[doc(alias = "blocksize")]
341 fn connect_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
342 &self,
343 f: F,
344 ) -> SignalHandlerId {
345 unsafe extern "C" fn notify_blocksize_trampoline<
346 P: IsA<BaseSink>,
347 F: Fn(&P) + Send + Sync + 'static,
348 >(
349 this: *mut ffi::GstBaseSink,
350 _param_spec: glib::ffi::gpointer,
351 f: glib::ffi::gpointer,
352 ) {
353 unsafe {
354 let f: &F = &*(f as *const F);
355 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
356 }
357 }
358 unsafe {
359 let f: Box_<F> = Box_::new(f);
360 connect_raw(
361 self.as_ptr() as *mut _,
362 c"notify::blocksize".as_ptr(),
363 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
364 notify_blocksize_trampoline::<Self, F> as *const (),
365 )),
366 Box_::into_raw(f),
367 )
368 }
369 }
370
371 #[doc(alias = "enable-last-sample")]
372 fn connect_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
373 &self,
374 f: F,
375 ) -> SignalHandlerId {
376 unsafe extern "C" fn notify_enable_last_sample_trampoline<
377 P: IsA<BaseSink>,
378 F: Fn(&P) + Send + Sync + 'static,
379 >(
380 this: *mut ffi::GstBaseSink,
381 _param_spec: glib::ffi::gpointer,
382 f: glib::ffi::gpointer,
383 ) {
384 unsafe {
385 let f: &F = &*(f as *const F);
386 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
387 }
388 }
389 unsafe {
390 let f: Box_<F> = Box_::new(f);
391 connect_raw(
392 self.as_ptr() as *mut _,
393 c"notify::enable-last-sample".as_ptr(),
394 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
395 notify_enable_last_sample_trampoline::<Self, F> as *const (),
396 )),
397 Box_::into_raw(f),
398 )
399 }
400 }
401
402 #[cfg(feature = "v1_30")]
403 #[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
404 #[doc(alias = "enable-last-sample-notify")]
405 fn connect_enable_last_sample_notify_notify<F: Fn(&Self) + Send + Sync + 'static>(
406 &self,
407 f: F,
408 ) -> SignalHandlerId {
409 unsafe extern "C" fn notify_enable_last_sample_notify_trampoline<
410 P: IsA<BaseSink>,
411 F: Fn(&P) + Send + Sync + 'static,
412 >(
413 this: *mut ffi::GstBaseSink,
414 _param_spec: glib::ffi::gpointer,
415 f: glib::ffi::gpointer,
416 ) {
417 unsafe {
418 let f: &F = &*(f as *const F);
419 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
420 }
421 }
422 unsafe {
423 let f: Box_<F> = Box_::new(f);
424 connect_raw(
425 self.as_ptr() as *mut _,
426 c"notify::enable-last-sample-notify".as_ptr(),
427 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
428 notify_enable_last_sample_notify_trampoline::<Self, F> as *const (),
429 )),
430 Box_::into_raw(f),
431 )
432 }
433 }
434
435 #[doc(alias = "last-sample")]
436 fn connect_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
437 &self,
438 f: F,
439 ) -> SignalHandlerId {
440 unsafe extern "C" fn notify_last_sample_trampoline<
441 P: IsA<BaseSink>,
442 F: Fn(&P) + Send + Sync + 'static,
443 >(
444 this: *mut ffi::GstBaseSink,
445 _param_spec: glib::ffi::gpointer,
446 f: glib::ffi::gpointer,
447 ) {
448 unsafe {
449 let f: &F = &*(f as *const F);
450 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
451 }
452 }
453 unsafe {
454 let f: Box_<F> = Box_::new(f);
455 connect_raw(
456 self.as_ptr() as *mut _,
457 c"notify::last-sample".as_ptr(),
458 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
459 notify_last_sample_trampoline::<Self, F> as *const (),
460 )),
461 Box_::into_raw(f),
462 )
463 }
464 }
465
466 #[doc(alias = "max-bitrate")]
467 fn connect_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(
468 &self,
469 f: F,
470 ) -> SignalHandlerId {
471 unsafe extern "C" fn notify_max_bitrate_trampoline<
472 P: IsA<BaseSink>,
473 F: Fn(&P) + Send + Sync + 'static,
474 >(
475 this: *mut ffi::GstBaseSink,
476 _param_spec: glib::ffi::gpointer,
477 f: glib::ffi::gpointer,
478 ) {
479 unsafe {
480 let f: &F = &*(f as *const F);
481 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
482 }
483 }
484 unsafe {
485 let f: Box_<F> = Box_::new(f);
486 connect_raw(
487 self.as_ptr() as *mut _,
488 c"notify::max-bitrate".as_ptr(),
489 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
490 notify_max_bitrate_trampoline::<Self, F> as *const (),
491 )),
492 Box_::into_raw(f),
493 )
494 }
495 }
496
497 #[doc(alias = "max-lateness")]
498 fn connect_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(
499 &self,
500 f: F,
501 ) -> SignalHandlerId {
502 unsafe extern "C" fn notify_max_lateness_trampoline<
503 P: IsA<BaseSink>,
504 F: Fn(&P) + Send + Sync + 'static,
505 >(
506 this: *mut ffi::GstBaseSink,
507 _param_spec: glib::ffi::gpointer,
508 f: glib::ffi::gpointer,
509 ) {
510 unsafe {
511 let f: &F = &*(f as *const F);
512 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
513 }
514 }
515 unsafe {
516 let f: Box_<F> = Box_::new(f);
517 connect_raw(
518 self.as_ptr() as *mut _,
519 c"notify::max-lateness".as_ptr(),
520 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
521 notify_max_lateness_trampoline::<Self, F> as *const (),
522 )),
523 Box_::into_raw(f),
524 )
525 }
526 }
527
528 #[cfg(feature = "v1_16")]
529 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
530 #[doc(alias = "processing-deadline")]
531 fn connect_processing_deadline_notify<F: Fn(&Self) + Send + Sync + 'static>(
532 &self,
533 f: F,
534 ) -> SignalHandlerId {
535 unsafe extern "C" fn notify_processing_deadline_trampoline<
536 P: IsA<BaseSink>,
537 F: Fn(&P) + Send + Sync + 'static,
538 >(
539 this: *mut ffi::GstBaseSink,
540 _param_spec: glib::ffi::gpointer,
541 f: glib::ffi::gpointer,
542 ) {
543 unsafe {
544 let f: &F = &*(f as *const F);
545 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
546 }
547 }
548 unsafe {
549 let f: Box_<F> = Box_::new(f);
550 connect_raw(
551 self.as_ptr() as *mut _,
552 c"notify::processing-deadline".as_ptr(),
553 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
554 notify_processing_deadline_trampoline::<Self, F> as *const (),
555 )),
556 Box_::into_raw(f),
557 )
558 }
559 }
560
561 #[doc(alias = "qos")]
562 fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
563 unsafe extern "C" fn notify_qos_trampoline<
564 P: IsA<BaseSink>,
565 F: Fn(&P) + Send + Sync + 'static,
566 >(
567 this: *mut ffi::GstBaseSink,
568 _param_spec: glib::ffi::gpointer,
569 f: glib::ffi::gpointer,
570 ) {
571 unsafe {
572 let f: &F = &*(f as *const F);
573 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
574 }
575 }
576 unsafe {
577 let f: Box_<F> = Box_::new(f);
578 connect_raw(
579 self.as_ptr() as *mut _,
580 c"notify::qos".as_ptr(),
581 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
582 notify_qos_trampoline::<Self, F> as *const (),
583 )),
584 Box_::into_raw(f),
585 )
586 }
587 }
588
589 #[doc(alias = "render-delay")]
590 fn connect_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(
591 &self,
592 f: F,
593 ) -> SignalHandlerId {
594 unsafe extern "C" fn notify_render_delay_trampoline<
595 P: IsA<BaseSink>,
596 F: Fn(&P) + Send + Sync + 'static,
597 >(
598 this: *mut ffi::GstBaseSink,
599 _param_spec: glib::ffi::gpointer,
600 f: glib::ffi::gpointer,
601 ) {
602 unsafe {
603 let f: &F = &*(f as *const F);
604 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
605 }
606 }
607 unsafe {
608 let f: Box_<F> = Box_::new(f);
609 connect_raw(
610 self.as_ptr() as *mut _,
611 c"notify::render-delay".as_ptr(),
612 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
613 notify_render_delay_trampoline::<Self, F> as *const (),
614 )),
615 Box_::into_raw(f),
616 )
617 }
618 }
619
620 #[cfg(feature = "v1_18")]
621 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
622 #[doc(alias = "stats")]
623 fn connect_stats_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
624 unsafe extern "C" fn notify_stats_trampoline<
625 P: IsA<BaseSink>,
626 F: Fn(&P) + Send + Sync + 'static,
627 >(
628 this: *mut ffi::GstBaseSink,
629 _param_spec: glib::ffi::gpointer,
630 f: glib::ffi::gpointer,
631 ) {
632 unsafe {
633 let f: &F = &*(f as *const F);
634 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
635 }
636 }
637 unsafe {
638 let f: Box_<F> = Box_::new(f);
639 connect_raw(
640 self.as_ptr() as *mut _,
641 c"notify::stats".as_ptr(),
642 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
643 notify_stats_trampoline::<Self, F> as *const (),
644 )),
645 Box_::into_raw(f),
646 )
647 }
648 }
649
650 #[doc(alias = "sync")]
651 fn connect_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
652 unsafe extern "C" fn notify_sync_trampoline<
653 P: IsA<BaseSink>,
654 F: Fn(&P) + Send + Sync + 'static,
655 >(
656 this: *mut ffi::GstBaseSink,
657 _param_spec: glib::ffi::gpointer,
658 f: glib::ffi::gpointer,
659 ) {
660 unsafe {
661 let f: &F = &*(f as *const F);
662 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
663 }
664 }
665 unsafe {
666 let f: Box_<F> = Box_::new(f);
667 connect_raw(
668 self.as_ptr() as *mut _,
669 c"notify::sync".as_ptr(),
670 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
671 notify_sync_trampoline::<Self, F> as *const (),
672 )),
673 Box_::into_raw(f),
674 )
675 }
676 }
677
678 #[doc(alias = "throttle-time")]
679 fn connect_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
680 &self,
681 f: F,
682 ) -> SignalHandlerId {
683 unsafe extern "C" fn notify_throttle_time_trampoline<
684 P: IsA<BaseSink>,
685 F: Fn(&P) + Send + Sync + 'static,
686 >(
687 this: *mut ffi::GstBaseSink,
688 _param_spec: glib::ffi::gpointer,
689 f: glib::ffi::gpointer,
690 ) {
691 unsafe {
692 let f: &F = &*(f as *const F);
693 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
694 }
695 }
696 unsafe {
697 let f: Box_<F> = Box_::new(f);
698 connect_raw(
699 self.as_ptr() as *mut _,
700 c"notify::throttle-time".as_ptr(),
701 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
702 notify_throttle_time_trampoline::<Self, F> as *const (),
703 )),
704 Box_::into_raw(f),
705 )
706 }
707 }
708
709 #[doc(alias = "ts-offset")]
710 fn connect_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
711 &self,
712 f: F,
713 ) -> SignalHandlerId {
714 unsafe extern "C" fn notify_ts_offset_trampoline<
715 P: IsA<BaseSink>,
716 F: Fn(&P) + Send + Sync + 'static,
717 >(
718 this: *mut ffi::GstBaseSink,
719 _param_spec: glib::ffi::gpointer,
720 f: glib::ffi::gpointer,
721 ) {
722 unsafe {
723 let f: &F = &*(f as *const F);
724 f(BaseSink::from_glib_borrow(this).unsafe_cast_ref())
725 }
726 }
727 unsafe {
728 let f: Box_<F> = Box_::new(f);
729 connect_raw(
730 self.as_ptr() as *mut _,
731 c"notify::ts-offset".as_ptr(),
732 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
733 notify_ts_offset_trampoline::<Self, F> as *const (),
734 )),
735 Box_::into_raw(f),
736 )
737 }
738 }
739}
740
741impl<O: IsA<BaseSink>> BaseSinkExt for O {}