gstreamer_base/auto/base_src.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#![allow(deprecated)]
6
7use crate::ffi;
8use glib::{
9 prelude::*,
10 signal::{SignalHandlerId, connect_raw},
11 translate::*,
12};
13use std::boxed::Box as Box_;
14
15glib::wrapper! {
16 /// ");
17 /// }
18 /// ]|
19 ///
20 /// ## Controlled shutdown of live sources in applications
21 ///
22 /// Applications that record from a live source may want to stop recording
23 /// in a controlled way, so that the recording is stopped, but the data
24 /// already in the pipeline is processed to the end (remember that many live
25 /// sources would go on recording forever otherwise). For that to happen the
26 /// application needs to make the source stop recording and send an EOS
27 /// event down the pipeline. The application would then wait for an
28 /// EOS message posted on the pipeline's bus to know when all data has
29 /// been processed and the pipeline can safely be stopped.
30 ///
31 /// An application may send an EOS event to a source element to make it
32 /// perform the EOS logic (send EOS event downstream or post a
33 /// `GST_MESSAGE_SEGMENT_DONE` on the bus). This can typically be done
34 /// with the [`ElementExtManual::send_event()`][crate::gst::prelude::ElementExtManual::send_event()] function on the element or its parent bin.
35 ///
36 /// After the EOS has been sent to the element, the application should wait for
37 /// an EOS message to be posted on the pipeline's bus. Once this EOS message is
38 /// received, it may safely shut down the entire pipeline.
39 ///
40 /// This is an Abstract Base Class, you cannot instantiate it.
41 ///
42 /// ## Properties
43 ///
44 ///
45 /// #### `automatic-eos`
46 /// See [`BaseSrcExt::set_automatic_eos()`][crate::prelude::BaseSrcExt::set_automatic_eos()]
47 ///
48 /// Readable | Writable
49 ///
50 ///
51 /// #### `blocksize`
52 /// Readable | Writable
53 ///
54 ///
55 /// #### `do-timestamp`
56 /// Readable | Writable
57 ///
58 ///
59 /// #### `num-buffers`
60 /// Readable | Writable
61 ///
62 ///
63 /// #### `typefind`
64 /// Readable | Writable
65 /// <details><summary><h4>Object</h4></summary>
66 ///
67 ///
68 /// #### `name`
69 /// Readable | Writable | Construct
70 ///
71 ///
72 /// #### `parent`
73 /// The parent of the object. Please note, that when changing the 'parent'
74 /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
75 /// signals due to locking issues. In some cases one can use
76 /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
77 /// achieve a similar effect.
78 ///
79 /// Readable | Writable
80 /// </details>
81 ///
82 /// # Implements
83 ///
84 /// [`BaseSrcExt`][trait@crate::prelude::BaseSrcExt], [`trait@gst::prelude::ElementExt`], [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`], [`BaseSrcExtManual`][trait@crate::prelude::BaseSrcExtManual]
85 #[doc(alias = "GstBaseSrc")]
86 pub struct BaseSrc(Object<ffi::GstBaseSrc, ffi::GstBaseSrcClass>) @extends gst::Element, gst::Object;
87
88 match fn {
89 type_ => || ffi::gst_base_src_get_type(),
90 }
91}
92
93impl BaseSrc {
94 pub const NONE: Option<&'static BaseSrc> = None;
95}
96
97unsafe impl Send for BaseSrc {}
98unsafe impl Sync for BaseSrc {}
99
100/// Trait containing all [`struct@BaseSrc`] methods.
101///
102/// # Implementors
103///
104/// [`BaseSrc`][struct@crate::BaseSrc], [`PushSrc`][struct@crate::PushSrc]
105pub trait BaseSrcExt: IsA<BaseSrc> + 'static {
106 /// Get the number of bytes that `self` will push out with each buffer.
107 ///
108 /// # Returns
109 ///
110 /// the number of bytes pushed with each buffer.
111 #[doc(alias = "gst_base_src_get_blocksize")]
112 #[doc(alias = "get_blocksize")]
113 fn blocksize(&self) -> u32 {
114 unsafe { ffi::gst_base_src_get_blocksize(self.as_ref().to_glib_none().0) }
115 }
116
117 ///
118 /// # Returns
119 ///
120 /// the instance of the [`gst::BufferPool`][crate::gst::BufferPool] used
121 /// by the src; unref it after usage.
122 #[doc(alias = "gst_base_src_get_buffer_pool")]
123 #[doc(alias = "get_buffer_pool")]
124 fn buffer_pool(&self) -> Option<gst::BufferPool> {
125 unsafe {
126 from_glib_full(ffi::gst_base_src_get_buffer_pool(
127 self.as_ref().to_glib_none().0,
128 ))
129 }
130 }
131
132 /// Query if `self` timestamps outgoing buffers based on the current running_time.
133 ///
134 /// # Returns
135 ///
136 /// [`true`] if the base class will automatically timestamp outgoing buffers.
137 #[doc(alias = "gst_base_src_get_do_timestamp")]
138 #[doc(alias = "get_do_timestamp")]
139 #[doc(alias = "do-timestamp")]
140 fn does_timestamp(&self) -> bool {
141 unsafe {
142 from_glib(ffi::gst_base_src_get_do_timestamp(
143 self.as_ref().to_glib_none().0,
144 ))
145 }
146 }
147
148 /// Get the current async behaviour of `self`. See also [`set_async()`][Self::set_async()].
149 ///
150 /// # Returns
151 ///
152 /// [`true`] if `self` is operating in async mode.
153 #[doc(alias = "gst_base_src_is_async")]
154 fn is_async(&self) -> bool {
155 unsafe { from_glib(ffi::gst_base_src_is_async(self.as_ref().to_glib_none().0)) }
156 }
157
158 /// Check if an element is in live mode.
159 ///
160 /// # Returns
161 ///
162 /// [`true`] if element is in live mode.
163 #[doc(alias = "gst_base_src_is_live")]
164 fn is_live(&self) -> bool {
165 unsafe { from_glib(ffi::gst_base_src_is_live(self.as_ref().to_glib_none().0)) }
166 }
167
168 /// Negotiates src pad caps with downstream elements.
169 /// Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again
170 /// if `GstBaseSrcClass::negotiate` fails.
171 ///
172 /// Do not call this in the `GstBaseSrcClass::fill` vmethod. Call this in
173 /// `GstBaseSrcClass::create` or in `GstBaseSrcClass::alloc`, _before_ any
174 /// buffer is allocated.
175 ///
176 /// # Returns
177 ///
178 /// [`true`] if the negotiation succeeded, else [`false`].
179 #[cfg(feature = "v1_18")]
180 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
181 #[doc(alias = "gst_base_src_negotiate")]
182 fn negotiate(&self) -> bool {
183 unsafe { from_glib(ffi::gst_base_src_negotiate(self.as_ref().to_glib_none().0)) }
184 }
185
186 /// Prepare a new seamless segment for emission downstream. This function must
187 /// only be called by derived sub-classes, and only from the `GstBaseSrcClass::create` function,
188 /// as the stream-lock needs to be held.
189 ///
190 /// The format for the new segment will be the current format of the source, as
191 /// configured with [`set_format()`][Self::set_format()]
192 ///
193 /// # Deprecated since 1.18
194 ///
195 /// Use [`new_segment()`][Self::new_segment()]
196 /// ## `start`
197 /// The new start value for the segment
198 /// ## `stop`
199 /// Stop value for the new segment
200 /// ## `time`
201 /// The new time value for the start of the new segment
202 ///
203 /// # Returns
204 ///
205 /// [`true`] if preparation of the seamless segment succeeded.
206 #[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")]
207 #[allow(deprecated)]
208 #[doc(alias = "gst_base_src_new_seamless_segment")]
209 fn new_seamless_segment(&self, start: i64, stop: i64, time: i64) -> bool {
210 unsafe {
211 from_glib(ffi::gst_base_src_new_seamless_segment(
212 self.as_ref().to_glib_none().0,
213 start,
214 stop,
215 time,
216 ))
217 }
218 }
219
220 /// Prepare a new segment for emission downstream. This function must
221 /// only be called by derived sub-classes, and only from the `GstBaseSrcClass::create` function,
222 /// as the stream-lock needs to be held.
223 ///
224 /// The format for the `segment` must be identical with the current format
225 /// of the source, as configured with [`set_format()`][Self::set_format()].
226 ///
227 /// The format of `self` must not be [`gst::Format::Undefined`][crate::gst::Format::Undefined] and the format
228 /// should be configured via [`set_format()`][Self::set_format()] before calling this method.
229 /// ## `segment`
230 /// a pointer to a [`gst::Segment`][crate::gst::Segment]
231 ///
232 /// # Returns
233 ///
234 /// [`true`] if preparation of new segment succeeded.
235 #[cfg(feature = "v1_18")]
236 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
237 #[doc(alias = "gst_base_src_new_segment")]
238 fn new_segment(&self, segment: &gst::Segment) -> Result<(), glib::error::BoolError> {
239 unsafe {
240 glib::result_from_gboolean!(
241 ffi::gst_base_src_new_segment(
242 self.as_ref().to_glib_none().0,
243 segment.to_glib_none().0
244 ),
245 "Failed to update segment"
246 )
247 }
248 }
249
250 /// Send a new segment downstream. This function must
251 /// only be called by derived sub-classes, and only from the `GstBaseSrcClass::create` function,
252 /// as the stream-lock needs to be held.
253 /// This method also requires that an out caps has been configured, so
254 /// [`set_caps()`][Self::set_caps()] needs to have been called before.
255 ///
256 /// The format for the `segment` must be identical with the current format
257 /// of the source, as configured with [`set_format()`][Self::set_format()].
258 ///
259 /// The format of `self` must not be [`gst::Format::Undefined`][crate::gst::Format::Undefined] and the format
260 /// should be configured via [`set_format()`][Self::set_format()] before calling this method.
261 ///
262 /// This is a variant of [`new_segment()`][Self::new_segment()] sending the segment right away,
263 /// which can be useful to ensure events ordering.
264 /// ## `segment`
265 /// a pointer to a [`gst::Segment`][crate::gst::Segment]
266 ///
267 /// # Returns
268 ///
269 /// [`true`] if sending of new segment succeeded.
270 #[cfg(feature = "v1_24")]
271 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
272 #[doc(alias = "gst_base_src_push_segment")]
273 fn push_segment(&self, segment: &gst::Segment) -> bool {
274 unsafe {
275 from_glib(ffi::gst_base_src_push_segment(
276 self.as_ref().to_glib_none().0,
277 segment.to_glib_none().0,
278 ))
279 }
280 }
281
282 /// Configure async behaviour in `self`, no state change will block. The open,
283 /// close, start, stop, play and pause virtual methods will be executed in a
284 /// different thread and are thus allowed to perform blocking operations. Any
285 /// blocking operation should be unblocked with the unlock vmethod.
286 /// ## `async_`
287 /// new async mode
288 #[doc(alias = "gst_base_src_set_async")]
289 fn set_async(&self, async_: bool) {
290 unsafe {
291 ffi::gst_base_src_set_async(self.as_ref().to_glib_none().0, async_.into_glib());
292 }
293 }
294
295 /// If `automatic_eos` is [`true`], `self` will automatically go EOS if a buffer
296 /// after the total size is returned. By default this is [`true`] but sources
297 /// that can't return an authoritative size and only know that they're EOS
298 /// when trying to read more should set this to [`false`].
299 ///
300 /// When `self` operates in [`gst::Format::Time`][crate::gst::Format::Time], [`BaseSrc`][crate::BaseSrc] will send an EOS
301 /// when a buffer outside of the currently configured segment is pushed if
302 /// `automatic_eos` is [`true`]. Since 1.16, if `automatic_eos` is [`false`] an
303 /// EOS will be pushed only when the `GstBaseSrcClass::create` implementation
304 /// returns [`gst::FlowReturn::Eos`][crate::gst::FlowReturn::Eos].
305 /// ## `automatic_eos`
306 /// automatic eos
307 #[doc(alias = "gst_base_src_set_automatic_eos")]
308 #[doc(alias = "automatic-eos")]
309 fn set_automatic_eos(&self, automatic_eos: bool) {
310 unsafe {
311 ffi::gst_base_src_set_automatic_eos(
312 self.as_ref().to_glib_none().0,
313 automatic_eos.into_glib(),
314 );
315 }
316 }
317
318 /// Set the number of bytes that `self` will push out with each buffer. When
319 /// `blocksize` is set to -1, a default length will be used.
320 /// ## `blocksize`
321 /// the new blocksize in bytes
322 #[doc(alias = "gst_base_src_set_blocksize")]
323 #[doc(alias = "blocksize")]
324 fn set_blocksize(&self, blocksize: u32) {
325 unsafe {
326 ffi::gst_base_src_set_blocksize(self.as_ref().to_glib_none().0, blocksize);
327 }
328 }
329
330 /// Set new caps on the basesrc source pad.
331 /// ## `caps`
332 /// a [`gst::Caps`][crate::gst::Caps]
333 ///
334 /// # Returns
335 ///
336 /// [`true`] if the caps could be set
337 #[doc(alias = "gst_base_src_set_caps")]
338 fn set_caps(&self, caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
339 unsafe {
340 glib::result_from_gboolean!(
341 ffi::gst_base_src_set_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0),
342 "Failed to set caps"
343 )
344 }
345 }
346
347 /// Configure `self` to automatically timestamp outgoing buffers based on the
348 /// current running_time of the pipeline. This property is mostly useful for live
349 /// sources.
350 /// ## `timestamp`
351 /// enable or disable timestamping
352 #[doc(alias = "gst_base_src_set_do_timestamp")]
353 #[doc(alias = "do-timestamp")]
354 fn set_do_timestamp(&self, timestamp: bool) {
355 unsafe {
356 ffi::gst_base_src_set_do_timestamp(
357 self.as_ref().to_glib_none().0,
358 timestamp.into_glib(),
359 );
360 }
361 }
362
363 /// If not `dynamic`, size is only updated when needed, such as when trying to
364 /// read past current tracked size. Otherwise, size is checked for upon each
365 /// read.
366 /// ## `dynamic`
367 /// new dynamic size mode
368 #[doc(alias = "gst_base_src_set_dynamic_size")]
369 fn set_dynamic_size(&self, dynamic: bool) {
370 unsafe {
371 ffi::gst_base_src_set_dynamic_size(self.as_ref().to_glib_none().0, dynamic.into_glib());
372 }
373 }
374
375 /// [`gst::State::Paused`][crate::gst::State::Paused].
376 /// ## `format`
377 /// the format to use
378 #[doc(alias = "gst_base_src_set_format")]
379 fn set_format(&self, format: gst::Format) {
380 unsafe {
381 ffi::gst_base_src_set_format(self.as_ref().to_glib_none().0, format.into_glib());
382 }
383 }
384
385 /// If the element listens to a live source, `live` should
386 /// be set to [`true`].
387 ///
388 /// A live source will not produce data in the PAUSED state and
389 /// will therefore not be able to participate in the PREROLL phase
390 /// of a pipeline. To signal this fact to the application and the
391 /// pipeline, the state change return value of the live source will
392 /// be GST_STATE_CHANGE_NO_PREROLL.
393 /// ## `live`
394 /// new live-mode
395 #[doc(alias = "gst_base_src_set_live")]
396 fn set_live(&self, live: bool) {
397 unsafe {
398 ffi::gst_base_src_set_live(self.as_ref().to_glib_none().0, live.into_glib());
399 }
400 }
401
402 /// Complete an asynchronous start operation. When the subclass overrides the
403 /// start method, it should call [`start_complete()`][Self::start_complete()] when the start
404 /// operation completes either from the same thread or from an asynchronous
405 /// helper thread.
406 /// ## `ret`
407 /// a [`gst::FlowReturn`][crate::gst::FlowReturn]
408 #[doc(alias = "gst_base_src_start_complete")]
409 fn start_complete(&self, ret: impl Into<gst::FlowReturn>) {
410 unsafe {
411 ffi::gst_base_src_start_complete(
412 self.as_ref().to_glib_none().0,
413 ret.into().into_glib(),
414 );
415 }
416 }
417
418 /// Wait until the start operation completes.
419 ///
420 /// # Returns
421 ///
422 /// a [`gst::FlowReturn`][crate::gst::FlowReturn].
423 #[doc(alias = "gst_base_src_start_wait")]
424 fn start_wait(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
425 unsafe { try_from_glib(ffi::gst_base_src_start_wait(self.as_ref().to_glib_none().0)) }
426 }
427
428 /// If the `GstBaseSrcClass::create` method performs its own synchronisation
429 /// against the clock it must unblock when going from PLAYING to the PAUSED state
430 /// and call this method before continuing to produce the remaining data.
431 ///
432 /// This function will block until a state change to PLAYING happens (in which
433 /// case this function returns [`gst::FlowReturn::Ok`][crate::gst::FlowReturn::Ok]) or the processing must be stopped due
434 /// to a state change to READY or a FLUSH event (in which case this function
435 /// returns [`gst::FlowReturn::Flushing`][crate::gst::FlowReturn::Flushing]).
436 ///
437 /// # Returns
438 ///
439 /// [`gst::FlowReturn::Ok`][crate::gst::FlowReturn::Ok] if `self` is PLAYING and processing can
440 /// continue. Any other return value should be returned from the create vmethod.
441 #[doc(alias = "gst_base_src_wait_playing")]
442 fn wait_playing(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
443 unsafe {
444 try_from_glib(ffi::gst_base_src_wait_playing(
445 self.as_ref().to_glib_none().0,
446 ))
447 }
448 }
449
450 /// See [`set_automatic_eos()`][Self::set_automatic_eos()]
451 #[cfg(feature = "v1_24")]
452 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
453 #[doc(alias = "automatic-eos")]
454 fn is_automatic_eos(&self) -> bool {
455 ObjectExt::property(self.as_ref(), "automatic-eos")
456 }
457
458 #[doc(alias = "num-buffers")]
459 fn num_buffers(&self) -> i32 {
460 ObjectExt::property(self.as_ref(), "num-buffers")
461 }
462
463 #[doc(alias = "num-buffers")]
464 fn set_num_buffers(&self, num_buffers: i32) {
465 ObjectExt::set_property(self.as_ref(), "num-buffers", num_buffers)
466 }
467
468 fn is_typefind(&self) -> bool {
469 ObjectExt::property(self.as_ref(), "typefind")
470 }
471
472 fn set_typefind(&self, typefind: bool) {
473 ObjectExt::set_property(self.as_ref(), "typefind", typefind)
474 }
475
476 #[cfg(feature = "v1_24")]
477 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
478 #[doc(alias = "automatic-eos")]
479 fn connect_automatic_eos_notify<F: Fn(&Self) + Send + Sync + 'static>(
480 &self,
481 f: F,
482 ) -> SignalHandlerId {
483 unsafe extern "C" fn notify_automatic_eos_trampoline<
484 P: IsA<BaseSrc>,
485 F: Fn(&P) + Send + Sync + 'static,
486 >(
487 this: *mut ffi::GstBaseSrc,
488 _param_spec: glib::ffi::gpointer,
489 f: glib::ffi::gpointer,
490 ) {
491 unsafe {
492 let f: &F = &*(f as *const F);
493 f(BaseSrc::from_glib_borrow(this).unsafe_cast_ref())
494 }
495 }
496 unsafe {
497 let f: Box_<F> = Box_::new(f);
498 connect_raw(
499 self.as_ptr() as *mut _,
500 c"notify::automatic-eos".as_ptr(),
501 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
502 notify_automatic_eos_trampoline::<Self, F> as *const (),
503 )),
504 Box_::into_raw(f),
505 )
506 }
507 }
508
509 #[doc(alias = "blocksize")]
510 fn connect_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
511 &self,
512 f: F,
513 ) -> SignalHandlerId {
514 unsafe extern "C" fn notify_blocksize_trampoline<
515 P: IsA<BaseSrc>,
516 F: Fn(&P) + Send + Sync + 'static,
517 >(
518 this: *mut ffi::GstBaseSrc,
519 _param_spec: glib::ffi::gpointer,
520 f: glib::ffi::gpointer,
521 ) {
522 unsafe {
523 let f: &F = &*(f as *const F);
524 f(BaseSrc::from_glib_borrow(this).unsafe_cast_ref())
525 }
526 }
527 unsafe {
528 let f: Box_<F> = Box_::new(f);
529 connect_raw(
530 self.as_ptr() as *mut _,
531 c"notify::blocksize".as_ptr(),
532 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
533 notify_blocksize_trampoline::<Self, F> as *const (),
534 )),
535 Box_::into_raw(f),
536 )
537 }
538 }
539
540 #[doc(alias = "do-timestamp")]
541 fn connect_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
542 &self,
543 f: F,
544 ) -> SignalHandlerId {
545 unsafe extern "C" fn notify_do_timestamp_trampoline<
546 P: IsA<BaseSrc>,
547 F: Fn(&P) + Send + Sync + 'static,
548 >(
549 this: *mut ffi::GstBaseSrc,
550 _param_spec: glib::ffi::gpointer,
551 f: glib::ffi::gpointer,
552 ) {
553 unsafe {
554 let f: &F = &*(f as *const F);
555 f(BaseSrc::from_glib_borrow(this).unsafe_cast_ref())
556 }
557 }
558 unsafe {
559 let f: Box_<F> = Box_::new(f);
560 connect_raw(
561 self.as_ptr() as *mut _,
562 c"notify::do-timestamp".as_ptr(),
563 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
564 notify_do_timestamp_trampoline::<Self, F> as *const (),
565 )),
566 Box_::into_raw(f),
567 )
568 }
569 }
570
571 #[doc(alias = "num-buffers")]
572 fn connect_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(
573 &self,
574 f: F,
575 ) -> SignalHandlerId {
576 unsafe extern "C" fn notify_num_buffers_trampoline<
577 P: IsA<BaseSrc>,
578 F: Fn(&P) + Send + Sync + 'static,
579 >(
580 this: *mut ffi::GstBaseSrc,
581 _param_spec: glib::ffi::gpointer,
582 f: glib::ffi::gpointer,
583 ) {
584 unsafe {
585 let f: &F = &*(f as *const F);
586 f(BaseSrc::from_glib_borrow(this).unsafe_cast_ref())
587 }
588 }
589 unsafe {
590 let f: Box_<F> = Box_::new(f);
591 connect_raw(
592 self.as_ptr() as *mut _,
593 c"notify::num-buffers".as_ptr(),
594 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
595 notify_num_buffers_trampoline::<Self, F> as *const (),
596 )),
597 Box_::into_raw(f),
598 )
599 }
600 }
601
602 #[doc(alias = "typefind")]
603 fn connect_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(
604 &self,
605 f: F,
606 ) -> SignalHandlerId {
607 unsafe extern "C" fn notify_typefind_trampoline<
608 P: IsA<BaseSrc>,
609 F: Fn(&P) + Send + Sync + 'static,
610 >(
611 this: *mut ffi::GstBaseSrc,
612 _param_spec: glib::ffi::gpointer,
613 f: glib::ffi::gpointer,
614 ) {
615 unsafe {
616 let f: &F = &*(f as *const F);
617 f(BaseSrc::from_glib_borrow(this).unsafe_cast_ref())
618 }
619 }
620 unsafe {
621 let f: Box_<F> = Box_::new(f);
622 connect_raw(
623 self.as_ptr() as *mut _,
624 c"notify::typefind".as_ptr(),
625 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
626 notify_typefind_trampoline::<Self, F> as *const (),
627 )),
628 Box_::into_raw(f),
629 )
630 }
631 }
632}
633
634impl<O: IsA<BaseSrc>> BaseSrcExt for O {}