gstreamer_editing_services/auto/pipeline.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, PipelineFlags, Timeline};
7use glib::{
8 prelude::*,
9 signal::{connect_raw, SignalHandlerId},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 /// A [`Pipeline`][crate::Pipeline] can take an audio-video [`Timeline`][crate::Timeline] and conveniently
16 /// link its [`Track`][crate::Track]-s to an internal `playsink` element, for
17 /// preview/playback, and an internal `encodebin` element, for rendering.
18 /// You can switch between these modes using [`GESPipelineExt::set_mode()`][crate::prelude::GESPipelineExt::set_mode()].
19 ///
20 /// You can choose the specific audio and video sinks used for previewing
21 /// the timeline by setting the [`audio-sink`][struct@crate::Pipeline#audio-sink] and
22 /// [`video-sink`][struct@crate::Pipeline#video-sink] properties.
23 ///
24 /// You can set the encoding and save location used in rendering by calling
25 /// [`GESPipelineExt::set_render_settings()`][crate::prelude::GESPipelineExt::set_render_settings()].
26 ///
27 /// ## Properties
28 ///
29 ///
30 /// #### `audio-filter`
31 /// The audio filter(s) to apply during playback in preview mode,
32 /// immediately before the [`audio-sink`][struct@crate::Pipeline#audio-sink]. This exposes the
33 /// `playsink:audio-filter` property of the internal `playsink`.
34 ///
35 /// Readable | Writeable
36 ///
37 ///
38 /// #### `audio-sink`
39 /// The audio sink used for preview. This exposes the
40 /// `playsink:audio-sink` property of the internal `playsink`.
41 ///
42 /// Readable | Writeable
43 ///
44 ///
45 /// #### `mode`
46 /// The pipeline's mode. In preview mode (for audio or video, or both)
47 /// the pipeline can display the timeline's content to an end user. In
48 /// rendering mode the pipeline can encode the timeline's content and
49 /// save it to a file.
50 ///
51 /// Readable | Writeable
52 ///
53 ///
54 /// #### `timeline`
55 /// The timeline used by this pipeline, whose content it will play and
56 /// render, or [`None`] if the pipeline does not yet have a timeline.
57 ///
58 /// Note that after you set the timeline for the first time, subsequent
59 /// calls to change the timeline will fail.
60 ///
61 /// Readable | Writeable
62 ///
63 ///
64 /// #### `video-filter`
65 /// The video filter(s) to apply during playback in preview mode,
66 /// immediately before the [`video-sink`][struct@crate::Pipeline#video-sink]. This exposes the
67 /// `playsink:video-filter` property of the internal `playsink`.
68 ///
69 /// Readable | Writeable
70 ///
71 ///
72 /// #### `video-sink`
73 /// The video sink used for preview. This exposes the
74 /// `playsink:video-sink` property of the internal `playsink`.
75 ///
76 /// Readable | Writeable
77 /// <details><summary><h4>Pipeline</h4></summary>
78 ///
79 ///
80 /// #### `auto-flush-bus`
81 /// Whether or not to automatically flush all messages on the
82 /// pipeline's bus when going from READY to NULL state. Please see
83 /// [`PipelineExtManual::set_auto_flush_bus()`][crate::gst::prelude::PipelineExtManual::set_auto_flush_bus()] for more information on this option.
84 ///
85 /// Readable | Writeable
86 ///
87 ///
88 /// #### `delay`
89 /// The expected delay needed for elements to spin up to the
90 /// PLAYING state expressed in nanoseconds.
91 /// see [`PipelineExtManual::set_delay()`][crate::gst::prelude::PipelineExtManual::set_delay()] for more information on this option.
92 ///
93 /// Readable | Writeable
94 ///
95 ///
96 /// #### `latency`
97 /// Latency to configure on the pipeline. See [`PipelineExtManual::set_latency()`][crate::gst::prelude::PipelineExtManual::set_latency()].
98 ///
99 /// Readable | Writeable
100 /// </details>
101 /// <details><summary><h4>Bin</h4></summary>
102 ///
103 ///
104 /// #### `async-handling`
105 /// If set to [`true`], the bin will handle asynchronous state changes.
106 /// This should be used only if the bin subclass is modifying the state
107 /// of its children on its own.
108 ///
109 /// Readable | Writeable
110 ///
111 ///
112 /// #### `message-forward`
113 /// Forward all children messages, even those that would normally be filtered by
114 /// the bin. This can be interesting when one wants to be notified of the EOS
115 /// state of individual elements, for example.
116 ///
117 /// The messages are converted to an ELEMENT message with the bin as the
118 /// source. The structure of the message is named `GstBinForwarded` and contains
119 /// a field named `message` that contains the original forwarded `GstMessage`.
120 ///
121 /// Readable | Writeable
122 /// </details>
123 /// <details><summary><h4>Object</h4></summary>
124 ///
125 ///
126 /// #### `name`
127 /// Readable | Writeable | Construct
128 ///
129 ///
130 /// #### `parent`
131 /// The parent of the object. Please note, that when changing the 'parent'
132 /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
133 /// signals due to locking issues. In some cases one can use
134 /// [`element-added`][struct@crate::gst::Bin#element-added] or [`element-removed`][struct@crate::gst::Bin#element-removed] signals on the parent to
135 /// achieve a similar effect.
136 ///
137 /// Readable | Writeable
138 /// </details>
139 ///
140 /// # Implements
141 ///
142 /// [`GESPipelineExt`][trait@crate::prelude::GESPipelineExt], [`trait@gst::prelude::PipelineExt`], [`trait@gst::prelude::BinExt`], [`trait@gst::prelude::ElementExt`], [`trait@gst::prelude::GstObjectExt`], [`trait@glib::ObjectExt`], [`trait@gst::prelude::ChildProxyExt`]
143 #[doc(alias = "GESPipeline")]
144 pub struct Pipeline(Object<ffi::GESPipeline, ffi::GESPipelineClass>) @extends gst::Pipeline, gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy;
145
146 match fn {
147 type_ => || ffi::ges_pipeline_get_type(),
148 }
149}
150
151impl Pipeline {
152 pub const NONE: Option<&'static Pipeline> = None;
153
154 /// Creates a new pipeline.
155 ///
156 /// # Returns
157 ///
158 /// The newly created pipeline.
159 #[doc(alias = "ges_pipeline_new")]
160 pub fn new() -> Pipeline {
161 assert_initialized_main_thread!();
162 unsafe { from_glib_none(ffi::ges_pipeline_new()) }
163 }
164}
165
166impl Default for Pipeline {
167 fn default() -> Self {
168 Self::new()
169 }
170}
171
172mod sealed {
173 pub trait Sealed {}
174 impl<T: super::IsA<super::Pipeline>> Sealed for T {}
175}
176
177/// Trait containing all [`struct@Pipeline`] methods.
178///
179/// # Implementors
180///
181/// [`Pipeline`][struct@crate::Pipeline]
182pub trait GESPipelineExt: IsA<Pipeline> + sealed::Sealed + 'static {
183 /// Gets the [`mode`][struct@crate::Pipeline#mode] of the pipeline.
184 ///
185 /// # Returns
186 ///
187 /// The current mode of `self`.
188 #[doc(alias = "ges_pipeline_get_mode")]
189 #[doc(alias = "get_mode")]
190 fn mode(&self) -> PipelineFlags {
191 unsafe { from_glib(ffi::ges_pipeline_get_mode(self.as_ref().to_glib_none().0)) }
192 }
193
194 /// Gets a sample from the pipeline of the currently displayed image in
195 /// preview, in the specified format.
196 ///
197 /// Note that if you use "ANY" caps for `caps`, then the current format of
198 /// the image is used. You can retrieve these caps from the returned sample
199 /// with `gst_sample_get_caps()`.
200 /// ## `caps`
201 /// Some caps to specifying the desired format, or
202 /// `GST_CAPS_ANY` to use the native format
203 ///
204 /// # Returns
205 ///
206 /// A sample of `self`'s current image preview in
207 /// the format given by `caps`, or [`None`] if an error prevented fetching the
208 /// sample.
209 #[doc(alias = "ges_pipeline_get_thumbnail")]
210 #[doc(alias = "get_thumbnail")]
211 fn thumbnail(&self, caps: &gst::Caps) -> Option<gst::Sample> {
212 unsafe {
213 from_glib_full(ffi::ges_pipeline_get_thumbnail(
214 self.as_ref().to_glib_none().0,
215 caps.to_glib_none().0,
216 ))
217 }
218 }
219
220 /// Gets a sample from the pipeline of the currently displayed image in
221 /// preview, in the 24-bit "RGB" format and of the desired width and
222 /// height.
223 ///
224 /// See [`thumbnail()`][Self::thumbnail()].
225 /// ## `width`
226 /// The requested pixel width of the image, or -1 to use the native
227 /// size
228 /// ## `height`
229 /// The requested pixel height of the image, or -1 to use the
230 /// native size
231 ///
232 /// # Returns
233 ///
234 /// A sample of `self`'s current image preview in
235 /// the "RGB" format, scaled to `width` and `height`, or [`None`] if an error
236 /// prevented fetching the sample.
237 #[doc(alias = "ges_pipeline_get_thumbnail_rgb24")]
238 #[doc(alias = "get_thumbnail_rgb24")]
239 fn thumbnail_rgb24(&self, width: i32, height: i32) -> Option<gst::Sample> {
240 unsafe {
241 from_glib_full(ffi::ges_pipeline_get_thumbnail_rgb24(
242 self.as_ref().to_glib_none().0,
243 width,
244 height,
245 ))
246 }
247 }
248
249 /// Gets the [`audio-sink`][struct@crate::Pipeline#audio-sink] of the pipeline.
250 ///
251 /// # Returns
252 ///
253 /// The audio sink used by `self` for preview.
254 #[doc(alias = "ges_pipeline_preview_get_audio_sink")]
255 fn preview_get_audio_sink(&self) -> Option<gst::Element> {
256 unsafe {
257 from_glib_full(ffi::ges_pipeline_preview_get_audio_sink(
258 self.as_ref().to_glib_none().0,
259 ))
260 }
261 }
262
263 /// Gets the [`video-sink`][struct@crate::Pipeline#video-sink] of the pipeline.
264 ///
265 /// # Returns
266 ///
267 /// The video sink used by `self` for preview.
268 #[doc(alias = "ges_pipeline_preview_get_video_sink")]
269 fn preview_get_video_sink(&self) -> Option<gst::Element> {
270 unsafe {
271 from_glib_full(ffi::ges_pipeline_preview_get_video_sink(
272 self.as_ref().to_glib_none().0,
273 ))
274 }
275 }
276
277 /// Sets the [`audio-sink`][struct@crate::Pipeline#audio-sink] of the pipeline.
278 /// ## `sink`
279 /// A audio sink for `self` to use for preview
280 #[doc(alias = "ges_pipeline_preview_set_audio_sink")]
281 fn preview_set_audio_sink(&self, sink: Option<&impl IsA<gst::Element>>) {
282 unsafe {
283 ffi::ges_pipeline_preview_set_audio_sink(
284 self.as_ref().to_glib_none().0,
285 sink.map(|p| p.as_ref()).to_glib_none().0,
286 );
287 }
288 }
289
290 /// Sets the [`video-sink`][struct@crate::Pipeline#video-sink] of the pipeline.
291 /// ## `sink`
292 /// A video sink for `self` to use for preview
293 #[doc(alias = "ges_pipeline_preview_set_video_sink")]
294 fn preview_set_video_sink(&self, sink: Option<&impl IsA<gst::Element>>) {
295 unsafe {
296 ffi::ges_pipeline_preview_set_video_sink(
297 self.as_ref().to_glib_none().0,
298 sink.map(|p| p.as_ref()).to_glib_none().0,
299 );
300 }
301 }
302
303 /// Saves the currently displayed image of the pipeline in preview to the
304 /// given location, in the specified dimensions and format.
305 /// ## `width`
306 /// The requested pixel width of the image, or -1 to use the native
307 /// size
308 /// ## `height`
309 /// The requested pixel height of the image, or -1 to use the
310 /// native size
311 /// ## `format`
312 /// The desired mime type (for example, "image/jpeg")
313 /// ## `location`
314 /// The path to save the thumbnail to
315 ///
316 /// # Returns
317 ///
318 /// [`true`] if `self`'s current image preview was successfully saved
319 /// to `location` using the given `format`, `height` and `width`.
320 #[doc(alias = "ges_pipeline_save_thumbnail")]
321 fn save_thumbnail(
322 &self,
323 width: i32,
324 height: i32,
325 format: &str,
326 location: &str,
327 ) -> Result<(), glib::Error> {
328 unsafe {
329 let mut error = std::ptr::null_mut();
330 let is_ok = ffi::ges_pipeline_save_thumbnail(
331 self.as_ref().to_glib_none().0,
332 width,
333 height,
334 format.to_glib_none().0,
335 location.to_glib_none().0,
336 &mut error,
337 );
338 debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
339 if error.is_null() {
340 Ok(())
341 } else {
342 Err(from_glib_full(error))
343 }
344 }
345 }
346
347 /// Sets the [`mode`][struct@crate::Pipeline#mode] of the pipeline.
348 ///
349 /// Note that the pipeline will be set to [`gst::State::Null`][crate::gst::State::Null] during this call to
350 /// perform the necessary changes. You will need to set the state again yourself
351 /// after calling this.
352 ///
353 /// > **NOTE**: [Rendering settings](ges_pipeline_set_render_settings) need to be
354 /// > set before setting `mode` to [`PipelineFlags::RENDER`][crate::PipelineFlags::RENDER] or
355 /// > [`PipelineFlags::SMART_RENDER`][crate::PipelineFlags::SMART_RENDER], the call to this method will fail
356 /// > otherwise.
357 /// ## `mode`
358 /// The mode to set for `self`
359 ///
360 /// # Returns
361 ///
362 /// [`true`] if the mode of `self` was successfully set to `mode`.
363 #[doc(alias = "ges_pipeline_set_mode")]
364 #[doc(alias = "mode")]
365 fn set_mode(&self, mode: PipelineFlags) -> Result<(), glib::error::BoolError> {
366 unsafe {
367 glib::result_from_gboolean!(
368 ffi::ges_pipeline_set_mode(self.as_ref().to_glib_none().0, mode.into_glib()),
369 "Failed to set mode"
370 )
371 }
372 }
373
374 /// Specifies encoding setting to be used by the pipeline to render its
375 /// [`timeline`][struct@crate::Pipeline#timeline], and where the result should be written to.
376 ///
377 /// This method **must** be called before setting the pipeline mode to
378 /// [`PipelineFlags::RENDER`][crate::PipelineFlags::RENDER].
379 /// ## `output_uri`
380 /// The URI to save the [`timeline`][struct@crate::Pipeline#timeline] rendering
381 /// result to
382 /// ## `profile`
383 /// The encoding to use for rendering the [`timeline`][struct@crate::Pipeline#timeline]
384 ///
385 /// # Returns
386 ///
387 /// [`true`] if the settings were successfully set on `self`.
388 #[doc(alias = "ges_pipeline_set_render_settings")]
389 fn set_render_settings(
390 &self,
391 output_uri: &str,
392 profile: &impl IsA<gst_pbutils::EncodingProfile>,
393 ) -> Result<(), glib::error::BoolError> {
394 unsafe {
395 glib::result_from_gboolean!(
396 ffi::ges_pipeline_set_render_settings(
397 self.as_ref().to_glib_none().0,
398 output_uri.to_glib_none().0,
399 profile.as_ref().to_glib_none().0
400 ),
401 "Failed to set render settings"
402 )
403 }
404 }
405
406 /// Takes the given timeline and sets it as the [`timeline`][struct@crate::Pipeline#timeline] for
407 /// the pipeline.
408 ///
409 /// Note that you should only call this method once on a given pipeline
410 /// because a pipeline can not have its [`timeline`][struct@crate::Pipeline#timeline] changed after
411 /// it has been set.
412 /// ## `timeline`
413 /// The timeline to set for `self`
414 ///
415 /// # Returns
416 ///
417 /// [`true`] if `timeline` was successfully given to `self`.
418 #[doc(alias = "ges_pipeline_set_timeline")]
419 #[doc(alias = "timeline")]
420 fn set_timeline(&self, timeline: &impl IsA<Timeline>) -> Result<(), glib::error::BoolError> {
421 unsafe {
422 glib::result_from_gboolean!(
423 ffi::ges_pipeline_set_timeline(
424 self.as_ref().to_glib_none().0,
425 timeline.as_ref().to_glib_none().0
426 ),
427 "Failed to set timeline"
428 )
429 }
430 }
431
432 /// The audio filter(s) to apply during playback in preview mode,
433 /// immediately before the [`audio-sink`][struct@crate::Pipeline#audio-sink]. This exposes the
434 /// `playsink:audio-filter` property of the internal `playsink`.
435 #[doc(alias = "audio-filter")]
436 fn audio_filter(&self) -> Option<gst::Element> {
437 ObjectExt::property(self.as_ref(), "audio-filter")
438 }
439
440 /// The audio filter(s) to apply during playback in preview mode,
441 /// immediately before the [`audio-sink`][struct@crate::Pipeline#audio-sink]. This exposes the
442 /// `playsink:audio-filter` property of the internal `playsink`.
443 #[doc(alias = "audio-filter")]
444 fn set_audio_filter<P: IsA<gst::Element>>(&self, audio_filter: Option<&P>) {
445 ObjectExt::set_property(self.as_ref(), "audio-filter", audio_filter)
446 }
447
448 /// The audio sink used for preview. This exposes the
449 /// `playsink:audio-sink` property of the internal `playsink`.
450 #[doc(alias = "audio-sink")]
451 fn audio_sink(&self) -> Option<gst::Element> {
452 ObjectExt::property(self.as_ref(), "audio-sink")
453 }
454
455 /// The audio sink used for preview. This exposes the
456 /// `playsink:audio-sink` property of the internal `playsink`.
457 #[doc(alias = "audio-sink")]
458 fn set_audio_sink<P: IsA<gst::Element>>(&self, audio_sink: Option<&P>) {
459 ObjectExt::set_property(self.as_ref(), "audio-sink", audio_sink)
460 }
461
462 /// The timeline used by this pipeline, whose content it will play and
463 /// render, or [`None`] if the pipeline does not yet have a timeline.
464 ///
465 /// Note that after you set the timeline for the first time, subsequent
466 /// calls to change the timeline will fail.
467 fn timeline(&self) -> Option<Timeline> {
468 ObjectExt::property(self.as_ref(), "timeline")
469 }
470
471 /// The video filter(s) to apply during playback in preview mode,
472 /// immediately before the [`video-sink`][struct@crate::Pipeline#video-sink]. This exposes the
473 /// `playsink:video-filter` property of the internal `playsink`.
474 #[doc(alias = "video-filter")]
475 fn video_filter(&self) -> Option<gst::Element> {
476 ObjectExt::property(self.as_ref(), "video-filter")
477 }
478
479 /// The video filter(s) to apply during playback in preview mode,
480 /// immediately before the [`video-sink`][struct@crate::Pipeline#video-sink]. This exposes the
481 /// `playsink:video-filter` property of the internal `playsink`.
482 #[doc(alias = "video-filter")]
483 fn set_video_filter<P: IsA<gst::Element>>(&self, video_filter: Option<&P>) {
484 ObjectExt::set_property(self.as_ref(), "video-filter", video_filter)
485 }
486
487 /// The video sink used for preview. This exposes the
488 /// `playsink:video-sink` property of the internal `playsink`.
489 #[doc(alias = "video-sink")]
490 fn video_sink(&self) -> Option<gst::Element> {
491 ObjectExt::property(self.as_ref(), "video-sink")
492 }
493
494 /// The video sink used for preview. This exposes the
495 /// `playsink:video-sink` property of the internal `playsink`.
496 #[doc(alias = "video-sink")]
497 fn set_video_sink<P: IsA<gst::Element>>(&self, video_sink: Option<&P>) {
498 ObjectExt::set_property(self.as_ref(), "video-sink", video_sink)
499 }
500
501 #[doc(alias = "audio-filter")]
502 fn connect_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
503 unsafe extern "C" fn notify_audio_filter_trampoline<
504 P: IsA<Pipeline>,
505 F: Fn(&P) + 'static,
506 >(
507 this: *mut ffi::GESPipeline,
508 _param_spec: glib::ffi::gpointer,
509 f: glib::ffi::gpointer,
510 ) {
511 let f: &F = &*(f as *const F);
512 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
513 }
514 unsafe {
515 let f: Box_<F> = Box_::new(f);
516 connect_raw(
517 self.as_ptr() as *mut _,
518 b"notify::audio-filter\0".as_ptr() as *const _,
519 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
520 notify_audio_filter_trampoline::<Self, F> as *const (),
521 )),
522 Box_::into_raw(f),
523 )
524 }
525 }
526
527 #[doc(alias = "audio-sink")]
528 fn connect_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
529 unsafe extern "C" fn notify_audio_sink_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
530 this: *mut ffi::GESPipeline,
531 _param_spec: glib::ffi::gpointer,
532 f: glib::ffi::gpointer,
533 ) {
534 let f: &F = &*(f as *const F);
535 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
536 }
537 unsafe {
538 let f: Box_<F> = Box_::new(f);
539 connect_raw(
540 self.as_ptr() as *mut _,
541 b"notify::audio-sink\0".as_ptr() as *const _,
542 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
543 notify_audio_sink_trampoline::<Self, F> as *const (),
544 )),
545 Box_::into_raw(f),
546 )
547 }
548 }
549
550 #[doc(alias = "mode")]
551 fn connect_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
552 unsafe extern "C" fn notify_mode_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
553 this: *mut ffi::GESPipeline,
554 _param_spec: glib::ffi::gpointer,
555 f: glib::ffi::gpointer,
556 ) {
557 let f: &F = &*(f as *const F);
558 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
559 }
560 unsafe {
561 let f: Box_<F> = Box_::new(f);
562 connect_raw(
563 self.as_ptr() as *mut _,
564 b"notify::mode\0".as_ptr() as *const _,
565 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
566 notify_mode_trampoline::<Self, F> as *const (),
567 )),
568 Box_::into_raw(f),
569 )
570 }
571 }
572
573 #[doc(alias = "timeline")]
574 fn connect_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
575 unsafe extern "C" fn notify_timeline_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
576 this: *mut ffi::GESPipeline,
577 _param_spec: glib::ffi::gpointer,
578 f: glib::ffi::gpointer,
579 ) {
580 let f: &F = &*(f as *const F);
581 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
582 }
583 unsafe {
584 let f: Box_<F> = Box_::new(f);
585 connect_raw(
586 self.as_ptr() as *mut _,
587 b"notify::timeline\0".as_ptr() as *const _,
588 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
589 notify_timeline_trampoline::<Self, F> as *const (),
590 )),
591 Box_::into_raw(f),
592 )
593 }
594 }
595
596 #[doc(alias = "video-filter")]
597 fn connect_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
598 unsafe extern "C" fn notify_video_filter_trampoline<
599 P: IsA<Pipeline>,
600 F: Fn(&P) + 'static,
601 >(
602 this: *mut ffi::GESPipeline,
603 _param_spec: glib::ffi::gpointer,
604 f: glib::ffi::gpointer,
605 ) {
606 let f: &F = &*(f as *const F);
607 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
608 }
609 unsafe {
610 let f: Box_<F> = Box_::new(f);
611 connect_raw(
612 self.as_ptr() as *mut _,
613 b"notify::video-filter\0".as_ptr() as *const _,
614 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
615 notify_video_filter_trampoline::<Self, F> as *const (),
616 )),
617 Box_::into_raw(f),
618 )
619 }
620 }
621
622 #[doc(alias = "video-sink")]
623 fn connect_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
624 unsafe extern "C" fn notify_video_sink_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
625 this: *mut ffi::GESPipeline,
626 _param_spec: glib::ffi::gpointer,
627 f: glib::ffi::gpointer,
628 ) {
629 let f: &F = &*(f as *const F);
630 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
631 }
632 unsafe {
633 let f: Box_<F> = Box_::new(f);
634 connect_raw(
635 self.as_ptr() as *mut _,
636 b"notify::video-sink\0".as_ptr() as *const _,
637 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
638 notify_video_sink_trampoline::<Self, F> as *const (),
639 )),
640 Box_::into_raw(f),
641 )
642 }
643 }
644}
645
646impl<O: IsA<Pipeline>> GESPipelineExt for O {}