gstreamer_base/auto/aggregator.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;
7#[cfg(feature = "v1_18")]
8#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
9use crate::{AggregatorPad, AggregatorStartTimeSelection};
10use glib::{
11 prelude::*,
12 signal::{SignalHandlerId, connect_raw},
13 translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18 /// Manages a set of pads with the purpose of aggregating their buffers.
19 /// Control is given to the subclass when all pads have data.
20 ///
21 /// * Base class for mixers and muxers. Subclasses should at least implement
22 /// the `GstAggregatorClass::aggregate` virtual method.
23 ///
24 /// * Installs a `GstPadChainFunction`, a `GstPadEventFullFunction` and a
25 /// `GstPadQueryFunction` to queue all serialized data packets per sink pad.
26 /// Subclasses should not overwrite those, but instead implement
27 /// `GstAggregatorClass::sink_event` and `GstAggregatorClass::sink_query` as
28 /// needed.
29 ///
30 /// * When data is queued on all pads, the aggregate vmethod is called.
31 ///
32 /// * One can peek at the data on any given GstAggregatorPad with the
33 /// [`AggregatorPadExt::peek_buffer()`][crate::prelude::AggregatorPadExt::peek_buffer()] method, and remove it from the pad
34 /// with the gst_aggregator_pad_pop_buffer () method. When a buffer
35 /// has been taken with pop_buffer (), a new buffer can be queued
36 /// on that pad.
37 ///
38 /// * When [`AggregatorPadExt::peek_buffer()`][crate::prelude::AggregatorPadExt::peek_buffer()] or [`AggregatorPadExt::has_buffer()`][crate::prelude::AggregatorPadExt::has_buffer()]
39 /// are called, a reference is taken to the returned buffer, which stays
40 /// valid until either:
41 ///
42 /// - [`AggregatorPadExt::pop_buffer()`][crate::prelude::AggregatorPadExt::pop_buffer()] is called, in which case the caller
43 /// is guaranteed that the buffer they receive is the same as the peeked
44 /// buffer.
45 /// - [`AggregatorPadExt::drop_buffer()`][crate::prelude::AggregatorPadExt::drop_buffer()] is called, in which case the caller
46 /// is guaranteed that the dropped buffer is the one that was peeked.
47 /// - the subclass implementation of `GstAggregatorClass.aggregate` returns.
48 ///
49 /// Subsequent calls to [`AggregatorPadExt::peek_buffer()`][crate::prelude::AggregatorPadExt::peek_buffer()] or
50 /// [`AggregatorPadExt::has_buffer()`][crate::prelude::AggregatorPadExt::has_buffer()] return / check the same buffer that was
51 /// returned / checked, until one of the conditions listed above is met.
52 ///
53 /// Subclasses are only allowed to call these methods from the aggregate
54 /// thread.
55 ///
56 /// * If the subclass wishes to push a buffer downstream in its aggregate
57 /// implementation, it should do so through the
58 /// [`AggregatorExt::finish_buffer()`][crate::prelude::AggregatorExt::finish_buffer()] method. This method will take care
59 /// of sending and ordering mandatory events such as stream start, caps
60 /// and segment. Buffer lists can also be pushed out with
61 /// [`AggregatorExt::finish_buffer_list()`][crate::prelude::AggregatorExt::finish_buffer_list()].
62 ///
63 /// * Same goes for EOS events, which should not be pushed directly by the
64 /// subclass, it should instead return GST_FLOW_EOS in its aggregate
65 /// implementation.
66 ///
67 /// * Note that the aggregator logic regarding gap event handling is to turn
68 /// these into gap buffers with matching PTS and duration. It will also
69 /// flag these buffers with GST_BUFFER_FLAG_GAP and GST_BUFFER_FLAG_DROPPABLE
70 /// to ease their identification and subsequent processing.
71 /// In addition, if the gap event was flagged with GST_GAP_FLAG_MISSING_DATA,
72 /// a custom meta is added to the resulting gap buffer (GstAggregatorMissingDataMeta).
73 ///
74 /// * Subclasses must use (a subclass of) [`AggregatorPad`][crate::AggregatorPad] for both their
75 /// sink and source pads.
76 /// See `gst_element_class_add_static_pad_template_with_gtype()`.
77 ///
78 /// This class used to live in gst-plugins-bad and was moved to core.
79 ///
80 /// This is an Abstract Base Class, you cannot instantiate it.
81 ///
82 /// ## Properties
83 ///
84 ///
85 /// #### `emit-signals`
86 /// Enables the emission of signals such as [`samples-selected`][struct@crate::Aggregator#samples-selected]
87 ///
88 /// Readable | Writeable
89 ///
90 ///
91 /// #### `latency`
92 /// Readable | Writeable
93 ///
94 ///
95 /// #### `min-upstream-latency`
96 /// Force minimum upstream latency (in nanoseconds). When sources with a
97 /// higher latency are expected to be plugged in dynamically after the
98 /// aggregator has started playing, this allows overriding the minimum
99 /// latency reported by the initial source(s). This is only taken into
100 /// account when larger than the actually reported minimum latency.
101 ///
102 /// Readable | Writeable
103 ///
104 ///
105 /// #### `start-time`
106 /// Readable | Writeable
107 ///
108 ///
109 /// #### `start-time-selection`
110 /// Readable | Writeable
111 /// <details><summary><h4>Object</h4></summary>
112 ///
113 ///
114 /// #### `name`
115 /// Readable | Writeable | Construct
116 ///
117 ///
118 /// #### `parent`
119 /// The parent of the object. Please note, that when changing the 'parent'
120 /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
121 /// signals due to locking issues. In some cases one can use
122 /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
123 /// achieve a similar effect.
124 ///
125 /// Readable | Writeable
126 /// </details>
127 ///
128 /// ## Signals
129 ///
130 ///
131 /// #### `samples-selected`
132 /// Signals that the [`Aggregator`][crate::Aggregator] subclass has selected the next set
133 /// of input samples it will aggregate. Handlers may call
134 /// [`AggregatorExt::peek_next_sample()`][crate::prelude::AggregatorExt::peek_next_sample()] at that point.
135 ///
136 ///
137 /// <details><summary><h4>Element</h4></summary>
138 ///
139 ///
140 /// #### `no-more-pads`
141 /// This signals that the element will not generate more dynamic pads.
142 /// Note that this signal will usually be emitted from the context of
143 /// the streaming thread.
144 ///
145 ///
146 ///
147 ///
148 /// #### `pad-added`
149 /// a new [`gst::Pad`][crate::gst::Pad] has been added to the element. Note that this signal will
150 /// usually be emitted from the context of the streaming thread. Also keep in
151 /// mind that if you add new elements to the pipeline in the signal handler
152 /// you will need to set them to the desired target state with
153 /// [`ElementExtManual::set_state()`][crate::gst::prelude::ElementExtManual::set_state()] or [`ElementExtManual::sync_state_with_parent()`][crate::gst::prelude::ElementExtManual::sync_state_with_parent()].
154 ///
155 ///
156 ///
157 ///
158 /// #### `pad-removed`
159 /// a [`gst::Pad`][crate::gst::Pad] has been removed from the element
160 ///
161 ///
162 /// </details>
163 /// <details><summary><h4>Object</h4></summary>
164 ///
165 ///
166 /// #### `deep-notify`
167 /// The deep notify signal is used to be notified of property changes. It is
168 /// typically attached to the toplevel bin to receive notifications from all
169 /// the elements contained in that bin.
170 ///
171 /// Detailed
172 /// </details>
173 ///
174 /// # Implements
175 ///
176 /// [`AggregatorExt`][trait@crate::prelude::AggregatorExt], [`trait@gst::prelude::ElementExt`], [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`], [`AggregatorExtManual`][trait@crate::prelude::AggregatorExtManual]
177 #[doc(alias = "GstAggregator")]
178 pub struct Aggregator(Object<ffi::GstAggregator, ffi::GstAggregatorClass>) @extends gst::Element, gst::Object;
179
180 match fn {
181 type_ => || ffi::gst_aggregator_get_type(),
182 }
183}
184
185impl Aggregator {
186 pub const NONE: Option<&'static Aggregator> = None;
187}
188
189unsafe impl Send for Aggregator {}
190unsafe impl Sync for Aggregator {}
191
192/// Trait containing all [`struct@Aggregator`] methods.
193///
194/// # Implementors
195///
196/// [`Aggregator`][struct@crate::Aggregator]
197pub trait AggregatorExt: IsA<Aggregator> + 'static {
198 /// This method will push the provided output buffer downstream. If needed,
199 /// mandatory events such as stream-start, caps, and segment events will be
200 /// sent before pushing the buffer.
201 /// ## `buffer`
202 /// the [`gst::Buffer`][crate::gst::Buffer] to push.
203 #[doc(alias = "gst_aggregator_finish_buffer")]
204 fn finish_buffer(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
205 unsafe {
206 try_from_glib(ffi::gst_aggregator_finish_buffer(
207 self.as_ref().to_glib_none().0,
208 buffer.into_glib_ptr(),
209 ))
210 }
211 }
212
213 /// This method will push the provided output buffer list downstream. If needed,
214 /// mandatory events such as stream-start, caps, and segment events will be
215 /// sent before pushing the buffer.
216 /// ## `bufferlist`
217 /// the [`gst::BufferList`][crate::gst::BufferList] to push.
218 #[cfg(feature = "v1_18")]
219 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
220 #[doc(alias = "gst_aggregator_finish_buffer_list")]
221 fn finish_buffer_list(
222 &self,
223 bufferlist: gst::BufferList,
224 ) -> Result<gst::FlowSuccess, gst::FlowError> {
225 unsafe {
226 try_from_glib(ffi::gst_aggregator_finish_buffer_list(
227 self.as_ref().to_glib_none().0,
228 bufferlist.into_glib_ptr(),
229 ))
230 }
231 }
232
233 ///
234 /// # Returns
235 ///
236 /// the instance of the [`gst::BufferPool`][crate::gst::BufferPool] used
237 /// by `trans`; free it after use it
238 #[doc(alias = "gst_aggregator_get_buffer_pool")]
239 #[doc(alias = "get_buffer_pool")]
240 fn buffer_pool(&self) -> Option<gst::BufferPool> {
241 unsafe {
242 from_glib_full(ffi::gst_aggregator_get_buffer_pool(
243 self.as_ref().to_glib_none().0,
244 ))
245 }
246 }
247
248 /// Subclasses may use the return value to inform whether they should return
249 /// [`gst::FlowReturn::Eos`][crate::gst::FlowReturn::Eos] from their aggregate implementation.
250 ///
251 /// # Returns
252 ///
253 /// whether live status was forced on `self`.
254 #[cfg(feature = "v1_22")]
255 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
256 #[doc(alias = "gst_aggregator_get_force_live")]
257 #[doc(alias = "get_force_live")]
258 fn is_force_live(&self) -> bool {
259 unsafe {
260 from_glib(ffi::gst_aggregator_get_force_live(
261 self.as_ref().to_glib_none().0,
262 ))
263 }
264 }
265
266 ///
267 /// # Returns
268 ///
269 /// whether inactive pads will not be waited on
270 #[cfg(feature = "v1_20")]
271 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
272 #[doc(alias = "gst_aggregator_get_ignore_inactive_pads")]
273 #[doc(alias = "get_ignore_inactive_pads")]
274 fn ignores_inactive_pads(&self) -> bool {
275 unsafe {
276 from_glib(ffi::gst_aggregator_get_ignore_inactive_pads(
277 self.as_ref().to_glib_none().0,
278 ))
279 }
280 }
281
282 /// Retrieves the latency values reported by `self` in response to the latency
283 /// query, or `GST_CLOCK_TIME_NONE` if there is not live source connected and the element
284 /// will not wait for the clock.
285 ///
286 /// Typically only called by subclasses.
287 ///
288 /// # Returns
289 ///
290 /// The latency or `GST_CLOCK_TIME_NONE` if the element does not sync
291 #[doc(alias = "gst_aggregator_get_latency")]
292 #[doc(alias = "get_latency")]
293 fn latency(&self) -> Option<gst::ClockTime> {
294 unsafe {
295 from_glib(ffi::gst_aggregator_get_latency(
296 self.as_ref().to_glib_none().0,
297 ))
298 }
299 }
300
301 /// Negotiates src pad caps with downstream elements.
302 /// Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again
303 /// if `GstAggregatorClass::negotiate` fails.
304 ///
305 /// # Returns
306 ///
307 /// [`true`] if the negotiation succeeded, else [`false`].
308 #[cfg(feature = "v1_18")]
309 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
310 #[doc(alias = "gst_aggregator_negotiate")]
311 fn negotiate(&self) -> bool {
312 unsafe {
313 from_glib(ffi::gst_aggregator_negotiate(
314 self.as_ref().to_glib_none().0,
315 ))
316 }
317 }
318
319 /// Use this function to determine what input buffers will be aggregated
320 /// to produce the next output buffer. This should only be called from
321 /// a [`samples-selected`][struct@crate::Aggregator#samples-selected] handler, and can be used to precisely
322 /// control aggregating parameters for a given set of input samples.
323 ///
324 /// # Returns
325 ///
326 /// The sample that is about to be aggregated. It may hold a [`gst::Buffer`][crate::gst::Buffer]
327 /// or a [`gst::BufferList`][crate::gst::BufferList]. The contents of its info structure is subclass-dependent,
328 /// and documented on a subclass basis. The buffers held by the sample are
329 /// not writable.
330 #[cfg(feature = "v1_18")]
331 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
332 #[doc(alias = "gst_aggregator_peek_next_sample")]
333 fn peek_next_sample(&self, pad: &impl IsA<AggregatorPad>) -> Option<gst::Sample> {
334 unsafe {
335 from_glib_full(ffi::gst_aggregator_peek_next_sample(
336 self.as_ref().to_glib_none().0,
337 pad.as_ref().to_glib_none().0,
338 ))
339 }
340 }
341
342 /// This method will push the provided event downstream. If needed, mandatory
343 /// events such as stream-start, caps, and segment events will be sent before
344 /// pushing the event.
345 ///
346 /// This API does not allow pushing stream-start, caps, segment and EOS events.
347 /// Specific API like [`set_src_caps()`][Self::set_src_caps()] should be used for these.
348 /// ## `event`
349 /// the [`gst::Event`][crate::gst::Event] to push.
350 #[cfg(feature = "v1_26")]
351 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
352 #[doc(alias = "gst_aggregator_push_src_event")]
353 fn push_src_event(&self, event: gst::Event) -> bool {
354 unsafe {
355 from_glib(ffi::gst_aggregator_push_src_event(
356 self.as_ref().to_glib_none().0,
357 event.into_glib_ptr(),
358 ))
359 }
360 }
361
362 /// Subclasses should call this at construction time in order for `self` to
363 /// aggregate on a timeout even when no live source is connected.
364 /// ## `force_live`
365 /// The new value
366 #[cfg(feature = "v1_22")]
367 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
368 #[doc(alias = "gst_aggregator_set_force_live")]
369 fn set_force_live(&self, force_live: bool) {
370 unsafe {
371 ffi::gst_aggregator_set_force_live(
372 self.as_ref().to_glib_none().0,
373 force_live.into_glib(),
374 );
375 }
376 }
377
378 /// Subclasses should call this when they don't want to time out
379 /// waiting for a pad that hasn't yet received any buffers in live
380 /// mode.
381 ///
382 /// [`Aggregator`][crate::Aggregator] will still wait once on each newly-added pad, making
383 /// sure upstream has had a fair chance to start up.
384 /// ## `ignore`
385 /// whether inactive pads should not be waited on
386 #[cfg(feature = "v1_20")]
387 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
388 #[doc(alias = "gst_aggregator_set_ignore_inactive_pads")]
389 fn set_ignore_inactive_pads(&self, ignore: bool) {
390 unsafe {
391 ffi::gst_aggregator_set_ignore_inactive_pads(
392 self.as_ref().to_glib_none().0,
393 ignore.into_glib(),
394 );
395 }
396 }
397
398 /// Lets [`Aggregator`][crate::Aggregator] sub-classes tell the baseclass what their internal
399 /// latency is. Will also post a LATENCY message on the bus so the pipeline
400 /// can reconfigure its global latency if the values changed.
401 /// ## `min_latency`
402 /// minimum latency
403 /// ## `max_latency`
404 /// maximum latency
405 #[doc(alias = "gst_aggregator_set_latency")]
406 #[doc(alias = "latency")]
407 fn set_latency(
408 &self,
409 min_latency: gst::ClockTime,
410 max_latency: impl Into<Option<gst::ClockTime>>,
411 ) {
412 unsafe {
413 ffi::gst_aggregator_set_latency(
414 self.as_ref().to_glib_none().0,
415 min_latency.into_glib(),
416 max_latency.into().into_glib(),
417 );
418 }
419 }
420
421 /// Sets the caps to be used on the src pad.
422 /// ## `caps`
423 /// The [`gst::Caps`][crate::gst::Caps] to set on the src pad.
424 #[doc(alias = "gst_aggregator_set_src_caps")]
425 fn set_src_caps(&self, caps: &gst::Caps) {
426 unsafe {
427 ffi::gst_aggregator_set_src_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0);
428 }
429 }
430
431 /// This is a simple `GstAggregatorClass::get_next_time` implementation that
432 /// just looks at the [`gst::Segment`][crate::gst::Segment] on the srcpad of the aggregator and bases
433 /// the next time on the running time there.
434 ///
435 /// This is the desired behaviour in most cases where you have a live source
436 /// and you have a dead line based aggregator subclass.
437 ///
438 /// # Returns
439 ///
440 /// The running time based on the position
441 #[cfg(feature = "v1_16")]
442 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
443 #[doc(alias = "gst_aggregator_simple_get_next_time")]
444 fn simple_get_next_time(&self) -> Option<gst::ClockTime> {
445 unsafe {
446 from_glib(ffi::gst_aggregator_simple_get_next_time(
447 self.as_ref().to_glib_none().0,
448 ))
449 }
450 }
451
452 /// Enables the emission of signals such as [`samples-selected`][struct@crate::Aggregator#samples-selected]
453 #[cfg(feature = "v1_18")]
454 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
455 #[doc(alias = "emit-signals")]
456 fn emits_signals(&self) -> bool {
457 ObjectExt::property(self.as_ref(), "emit-signals")
458 }
459
460 /// Enables the emission of signals such as [`samples-selected`][struct@crate::Aggregator#samples-selected]
461 #[cfg(feature = "v1_18")]
462 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
463 #[doc(alias = "emit-signals")]
464 fn set_emit_signals(&self, emit_signals: bool) {
465 ObjectExt::set_property(self.as_ref(), "emit-signals", emit_signals)
466 }
467
468 #[doc(alias = "start-time")]
469 fn start_time(&self) -> u64 {
470 ObjectExt::property(self.as_ref(), "start-time")
471 }
472
473 #[doc(alias = "start-time")]
474 fn set_start_time(&self, start_time: u64) {
475 ObjectExt::set_property(self.as_ref(), "start-time", start_time)
476 }
477
478 #[cfg(feature = "v1_18")]
479 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
480 #[doc(alias = "start-time-selection")]
481 fn start_time_selection(&self) -> AggregatorStartTimeSelection {
482 ObjectExt::property(self.as_ref(), "start-time-selection")
483 }
484
485 #[cfg(feature = "v1_18")]
486 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
487 #[doc(alias = "start-time-selection")]
488 fn set_start_time_selection(&self, start_time_selection: AggregatorStartTimeSelection) {
489 ObjectExt::set_property(self.as_ref(), "start-time-selection", start_time_selection)
490 }
491
492 #[cfg(feature = "v1_18")]
493 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
494 #[doc(alias = "emit-signals")]
495 fn connect_emit_signals_notify<F: Fn(&Self) + Send + Sync + 'static>(
496 &self,
497 f: F,
498 ) -> SignalHandlerId {
499 unsafe extern "C" fn notify_emit_signals_trampoline<
500 P: IsA<Aggregator>,
501 F: Fn(&P) + Send + Sync + 'static,
502 >(
503 this: *mut ffi::GstAggregator,
504 _param_spec: glib::ffi::gpointer,
505 f: glib::ffi::gpointer,
506 ) {
507 unsafe {
508 let f: &F = &*(f as *const F);
509 f(Aggregator::from_glib_borrow(this).unsafe_cast_ref())
510 }
511 }
512 unsafe {
513 let f: Box_<F> = Box_::new(f);
514 connect_raw(
515 self.as_ptr() as *mut _,
516 c"notify::emit-signals".as_ptr(),
517 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
518 notify_emit_signals_trampoline::<Self, F> as *const (),
519 )),
520 Box_::into_raw(f),
521 )
522 }
523 }
524
525 #[doc(alias = "latency")]
526 fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
527 &self,
528 f: F,
529 ) -> SignalHandlerId {
530 unsafe extern "C" fn notify_latency_trampoline<
531 P: IsA<Aggregator>,
532 F: Fn(&P) + Send + Sync + 'static,
533 >(
534 this: *mut ffi::GstAggregator,
535 _param_spec: glib::ffi::gpointer,
536 f: glib::ffi::gpointer,
537 ) {
538 unsafe {
539 let f: &F = &*(f as *const F);
540 f(Aggregator::from_glib_borrow(this).unsafe_cast_ref())
541 }
542 }
543 unsafe {
544 let f: Box_<F> = Box_::new(f);
545 connect_raw(
546 self.as_ptr() as *mut _,
547 c"notify::latency".as_ptr(),
548 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
549 notify_latency_trampoline::<Self, F> as *const (),
550 )),
551 Box_::into_raw(f),
552 )
553 }
554 }
555
556 #[doc(alias = "start-time")]
557 fn connect_start_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
558 &self,
559 f: F,
560 ) -> SignalHandlerId {
561 unsafe extern "C" fn notify_start_time_trampoline<
562 P: IsA<Aggregator>,
563 F: Fn(&P) + Send + Sync + 'static,
564 >(
565 this: *mut ffi::GstAggregator,
566 _param_spec: glib::ffi::gpointer,
567 f: glib::ffi::gpointer,
568 ) {
569 unsafe {
570 let f: &F = &*(f as *const F);
571 f(Aggregator::from_glib_borrow(this).unsafe_cast_ref())
572 }
573 }
574 unsafe {
575 let f: Box_<F> = Box_::new(f);
576 connect_raw(
577 self.as_ptr() as *mut _,
578 c"notify::start-time".as_ptr(),
579 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
580 notify_start_time_trampoline::<Self, F> as *const (),
581 )),
582 Box_::into_raw(f),
583 )
584 }
585 }
586
587 #[cfg(feature = "v1_18")]
588 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
589 #[doc(alias = "start-time-selection")]
590 fn connect_start_time_selection_notify<F: Fn(&Self) + Send + Sync + 'static>(
591 &self,
592 f: F,
593 ) -> SignalHandlerId {
594 unsafe extern "C" fn notify_start_time_selection_trampoline<
595 P: IsA<Aggregator>,
596 F: Fn(&P) + Send + Sync + 'static,
597 >(
598 this: *mut ffi::GstAggregator,
599 _param_spec: glib::ffi::gpointer,
600 f: glib::ffi::gpointer,
601 ) {
602 unsafe {
603 let f: &F = &*(f as *const F);
604 f(Aggregator::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::start-time-selection".as_ptr(),
612 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
613 notify_start_time_selection_trampoline::<Self, F> as *const (),
614 )),
615 Box_::into_raw(f),
616 )
617 }
618 }
619}
620
621impl<O: IsA<Aggregator>> AggregatorExt for O {}