gstreamer_base/auto/base_parse.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 /// This base class is for parser elements that process data and splits it
16 /// into separate audio/video/whatever frames.
17 ///
18 /// It provides for:
19 ///
20 /// * provides one sink pad and one source pad
21 /// * handles state changes
22 /// * can operate in pull mode or push mode
23 /// * handles seeking in both modes
24 /// * handles events (SEGMENT/EOS/FLUSH)
25 /// * handles queries (POSITION/DURATION/SEEKING/FORMAT/CONVERT)
26 /// * handles flushing
27 ///
28 /// The purpose of this base class is to provide the basic functionality of
29 /// a parser and share a lot of rather complex code.
30 ///
31 /// # Description of the parsing mechanism:
32 ///
33 /// ## Set-up phase
34 ///
35 /// * [`BaseParse`][crate::BaseParse] calls `GstBaseParseClass::start` to inform subclass
36 /// that data processing is about to start now.
37 ///
38 /// * [`BaseParse`][crate::BaseParse] class calls `GstBaseParseClass::set_sink_caps` to
39 /// inform the subclass about incoming sinkpad caps. Subclass could
40 /// already set the srcpad caps accordingly, but this might be delayed
41 /// until calling [`BaseParseExtManual::finish_frame()`][crate::prelude::BaseParseExtManual::finish_frame()] with a non-queued frame.
42 ///
43 /// * At least at this point subclass needs to tell the [`BaseParse`][crate::BaseParse] class
44 /// how big data chunks it wants to receive (minimum frame size ). It can
45 /// do this with [`BaseParseExt::set_min_frame_size()`][crate::prelude::BaseParseExt::set_min_frame_size()].
46 ///
47 /// * [`BaseParse`][crate::BaseParse] class sets up appropriate data passing mode (pull/push)
48 /// and starts to process the data.
49 ///
50 /// ## Parsing phase
51 ///
52 /// * [`BaseParse`][crate::BaseParse] gathers at least min_frame_size bytes of data either
53 /// by pulling it from upstream or collecting buffers in an internal
54 /// [`Adapter`][crate::Adapter].
55 ///
56 /// * A buffer of (at least) min_frame_size bytes is passed to subclass
57 /// with `GstBaseParseClass::handle_frame`. Subclass checks the contents
58 /// and can optionally return [`gst::FlowReturn::Ok`][crate::gst::FlowReturn::Ok] along with an amount of data
59 /// to be skipped to find a valid frame (which will result in a
60 /// subsequent DISCONT). If, otherwise, the buffer does not hold a
61 /// complete frame, `GstBaseParseClass::handle_frame` can merely return
62 /// and will be called again when additional data is available. In push
63 /// mode this amounts to an additional input buffer (thus minimal
64 /// additional latency), in pull mode this amounts to some arbitrary
65 /// reasonable buffer size increase.
66 ///
67 /// Of course, [`BaseParseExt::set_min_frame_size()`][crate::prelude::BaseParseExt::set_min_frame_size()] could also be used if
68 /// a very specific known amount of additional data is required. If,
69 /// however, the buffer holds a complete valid frame, it can pass the
70 /// size of this frame to [`BaseParseExtManual::finish_frame()`][crate::prelude::BaseParseExtManual::finish_frame()].
71 ///
72 /// If acting as a converter, it can also merely indicate consumed input
73 /// data while simultaneously providing custom output data. Note that
74 /// baseclass performs some processing (such as tracking overall consumed
75 /// data rate versus duration) for each finished frame, but other state
76 /// is only updated upon each call to `GstBaseParseClass::handle_frame`
77 /// (such as tracking upstream input timestamp).
78 ///
79 /// Subclass is also responsible for setting the buffer metadata
80 /// (e.g. buffer timestamp and duration, or keyframe if applicable).
81 /// (although the latter can also be done by [`BaseParse`][crate::BaseParse] if it is
82 /// appropriately configured, see below). Frame is provided with
83 /// timestamp derived from upstream (as much as generally possible),
84 /// duration obtained from configuration (see below), and offset
85 /// if meaningful (in pull mode).
86 ///
87 /// Note that `GstBaseParseClass::handle_frame` might receive any small
88 /// amount of input data when leftover data is being drained (e.g. at
89 /// EOS).
90 ///
91 /// * As part of finish frame processing, just prior to actually pushing
92 /// the buffer in question, it is passed to
93 /// `GstBaseParseClass::pre_push_frame` which gives subclass yet one last
94 /// chance to examine buffer metadata, or to send some custom (tag)
95 /// events, or to perform custom (segment) filtering.
96 ///
97 /// * During the parsing process `GstBaseParseClass` will handle both srcpad
98 /// and sinkpad events. They will be passed to subclass if
99 /// `GstBaseParseClass::sink_event` or `GstBaseParseClass::src_event`
100 /// implementations have been provided.
101 ///
102 /// ## Shutdown phase
103 ///
104 /// * [`BaseParse`][crate::BaseParse] class calls `GstBaseParseClass::stop` to inform the
105 /// subclass that data parsing will be stopped.
106 ///
107 /// Subclass is responsible for providing pad template caps for source and
108 /// sink pads. The pads need to be named "sink" and "src". It also needs to
109 /// set the fixed caps on srcpad, when the format is ensured (e.g. when
110 /// base class calls subclass' `GstBaseParseClass::set_sink_caps` function).
111 ///
112 /// This base class uses [`gst::Format::Default`][crate::gst::Format::Default] as a meaning of frames. So,
113 /// subclass conversion routine needs to know that conversion from
114 /// [`gst::Format::Time`][crate::gst::Format::Time] to [`gst::Format::Default`][crate::gst::Format::Default] must return the
115 /// frame number that can be found from the given byte position.
116 ///
117 /// [`BaseParse`][crate::BaseParse] uses subclasses conversion methods also for seeking (or
118 /// otherwise uses its own default one, see also below).
119 ///
120 /// Subclass `start` and `stop` functions will be called to inform the beginning
121 /// and end of data processing.
122 ///
123 /// Things that subclass need to take care of:
124 ///
125 /// * Provide pad templates
126 /// * Fixate the source pad caps when appropriate
127 /// * Inform base class how big data chunks should be retrieved. This is
128 /// done with [`BaseParseExt::set_min_frame_size()`][crate::prelude::BaseParseExt::set_min_frame_size()] function.
129 /// * Examine data chunks passed to subclass with
130 /// `GstBaseParseClass::handle_frame` and pass proper frame(s) to
131 /// [`BaseParseExtManual::finish_frame()`][crate::prelude::BaseParseExtManual::finish_frame()], and setting src pad caps and timestamps
132 /// on frame.
133 /// * Provide conversion functions
134 /// * Update the duration information with [`BaseParseExtManual::set_duration()`][crate::prelude::BaseParseExtManual::set_duration()]
135 /// * Optionally passthrough using [`BaseParseExt::set_passthrough()`][crate::prelude::BaseParseExt::set_passthrough()]
136 /// * Configure various baseparse parameters using
137 /// [`BaseParseExt::set_average_bitrate()`][crate::prelude::BaseParseExt::set_average_bitrate()], [`BaseParseExt::set_syncable()`][crate::prelude::BaseParseExt::set_syncable()]
138 /// and [`BaseParseExtManual::set_frame_rate()`][crate::prelude::BaseParseExtManual::set_frame_rate()].
139 ///
140 /// * In particular, if subclass is unable to determine a duration, but
141 /// parsing (or specs) yields a frames per seconds rate, then this can be
142 /// provided to [`BaseParse`][crate::BaseParse] to enable it to cater for buffer time
143 /// metadata (which will be taken from upstream as much as
144 /// possible). Internally keeping track of frame durations and respective
145 /// sizes that have been pushed provides [`BaseParse`][crate::BaseParse] with an estimated
146 /// bitrate. A default `GstBaseParseClass::convert` (used if not
147 /// overridden) will then use these rates to perform obvious conversions.
148 /// These rates are also used to update (estimated) duration at regular
149 /// frame intervals.
150 ///
151 /// This is an Abstract Base Class, you cannot instantiate it.
152 ///
153 /// ## Properties
154 ///
155 ///
156 /// #### `disable-clip`
157 /// Disable dropping buffers that are out of segment
158 ///
159 /// Readable | Writable
160 ///
161 ///
162 /// #### `disable-passthrough`
163 /// If set to [`true`], baseparse will unconditionally force parsing of the
164 /// incoming data. This can be required in the rare cases where the incoming
165 /// side-data (caps, pts, dts, ...) is not trusted by the user and wants to
166 /// force validation and parsing of the incoming data.
167 /// If set to [`false`], decision of whether to parse the data or not is up to
168 /// the implementation (standard behaviour).
169 ///
170 /// Readable | Writable
171 /// <details><summary><h4>Object</h4></summary>
172 ///
173 ///
174 /// #### `name`
175 /// Readable | Writable | Construct
176 ///
177 ///
178 /// #### `parent`
179 /// The parent of the object. Please note, that when changing the 'parent'
180 /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
181 /// signals due to locking issues. In some cases one can use
182 /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
183 /// achieve a similar effect.
184 ///
185 /// Readable | Writable
186 /// </details>
187 ///
188 /// # Implements
189 ///
190 /// [`BaseParseExt`][trait@crate::prelude::BaseParseExt], [`trait@gst::prelude::ElementExt`], [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`], [`BaseParseExtManual`][trait@crate::prelude::BaseParseExtManual]
191 #[doc(alias = "GstBaseParse")]
192 pub struct BaseParse(Object<ffi::GstBaseParse, ffi::GstBaseParseClass>) @extends gst::Element, gst::Object;
193
194 match fn {
195 type_ => || ffi::gst_base_parse_get_type(),
196 }
197}
198
199impl BaseParse {
200 pub const NONE: Option<&'static BaseParse> = None;
201}
202
203unsafe impl Send for BaseParse {}
204unsafe impl Sync for BaseParse {}
205
206/// Trait containing all [`struct@BaseParse`] methods.
207///
208/// # Implementors
209///
210/// [`BaseParse`][struct@crate::BaseParse]
211pub trait BaseParseExt: IsA<BaseParse> + 'static {
212 /// Adds an entry to the index associating `offset` to `ts`. It is recommended
213 /// to only add keyframe entries. `force` allows to bypass checks, such as
214 /// whether the stream is (upstream) seekable, another entry is already "close"
215 /// to the new entry, etc.
216 /// ## `offset`
217 /// offset of entry
218 /// ## `ts`
219 /// timestamp associated with offset
220 /// ## `key`
221 /// whether entry refers to keyframe
222 /// ## `force`
223 /// add entry disregarding sanity checks
224 ///
225 /// # Returns
226 ///
227 /// `gboolean` indicating whether entry was added
228 #[doc(alias = "gst_base_parse_add_index_entry")]
229 fn add_index_entry(&self, offset: u64, ts: gst::ClockTime, key: bool, force: bool) -> bool {
230 unsafe {
231 from_glib(ffi::gst_base_parse_add_index_entry(
232 self.as_ref().to_glib_none().0,
233 offset,
234 ts.into_glib(),
235 key.into_glib(),
236 force.into_glib(),
237 ))
238 }
239 }
240
241 /// Drains the adapter until it is empty. It decreases the min_frame_size to
242 /// match the current adapter size and calls chain method until the adapter
243 /// is emptied or chain returns with error.
244 #[doc(alias = "gst_base_parse_drain")]
245 fn drain(&self) {
246 unsafe {
247 ffi::gst_base_parse_drain(self.as_ref().to_glib_none().0);
248 }
249 }
250
251 /// Sets the parser subclass's tags and how they should be merged with any
252 /// upstream stream tags. This will override any tags previously-set
253 /// with [`merge_tags()`][Self::merge_tags()].
254 ///
255 /// Note that this is provided for convenience, and the subclass is
256 /// not required to use this and can still do tag handling on its own.
257 /// ## `tags`
258 /// a [`gst::TagList`][crate::gst::TagList] to merge, or NULL to unset
259 /// previously-set tags
260 /// ## `mode`
261 /// the [`gst::TagMergeMode`][crate::gst::TagMergeMode] to use, usually [`gst::TagMergeMode::Replace`][crate::gst::TagMergeMode::Replace]
262 #[doc(alias = "gst_base_parse_merge_tags")]
263 fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode) {
264 unsafe {
265 ffi::gst_base_parse_merge_tags(
266 self.as_ref().to_glib_none().0,
267 tags.to_glib_none().0,
268 mode.into_glib(),
269 );
270 }
271 }
272
273 /// By default, the base class will not allow two frames in a row to have the
274 /// same PTS but instead will set the second frame's PTS to GST_CLOCK_TIME_NONE.
275 /// Setting `allow_duplicated_pts` would allow outputting the same PTS multiple
276 /// times.
277 ///
278 /// For audio parsers this is generally not a good idea to allow as it can lead to
279 /// unnecessary resyncs if upstream provides coarse grained timestamps and
280 /// decoders and other elements generally interpolate missing timestamps based on
281 /// the number of samples so missing timestamps would be fixed up later.
282 ///
283 /// For video parsers this generally should be allowed as various elements expect
284 /// valid timestamps on all video frames and will error out or misbehave
285 /// otherwise.
286 ///
287 /// This value is not reset during PAUSED->READY state changes. Subclasses
288 /// can call this function from their instance init function.
289 /// ## `allow_duplicated_pts`
290 /// [`true`] if parser should allow duplicated PTS on the output
291 #[cfg(feature = "v1_30")]
292 #[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
293 #[doc(alias = "gst_base_parse_set_allow_duplicated_pts")]
294 fn set_allow_duplicated_pts(&self, allow_duplicated_pts: bool) {
295 unsafe {
296 ffi::gst_base_parse_set_allow_duplicated_pts(
297 self.as_ref().to_glib_none().0,
298 allow_duplicated_pts.into_glib(),
299 );
300 }
301 }
302
303 /// Optionally sets the average bitrate detected in media (if non-zero),
304 /// e.g. based on metadata, as it will be posted to the application.
305 ///
306 /// By default, announced average bitrate is estimated. The average bitrate
307 /// is used to estimate the total duration of the stream and to estimate
308 /// a seek position, if there's no index and the format is syncable
309 /// (see [`set_syncable()`][Self::set_syncable()]).
310 ///
311 /// This value is reset during PAUSED->READY state changes. Subclasses must
312 /// call this function from `GstBaseParseClass::start` if they want to set a static value.
313 /// ## `bitrate`
314 /// average bitrate in bits/second
315 #[doc(alias = "gst_base_parse_set_average_bitrate")]
316 fn set_average_bitrate(&self, bitrate: u32) {
317 unsafe {
318 ffi::gst_base_parse_set_average_bitrate(self.as_ref().to_glib_none().0, bitrate);
319 }
320 }
321
322 /// Set if frames carry timing information which the subclass can (generally)
323 /// parse and provide. In particular, intrinsic (rather than estimated) time
324 /// can be obtained following a seek.
325 ///
326 /// This value is reset during PAUSED->READY state changes. Subclasses must
327 /// call this function from `GstBaseParseClass::start` if they want to set a static value.
328 /// ## `has_timing`
329 /// whether frames carry timing information
330 #[doc(alias = "gst_base_parse_set_has_timing_info")]
331 fn set_has_timing_info(&self, has_timing: bool) {
332 unsafe {
333 ffi::gst_base_parse_set_has_timing_info(
334 self.as_ref().to_glib_none().0,
335 has_timing.into_glib(),
336 );
337 }
338 }
339
340 /// By default, the base class might try to infer PTS from DTS and vice
341 /// versa. While this is generally correct for audio data, it may not
342 /// be otherwise. Sub-classes implementing such formats should disable
343 /// timestamp inferring.
344 ///
345 /// This value is retained over PAUSED->READY state changes. Subclasses
346 /// can call this function from their instance init function.
347 /// ## `infer_ts`
348 /// [`true`] if parser should infer DTS/PTS from each other
349 #[doc(alias = "gst_base_parse_set_infer_ts")]
350 fn set_infer_ts(&self, infer_ts: bool) {
351 unsafe {
352 ffi::gst_base_parse_set_infer_ts(self.as_ref().to_glib_none().0, infer_ts.into_glib());
353 }
354 }
355
356 /// Sets the minimum and maximum (which may likely be equal) latency introduced
357 /// by the parsing process. If there is such a latency, which depends on the
358 /// particular parsing of the format, it typically corresponds to 1 frame duration.
359 ///
360 /// If the provided values changed from previously provided ones, this will
361 /// also post a LATENCY message on the bus so the pipeline can reconfigure its
362 /// global latency.
363 ///
364 /// This value is retained over PAUSED->READY state changes. Subclasses
365 /// can call this function from their instance init function.
366 /// ## `min_latency`
367 /// minimum parse latency
368 /// ## `max_latency`
369 /// maximum parse latency
370 #[doc(alias = "gst_base_parse_set_latency")]
371 fn set_latency(
372 &self,
373 min_latency: gst::ClockTime,
374 max_latency: impl Into<Option<gst::ClockTime>>,
375 ) {
376 unsafe {
377 ffi::gst_base_parse_set_latency(
378 self.as_ref().to_glib_none().0,
379 min_latency.into_glib(),
380 max_latency.into().into_glib(),
381 );
382 }
383 }
384
385 /// Subclass can use this function to tell the base class that it needs to
386 /// be given buffers of at least `min_size` bytes.
387 ///
388 /// This value is reset during PAUSED->READY state changes. Subclasses must
389 /// call this function from `GstBaseParseClass::start` if they want to set a static value.
390 /// ## `min_size`
391 /// Minimum size in bytes of the data that this base class should
392 /// give to subclass.
393 #[doc(alias = "gst_base_parse_set_min_frame_size")]
394 fn set_min_frame_size(&self, min_size: u32) {
395 unsafe {
396 ffi::gst_base_parse_set_min_frame_size(self.as_ref().to_glib_none().0, min_size);
397 }
398 }
399
400 /// Set if the nature of the format or configuration does not allow (much)
401 /// parsing, and the parser should operate in passthrough mode (which only
402 /// applies when operating in push mode). That is, incoming buffers are
403 /// pushed through unmodified, i.e. no `GstBaseParseClass::handle_frame`
404 /// will be invoked, but `GstBaseParseClass::pre_push_frame` will still be
405 /// invoked, so subclass can perform as much or as little is appropriate for
406 /// passthrough semantics in `GstBaseParseClass::pre_push_frame`.
407 ///
408 /// This value is reset during PAUSED->READY state changes. Subclasses must
409 /// call this function from `GstBaseParseClass::start` if they want to set a static value.
410 /// ## `passthrough`
411 /// [`true`] if parser should run in passthrough mode
412 #[doc(alias = "gst_base_parse_set_passthrough")]
413 fn set_passthrough(&self, passthrough: bool) {
414 unsafe {
415 ffi::gst_base_parse_set_passthrough(
416 self.as_ref().to_glib_none().0,
417 passthrough.into_glib(),
418 );
419 }
420 }
421
422 /// By default, the base class will guess PTS timestamps using a simple
423 /// interpolation (previous timestamp + duration), which is incorrect for
424 /// data streams with reordering, where PTS can go backward. Sub-classes
425 /// implementing such formats should disable PTS interpolation.
426 ///
427 /// This value is retained over PAUSED->READY state changes. Subclasses
428 /// can call this function from their instance init function.
429 /// ## `pts_interpolate`
430 /// [`true`] if parser should interpolate PTS timestamps
431 #[doc(alias = "gst_base_parse_set_pts_interpolation")]
432 fn set_pts_interpolation(&self, pts_interpolate: bool) {
433 unsafe {
434 ffi::gst_base_parse_set_pts_interpolation(
435 self.as_ref().to_glib_none().0,
436 pts_interpolate.into_glib(),
437 );
438 }
439 }
440
441 /// Set if frame starts can be identified. This is set by default and
442 /// determines whether seeking based on bitrate averages
443 /// is possible for a format/stream.
444 ///
445 /// This value is reset during PAUSED->READY state changes. Subclasses must
446 /// call this function from `GstBaseParseClass::start` if they want to set a static value.
447 /// ## `syncable`
448 /// set if frame starts can be identified
449 #[doc(alias = "gst_base_parse_set_syncable")]
450 fn set_syncable(&self, syncable: bool) {
451 unsafe {
452 ffi::gst_base_parse_set_syncable(self.as_ref().to_glib_none().0, syncable.into_glib());
453 }
454 }
455
456 /// This function should only be called from a `handle_frame` implementation.
457 ///
458 /// [`BaseParse`][crate::BaseParse] creates initial timestamps for frames by using the last
459 /// timestamp seen in the stream before the frame starts. In certain
460 /// cases, the correct timestamps will occur in the stream after the
461 /// start of the frame, but before the start of the actual picture data.
462 /// This function can be used to set the timestamps based on the offset
463 /// into the frame data that the picture starts.
464 /// ## `offset`
465 /// offset into current buffer
466 #[doc(alias = "gst_base_parse_set_ts_at_offset")]
467 fn set_ts_at_offset(&self, offset: usize) {
468 unsafe {
469 ffi::gst_base_parse_set_ts_at_offset(self.as_ref().to_glib_none().0, offset);
470 }
471 }
472
473 /// Disable dropping buffers that are out of segment
474 #[cfg(feature = "v1_28")]
475 #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
476 #[doc(alias = "disable-clip")]
477 fn is_disable_clip(&self) -> bool {
478 ObjectExt::property(self.as_ref(), "disable-clip")
479 }
480
481 /// Disable dropping buffers that are out of segment
482 #[cfg(feature = "v1_28")]
483 #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
484 #[doc(alias = "disable-clip")]
485 fn set_disable_clip(&self, disable_clip: bool) {
486 ObjectExt::set_property(self.as_ref(), "disable-clip", disable_clip)
487 }
488
489 /// If set to [`true`], baseparse will unconditionally force parsing of the
490 /// incoming data. This can be required in the rare cases where the incoming
491 /// side-data (caps, pts, dts, ...) is not trusted by the user and wants to
492 /// force validation and parsing of the incoming data.
493 /// If set to [`false`], decision of whether to parse the data or not is up to
494 /// the implementation (standard behaviour).
495 #[doc(alias = "disable-passthrough")]
496 fn is_disable_passthrough(&self) -> bool {
497 ObjectExt::property(self.as_ref(), "disable-passthrough")
498 }
499
500 /// If set to [`true`], baseparse will unconditionally force parsing of the
501 /// incoming data. This can be required in the rare cases where the incoming
502 /// side-data (caps, pts, dts, ...) is not trusted by the user and wants to
503 /// force validation and parsing of the incoming data.
504 /// If set to [`false`], decision of whether to parse the data or not is up to
505 /// the implementation (standard behaviour).
506 #[doc(alias = "disable-passthrough")]
507 fn set_disable_passthrough(&self, disable_passthrough: bool) {
508 ObjectExt::set_property(self.as_ref(), "disable-passthrough", disable_passthrough)
509 }
510
511 #[cfg(feature = "v1_28")]
512 #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
513 #[doc(alias = "disable-clip")]
514 fn connect_disable_clip_notify<F: Fn(&Self) + Send + Sync + 'static>(
515 &self,
516 f: F,
517 ) -> SignalHandlerId {
518 unsafe extern "C" fn notify_disable_clip_trampoline<
519 P: IsA<BaseParse>,
520 F: Fn(&P) + Send + Sync + 'static,
521 >(
522 this: *mut ffi::GstBaseParse,
523 _param_spec: glib::ffi::gpointer,
524 f: glib::ffi::gpointer,
525 ) {
526 unsafe {
527 let f: &F = &*(f as *const F);
528 f(BaseParse::from_glib_borrow(this).unsafe_cast_ref())
529 }
530 }
531 unsafe {
532 let f: Box_<F> = Box_::new(f);
533 connect_raw(
534 self.as_ptr() as *mut _,
535 c"notify::disable-clip".as_ptr(),
536 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
537 notify_disable_clip_trampoline::<Self, F> as *const (),
538 )),
539 Box_::into_raw(f),
540 )
541 }
542 }
543
544 #[doc(alias = "disable-passthrough")]
545 fn connect_disable_passthrough_notify<F: Fn(&Self) + Send + Sync + 'static>(
546 &self,
547 f: F,
548 ) -> SignalHandlerId {
549 unsafe extern "C" fn notify_disable_passthrough_trampoline<
550 P: IsA<BaseParse>,
551 F: Fn(&P) + Send + Sync + 'static,
552 >(
553 this: *mut ffi::GstBaseParse,
554 _param_spec: glib::ffi::gpointer,
555 f: glib::ffi::gpointer,
556 ) {
557 unsafe {
558 let f: &F = &*(f as *const F);
559 f(BaseParse::from_glib_borrow(this).unsafe_cast_ref())
560 }
561 }
562 unsafe {
563 let f: Box_<F> = Box_::new(f);
564 connect_raw(
565 self.as_ptr() as *mut _,
566 c"notify::disable-passthrough".as_ptr(),
567 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
568 notify_disable_passthrough_trampoline::<Self, F> as *const (),
569 )),
570 Box_::into_raw(f),
571 )
572 }
573 }
574}
575
576impl<O: IsA<BaseParse>> BaseParseExt for O {}