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
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 /// Sets the [`mode`][struct@crate::Pipeline#mode] of the pipeline.
343 ///
344 /// Note that the pipeline will be set to [`gst::State::Null`][crate::gst::State::Null] during this call to
345 /// perform the necessary changes. You will need to set the state again yourself
346 /// after calling this.
347 ///
348 /// > **NOTE**: [Rendering settings](ges_pipeline_set_render_settings) need to be
349 /// > set before setting `mode` to [`PipelineFlags::RENDER`][crate::PipelineFlags::RENDER] or
350 /// > [`PipelineFlags::SMART_RENDER`][crate::PipelineFlags::SMART_RENDER], the call to this method will fail
351 /// > otherwise.
352 /// ## `mode`
353 /// The mode to set for `self`
354 ///
355 /// # Returns
356 ///
357 /// [`true`] if the mode of `self` was successfully set to `mode`.
358 #[doc(alias = "ges_pipeline_set_mode")]
359 #[doc(alias = "mode")]
360 fn set_mode(&self, mode: PipelineFlags) -> Result<(), glib::error::BoolError> {
361 unsafe {
362 glib::result_from_gboolean!(
363 ffi::ges_pipeline_set_mode(self.as_ref().to_glib_none().0, mode.into_glib()),
364 "Failed to set mode"
365 )
366 }
367 }
368
369 /// Specifies encoding setting to be used by the pipeline to render its
370 /// [`timeline`][struct@crate::Pipeline#timeline], and where the result should be written to.
371 ///
372 /// This method **must** be called before setting the pipeline mode to
373 /// [`PipelineFlags::RENDER`][crate::PipelineFlags::RENDER].
374 /// ## `output_uri`
375 /// The URI to save the [`timeline`][struct@crate::Pipeline#timeline] rendering
376 /// result to
377 /// ## `profile`
378 /// The encoding to use for rendering the [`timeline`][struct@crate::Pipeline#timeline]
379 ///
380 /// # Returns
381 ///
382 /// [`true`] if the settings were successfully set on `self`.
383 #[doc(alias = "ges_pipeline_set_render_settings")]
384 fn set_render_settings(
385 &self,
386 output_uri: &str,
387 profile: &impl IsA<gst_pbutils::EncodingProfile>,
388 ) -> Result<(), glib::error::BoolError> {
389 unsafe {
390 glib::result_from_gboolean!(
391 ffi::ges_pipeline_set_render_settings(
392 self.as_ref().to_glib_none().0,
393 output_uri.to_glib_none().0,
394 profile.as_ref().to_glib_none().0
395 ),
396 "Failed to set render settings"
397 )
398 }
399 }
400
401 /// Takes the given timeline and sets it as the [`timeline`][struct@crate::Pipeline#timeline] for
402 /// the pipeline.
403 ///
404 /// Note that you should only call this method once on a given pipeline
405 /// because a pipeline can not have its [`timeline`][struct@crate::Pipeline#timeline] changed after
406 /// it has been set.
407 /// ## `timeline`
408 /// The timeline to set for `self`
409 ///
410 /// # Returns
411 ///
412 /// [`true`] if `timeline` was successfully given to `self`.
413 #[doc(alias = "ges_pipeline_set_timeline")]
414 #[doc(alias = "timeline")]
415 fn set_timeline(&self, timeline: &impl IsA<Timeline>) -> Result<(), glib::error::BoolError> {
416 unsafe {
417 glib::result_from_gboolean!(
418 ffi::ges_pipeline_set_timeline(
419 self.as_ref().to_glib_none().0,
420 timeline.as_ref().to_glib_none().0
421 ),
422 "Failed to set timeline"
423 )
424 }
425 }
426
427 /// The audio filter(s) to apply during playback in preview mode,
428 /// immediately before the [`audio-sink`][struct@crate::Pipeline#audio-sink]. This exposes the
429 /// `playsink:audio-filter` property of the internal `playsink`.
430 #[doc(alias = "audio-filter")]
431 fn audio_filter(&self) -> Option<gst::Element> {
432 ObjectExt::property(self.as_ref(), "audio-filter")
433 }
434
435 /// The audio filter(s) to apply during playback in preview mode,
436 /// immediately before the [`audio-sink`][struct@crate::Pipeline#audio-sink]. This exposes the
437 /// `playsink:audio-filter` property of the internal `playsink`.
438 #[doc(alias = "audio-filter")]
439 fn set_audio_filter<P: IsA<gst::Element>>(&self, audio_filter: Option<&P>) {
440 ObjectExt::set_property(self.as_ref(), "audio-filter", audio_filter)
441 }
442
443 /// The audio sink used for preview. This exposes the
444 /// `playsink:audio-sink` property of the internal `playsink`.
445 #[doc(alias = "audio-sink")]
446 fn audio_sink(&self) -> Option<gst::Element> {
447 ObjectExt::property(self.as_ref(), "audio-sink")
448 }
449
450 /// The audio sink used for preview. This exposes the
451 /// `playsink:audio-sink` property of the internal `playsink`.
452 #[doc(alias = "audio-sink")]
453 fn set_audio_sink<P: IsA<gst::Element>>(&self, audio_sink: Option<&P>) {
454 ObjectExt::set_property(self.as_ref(), "audio-sink", audio_sink)
455 }
456
457 /// The timeline used by this pipeline, whose content it will play and
458 /// render, or [`None`] if the pipeline does not yet have a timeline.
459 ///
460 /// Note that after you set the timeline for the first time, subsequent
461 /// calls to change the timeline will fail.
462 fn timeline(&self) -> Option<Timeline> {
463 ObjectExt::property(self.as_ref(), "timeline")
464 }
465
466 /// The video filter(s) to apply during playback in preview mode,
467 /// immediately before the [`video-sink`][struct@crate::Pipeline#video-sink]. This exposes the
468 /// `playsink:video-filter` property of the internal `playsink`.
469 #[doc(alias = "video-filter")]
470 fn video_filter(&self) -> Option<gst::Element> {
471 ObjectExt::property(self.as_ref(), "video-filter")
472 }
473
474 /// The video filter(s) to apply during playback in preview mode,
475 /// immediately before the [`video-sink`][struct@crate::Pipeline#video-sink]. This exposes the
476 /// `playsink:video-filter` property of the internal `playsink`.
477 #[doc(alias = "video-filter")]
478 fn set_video_filter<P: IsA<gst::Element>>(&self, video_filter: Option<&P>) {
479 ObjectExt::set_property(self.as_ref(), "video-filter", video_filter)
480 }
481
482 /// The video sink used for preview. This exposes the
483 /// `playsink:video-sink` property of the internal `playsink`.
484 #[doc(alias = "video-sink")]
485 fn video_sink(&self) -> Option<gst::Element> {
486 ObjectExt::property(self.as_ref(), "video-sink")
487 }
488
489 /// The video sink used for preview. This exposes the
490 /// `playsink:video-sink` property of the internal `playsink`.
491 #[doc(alias = "video-sink")]
492 fn set_video_sink<P: IsA<gst::Element>>(&self, video_sink: Option<&P>) {
493 ObjectExt::set_property(self.as_ref(), "video-sink", video_sink)
494 }
495
496 #[doc(alias = "audio-filter")]
497 fn connect_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
498 unsafe extern "C" fn notify_audio_filter_trampoline<
499 P: IsA<Pipeline>,
500 F: Fn(&P) + 'static,
501 >(
502 this: *mut ffi::GESPipeline,
503 _param_spec: glib::ffi::gpointer,
504 f: glib::ffi::gpointer,
505 ) {
506 let f: &F = &*(f as *const F);
507 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
508 }
509 unsafe {
510 let f: Box_<F> = Box_::new(f);
511 connect_raw(
512 self.as_ptr() as *mut _,
513 c"notify::audio-filter".as_ptr() as *const _,
514 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
515 notify_audio_filter_trampoline::<Self, F> as *const (),
516 )),
517 Box_::into_raw(f),
518 )
519 }
520 }
521
522 #[doc(alias = "audio-sink")]
523 fn connect_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
524 unsafe extern "C" fn notify_audio_sink_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
525 this: *mut ffi::GESPipeline,
526 _param_spec: glib::ffi::gpointer,
527 f: glib::ffi::gpointer,
528 ) {
529 let f: &F = &*(f as *const F);
530 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
531 }
532 unsafe {
533 let f: Box_<F> = Box_::new(f);
534 connect_raw(
535 self.as_ptr() as *mut _,
536 c"notify::audio-sink".as_ptr() as *const _,
537 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
538 notify_audio_sink_trampoline::<Self, F> as *const (),
539 )),
540 Box_::into_raw(f),
541 )
542 }
543 }
544
545 #[doc(alias = "mode")]
546 fn connect_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
547 unsafe extern "C" fn notify_mode_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
548 this: *mut ffi::GESPipeline,
549 _param_spec: glib::ffi::gpointer,
550 f: glib::ffi::gpointer,
551 ) {
552 let f: &F = &*(f as *const F);
553 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
554 }
555 unsafe {
556 let f: Box_<F> = Box_::new(f);
557 connect_raw(
558 self.as_ptr() as *mut _,
559 c"notify::mode".as_ptr() as *const _,
560 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
561 notify_mode_trampoline::<Self, F> as *const (),
562 )),
563 Box_::into_raw(f),
564 )
565 }
566 }
567
568 #[doc(alias = "timeline")]
569 fn connect_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
570 unsafe extern "C" fn notify_timeline_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
571 this: *mut ffi::GESPipeline,
572 _param_spec: glib::ffi::gpointer,
573 f: glib::ffi::gpointer,
574 ) {
575 let f: &F = &*(f as *const F);
576 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
577 }
578 unsafe {
579 let f: Box_<F> = Box_::new(f);
580 connect_raw(
581 self.as_ptr() as *mut _,
582 c"notify::timeline".as_ptr() as *const _,
583 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
584 notify_timeline_trampoline::<Self, F> as *const (),
585 )),
586 Box_::into_raw(f),
587 )
588 }
589 }
590
591 #[doc(alias = "video-filter")]
592 fn connect_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
593 unsafe extern "C" fn notify_video_filter_trampoline<
594 P: IsA<Pipeline>,
595 F: Fn(&P) + 'static,
596 >(
597 this: *mut ffi::GESPipeline,
598 _param_spec: glib::ffi::gpointer,
599 f: glib::ffi::gpointer,
600 ) {
601 let f: &F = &*(f as *const F);
602 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
603 }
604 unsafe {
605 let f: Box_<F> = Box_::new(f);
606 connect_raw(
607 self.as_ptr() as *mut _,
608 c"notify::video-filter".as_ptr() as *const _,
609 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
610 notify_video_filter_trampoline::<Self, F> as *const (),
611 )),
612 Box_::into_raw(f),
613 )
614 }
615 }
616
617 #[doc(alias = "video-sink")]
618 fn connect_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
619 unsafe extern "C" fn notify_video_sink_trampoline<P: IsA<Pipeline>, F: Fn(&P) + 'static>(
620 this: *mut ffi::GESPipeline,
621 _param_spec: glib::ffi::gpointer,
622 f: glib::ffi::gpointer,
623 ) {
624 let f: &F = &*(f as *const F);
625 f(Pipeline::from_glib_borrow(this).unsafe_cast_ref())
626 }
627 unsafe {
628 let f: Box_<F> = Box_::new(f);
629 connect_raw(
630 self.as_ptr() as *mut _,
631 c"notify::video-sink".as_ptr() as *const _,
632 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
633 notify_video_sink_trampoline::<Self, F> as *const (),
634 )),
635 Box_::into_raw(f),
636 )
637 }
638 }
639}
640
641impl<O: IsA<Pipeline>> GESPipelineExt for O {}