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::{PipelineFlags, Timeline, ffi};
7use glib::{
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
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 | Writable
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 | Writable
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 | Writable
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 | Writable
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 | Writable
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 | Writable
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 | Writable
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 | Writable
94 ///
95 ///
96 /// #### `latency`
97 /// Latency to configure on the pipeline. See [`PipelineExtManual::set_latency()`][crate::gst::prelude::PipelineExtManual::set_latency()].
98 ///
99 /// Readable | Writable
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 | Writable
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 | Writable
122 /// </details>
123 /// <details><summary><h4>Object</h4></summary>
124 ///
125 ///
126 /// #### `name`
127 /// Readable | Writable | 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 | Writable
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
172/// Trait containing all [`struct@Pipeline`] methods.
173///
174/// # Implementors
175///
176/// [`Pipeline`][struct@crate::Pipeline]
177pub trait GESPipelineExt: IsA<Pipeline> + 'static {
178 /// Gets the [`mode`][struct@crate::Pipeline#mode] of the pipeline.
179 ///
180 /// # Returns
181 ///
182 /// The current mode of `self`.
183 #[doc(alias = "ges_pipeline_get_mode")]
184 #[doc(alias = "get_mode")]
185 fn mode(&self) -> PipelineFlags {
186 unsafe { from_glib(ffi::ges_pipeline_get_mode(self.as_ref().to_glib_none().0)) }
187 }
188
189 /// Gets a sample from the pipeline of the currently displayed image in
190 /// preview, in the specified format.
191 ///
192 /// Note that if you use "ANY" caps for `caps`, then the current format of
193 /// the image is used. You can retrieve these caps from the returned sample
194 /// with `gst_sample_get_caps()`.
195 /// ## `caps`
196 /// Some caps to specifying the desired format, or
197 /// `GST_CAPS_ANY` to use the native format
198 ///
199 /// # Returns
200 ///
201 /// A sample of `self`'s current image preview in
202 /// the format given by `caps`, or [`None`] if an error prevented fetching the
203 /// sample.
204 #[doc(alias = "ges_pipeline_get_thumbnail")]
205 #[doc(alias = "get_thumbnail")]
206 fn thumbnail(&self, caps: &gst::Caps) -> Option<gst::Sample> {
207 unsafe {
208 from_glib_full(ffi::ges_pipeline_get_thumbnail(
209 self.as_ref().to_glib_none().0,
210 caps.to_glib_none().0,
211 ))
212 }
213 }
214
215 /// Gets a sample from the pipeline of the currently displayed image in
216 /// preview, in the 24-bit "RGB" format and of the desired width and
217 /// height.
218 ///
219 /// See [`thumbnail()`][Self::thumbnail()].
220 /// ## `width`
221 /// The requested pixel width of the image, or -1 to use the native
222 /// size
223 /// ## `height`
224 /// The requested pixel height of the image, or -1 to use the
225 /// native size
226 ///
227 /// # Returns
228 ///
229 /// A sample of `self`'s current image preview in
230 /// the "RGB" format, scaled to `width` and `height`, or [`None`] if an error
231 /// prevented fetching the sample.
232 #[doc(alias = "ges_pipeline_get_thumbnail_rgb24")]
233 #[doc(alias = "get_thumbnail_rgb24")]
234 fn thumbnail_rgb24(&self, width: i32, height: i32) -> Option<gst::Sample> {
235 unsafe {
236 from_glib_full(ffi::ges_pipeline_get_thumbnail_rgb24(
237 self.as_ref().to_glib_none().0,
238 width,
239 height,
240 ))
241 }
242 }
243
244 /// Gets the [`audio-sink`][struct@crate::Pipeline#audio-sink] of the pipeline.
245 ///
246 /// # Returns
247 ///
248 /// The audio sink used by `self` for preview.
249 #[doc(alias = "ges_pipeline_preview_get_audio_sink")]
250 fn preview_get_audio_sink(&self) -> Option<gst::Element> {
251 unsafe {
252 from_glib_full(ffi::ges_pipeline_preview_get_audio_sink(
253 self.as_ref().to_glib_none().0,
254 ))
255 }
256 }
257
258 /// Gets the [`video-sink`][struct@crate::Pipeline#video-sink] of the pipeline.
259 ///
260 /// # Returns
261 ///
262 /// The video sink used by `self` for preview.
263 #[doc(alias = "ges_pipeline_preview_get_video_sink")]
264 fn preview_get_video_sink(&self) -> Option<gst::Element> {
265 unsafe {
266 from_glib_full(ffi::ges_pipeline_preview_get_video_sink(
267 self.as_ref().to_glib_none().0,
268 ))
269 }
270 }
271
272 /// Sets the [`audio-sink`][struct@crate::Pipeline#audio-sink] of the pipeline.
273 /// ## `sink`
274 /// A audio sink for `self` to use for preview
275 #[doc(alias = "ges_pipeline_preview_set_audio_sink")]
276 fn preview_set_audio_sink(&self, sink: Option<&impl IsA<gst::Element>>) {
277 unsafe {
278 ffi::ges_pipeline_preview_set_audio_sink(
279 self.as_ref().to_glib_none().0,
280 sink.map(|p| p.as_ref()).to_glib_none().0,
281 );
282 }
283 }
284
285 /// Sets the [`video-sink`][struct@crate::Pipeline#video-sink] of the pipeline.
286 /// ## `sink`
287 /// A video sink for `self` to use for preview
288 #[doc(alias = "ges_pipeline_preview_set_video_sink")]
289 fn preview_set_video_sink(&self, sink: Option<&impl IsA<gst::Element>>) {
290 unsafe {
291 ffi::ges_pipeline_preview_set_video_sink(
292 self.as_ref().to_glib_none().0,
293 sink.map(|p| p.as_ref()).to_glib_none().0,
294 );
295 }
296 }
297
298 /// Saves the currently displayed image of the pipeline in preview to the
299 /// given location, in the specified dimensions and format.
300 /// ## `width`
301 /// The requested pixel width of the image, or -1 to use the native
302 /// size
303 /// ## `height`
304 /// The requested pixel height of the image, or -1 to use the
305 /// native size
306 /// ## `format`
307 /// The desired mime type (for example, "image/jpeg")
308 /// ## `location`
309 /// The path to save the thumbnail to
310 ///
311 /// # Returns
312 ///
313 /// [`true`] if `self`'s current image preview was successfully saved
314 /// to `location` using the given `format`, `height` and `width`.
315 #[doc(alias = "ges_pipeline_save_thumbnail")]
316 fn save_thumbnail(
317 &self,
318 width: i32,
319 height: i32,
320 format: &str,
321 location: &str,
322 ) -> Result<(), glib::Error> {
323 unsafe {
324 let mut error = std::ptr::null_mut();
325 let is_ok = ffi::ges_pipeline_save_thumbnail(
326 self.as_ref().to_glib_none().0,
327 width,
328 height,
329 format.to_glib_none().0,
330 location.to_glib_none().0,
331 &mut error,
332 );
333 debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
334 if error.is_null() {
335 Ok(())
336 } else {
337 Err(from_glib_full(error))
338 }
339 }
340 }
341
342 /// otherwise.
343 /// ## `mode`
344 /// The mode to set for `self`
345 ///
346 /// # Returns
347 ///
348 /// [`true`] if the mode of `self` was successfully set to `mode`.
349 #[doc(alias = "ges_pipeline_set_mode")]
350 #[doc(alias = "mode")]
351 fn set_mode(&self, mode: PipelineFlags) -> Result<(), glib::error::BoolError> {
352 unsafe {
353 glib::result_from_gboolean!(
354 ffi::ges_pipeline_set_mode(self.as_ref().to_glib_none().0, mode.into_glib()),
355 "Failed to set mode"
356 )
357 }
358 }
359
360 /// Specifies encoding setting to be used by the pipeline to render its
361 /// [`timeline`][struct@crate::Pipeline#timeline], and where the result should be written to.
362 ///
363 /// This method **must** be called before setting the pipeline mode to
364 /// [`PipelineFlags::RENDER`][crate::PipelineFlags::RENDER].
365 /// ## `output_uri`
366 /// The URI to save the [`timeline`][struct@crate::Pipeline#timeline] rendering
367 /// result to
368 /// ## `profile`
369 /// The encoding to use for rendering the [`timeline`][struct@crate::Pipeline#timeline]
370 ///
371 /// # Returns
372 ///
373 /// [`true`] if the settings were successfully set on `self`.
374 #[doc(alias = "ges_pipeline_set_render_settings")]
375 fn set_render_settings(
376 &self,
377 output_uri: &str,
378 profile: &impl IsA<gst_pbutils::EncodingProfile>,
379 ) -> Result<(), glib::error::BoolError> {
380 unsafe {
381 glib::result_from_gboolean!(
382 ffi::ges_pipeline_set_render_settings(
383 self.as_ref().to_glib_none().0,
384 output_uri.to_glib_none().0,
385 profile.as_ref().to_glib_none().0
386 ),
387 "Failed to set render settings"
388 )
389 }
390 }
391
392 /// Takes the given timeline and sets it as the [`timeline`][struct@crate::Pipeline#timeline] for
393 /// the pipeline.
394 ///
395 /// Note that you should only call this method once on a given pipeline
396 /// because a pipeline can not have its [`timeline`][struct@crate::Pipeline#timeline] changed after
397 /// it has been set.
398 /// ## `timeline`
399 /// The timeline to set for `self`
400 ///
401 /// # Returns
402 ///
403 /// [`true`] if `timeline` was successfully given to `self`.
404 #[doc(alias = "ges_pipeline_set_timeline")]
405 #[doc(alias = "timeline")]
406 fn set_timeline(&self, timeline: &impl IsA<Timeline>) -> Result<(), glib::error::BoolError> {
407 unsafe {
408 glib::result_from_gboolean!(
409 ffi::ges_pipeline_set_timeline(
410 self.as_ref().to_glib_none().0,
411 timeline.as_ref().to_glib_none().0
412 ),
413 "Failed to set timeline"
414 )
415 }
416 }
417
418 /// The audio filter(s) to apply during playback in preview mode,
419 /// immediately before the [`audio-sink`][struct@crate::Pipeline#audio-sink]. This exposes the
420 /// `playsink:audio-filter` property of the internal `playsink`.
421 #[doc(alias = "audio-filter")]
422 fn audio_filter(&self) -> Option<gst::Element> {
423 ObjectExt::property(self.as_ref(), "audio-filter")
424 }
425
426 /// The audio filter(s) to apply during playback in preview mode,
427 /// immediately before the [`audio-sink`][struct@crate::Pipeline#audio-sink]. This exposes the
428 /// `playsink:audio-filter` property of the internal `playsink`.
429 #[doc(alias = "audio-filter")]
430 fn set_audio_filter<P: IsA<gst::Element>>(&self, audio_filter: Option<&P>) {
431 ObjectExt::set_property(self.as_ref(), "audio-filter", audio_filter)
432 }
433
434 /// The audio sink used for preview. This exposes the
435 /// `playsink:audio-sink` property of the internal `playsink`.
436 #[doc(alias = "audio-sink")]
437 fn audio_sink(&self) -> Option<gst::Element> {
438 ObjectExt::property(self.as_ref(), "audio-sink")
439 }
440
441 /// The audio sink used for preview. This exposes the
442 /// `playsink:audio-sink` property of the internal `playsink`.
443 #[doc(alias = "audio-sink")]
444 fn set_audio_sink<P: IsA<gst::Element>>(&self, audio_sink: Option<&P>) {
445 ObjectExt::set_property(self.as_ref(), "audio-sink", audio_sink)
446 }
447
448 /// The timeline used by this pipeline, whose content it will play and
449 /// render, or [`None`] if the pipeline does not yet have a timeline.
450 ///
451 /// Note that after you set the timeline for the first time, subsequent
452 /// calls to change the timeline will fail.
453 fn timeline(&self) -> Option<Timeline> {
454 ObjectExt::property(self.as_ref(), "timeline")
455 }
456
457 /// The video filter(s) to apply during playback in preview mode,
458 /// immediately before the [`video-sink`][struct@crate::Pipeline#video-sink]. This exposes the
459 /// `playsink:video-filter` property of the internal `playsink`.
460 #[doc(alias = "video-filter")]
461 fn video_filter(&self) -> Option<gst::Element> {
462 ObjectExt::property(self.as_ref(), "video-filter")
463 }
464
465 /// The video filter(s) to apply during playback in preview mode,
466 /// immediately before the [`video-sink`][struct@crate::Pipeline#video-sink]. This exposes the
467 /// `playsink:video-filter` property of the internal `playsink`.
468 #[doc(alias = "video-filter")]
469 fn set_video_filter<P: IsA<gst::Element>>(&self, video_filter: Option<&P>) {
470 ObjectExt::set_property(self.as_ref(), "video-filter", video_filter)
471 }
472
473 /// The video sink used for preview. This exposes the
474 /// `playsink:video-sink` property of the internal `playsink`.
475 #[doc(alias = "video-sink")]
476 fn video_sink(&self) -> Option<gst::Element> {
477 ObjectExt::property(self.as_ref(), "video-sink")
478 }
479
480 /// The video sink used for preview. This exposes the
481 /// `playsink:video-sink` property of the internal `playsink`.
482 #[doc(alias = "video-sink")]
483 fn set_video_sink<P: IsA<gst::Element>>(&self, video_sink: Option<&P>) {
484 ObjectExt::set_property(self.as_ref(), "video-sink", video_sink)
485 }
486
487 #[doc(alias = "audio-filter")]
488 fn connect_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
489 unsafe extern "C" fn notify_audio_filter_trampoline<
490 P: IsA<Pipeline>,
491 F: Fn(&P) + 'static,
492 >(
493 this: *mut ffi::GESPipeline,
494 _param_spec: glib::ffi::gpointer,
495 f: glib::ffi::gpointer,
496 ) {
497 unsafe {
498 let f: &F = &*(f as *const F);
499 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
500 }
501 }
502 unsafe {
503 let f: Box_<F> = Box_::new(f);
504 connect_raw(
505 self.as_ptr() as *mut _,
506 c"notify::audio-filter".as_ptr(),
507 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
508 notify_audio_filter_trampoline::<Self, F> as *const (),
509 )),
510 Box_::into_raw(f),
511 )
512 }
513 }
514
515 #[doc(alias = "audio-sink")]
516 fn connect_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
517 unsafe extern "C" fn notify_audio_sink_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
518 this: *mut ffi::GESPipeline,
519 _param_spec: glib::ffi::gpointer,
520 f: glib::ffi::gpointer,
521 ) {
522 unsafe {
523 let f: &F = &*(f as *const F);
524 f(Pipeline::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::audio-sink".as_ptr(),
532 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
533 notify_audio_sink_trampoline::<Self, F> as *const (),
534 )),
535 Box_::into_raw(f),
536 )
537 }
538 }
539
540 #[doc(alias = "mode")]
541 fn connect_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
542 unsafe extern "C" fn notify_mode_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
543 this: *mut ffi::GESPipeline,
544 _param_spec: glib::ffi::gpointer,
545 f: glib::ffi::gpointer,
546 ) {
547 unsafe {
548 let f: &F = &*(f as *const F);
549 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
550 }
551 }
552 unsafe {
553 let f: Box_<F> = Box_::new(f);
554 connect_raw(
555 self.as_ptr() as *mut _,
556 c"notify::mode".as_ptr(),
557 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
558 notify_mode_trampoline::<Self, F> as *const (),
559 )),
560 Box_::into_raw(f),
561 )
562 }
563 }
564
565 #[doc(alias = "timeline")]
566 fn connect_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
567 unsafe extern "C" fn notify_timeline_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
568 this: *mut ffi::GESPipeline,
569 _param_spec: glib::ffi::gpointer,
570 f: glib::ffi::gpointer,
571 ) {
572 unsafe {
573 let f: &F = &*(f as *const F);
574 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
575 }
576 }
577 unsafe {
578 let f: Box_<F> = Box_::new(f);
579 connect_raw(
580 self.as_ptr() as *mut _,
581 c"notify::timeline".as_ptr(),
582 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
583 notify_timeline_trampoline::<Self, F> as *const (),
584 )),
585 Box_::into_raw(f),
586 )
587 }
588 }
589
590 #[doc(alias = "video-filter")]
591 fn connect_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
592 unsafe extern "C" fn notify_video_filter_trampoline<
593 P: IsA<Pipeline>,
594 F: Fn(&P) + 'static,
595 >(
596 this: *mut ffi::GESPipeline,
597 _param_spec: glib::ffi::gpointer,
598 f: glib::ffi::gpointer,
599 ) {
600 unsafe {
601 let f: &F = &*(f as *const F);
602 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
603 }
604 }
605 unsafe {
606 let f: Box_<F> = Box_::new(f);
607 connect_raw(
608 self.as_ptr() as *mut _,
609 c"notify::video-filter".as_ptr(),
610 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
611 notify_video_filter_trampoline::<Self, F> as *const (),
612 )),
613 Box_::into_raw(f),
614 )
615 }
616 }
617
618 #[doc(alias = "video-sink")]
619 fn connect_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
620 unsafe extern "C" fn notify_video_sink_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
621 this: *mut ffi::GESPipeline,
622 _param_spec: glib::ffi::gpointer,
623 f: glib::ffi::gpointer,
624 ) {
625 unsafe {
626 let f: &F = &*(f as *const F);
627 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
628 }
629 }
630 unsafe {
631 let f: Box_<F> = Box_::new(f);
632 connect_raw(
633 self.as_ptr() as *mut _,
634 c"notify::video-sink".as_ptr(),
635 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
636 notify_video_sink_trampoline::<Self, F> as *const (),
637 )),
638 Box_::into_raw(f),
639 )
640 }
641 }
642}
643
644impl<O: IsA<Pipeline>> GESPipelineExt for O {}