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#![allow(deprecated)]
6
7use glib::{
8 prelude::*,
9 signal::{connect_raw, SignalHandlerId},
10 translate::*,
11};
12use std::{boxed::Box as Box_, mem::transmute};
13
14glib::wrapper! {
15 #[doc(alias = "GstVideoSink")]
16 pub struct VideoSink(Object<ffi::GstVideoSink, ffi::GstVideoSinkClass>) @extends gst_base::BaseSink, gst::Element, gst::Object;
17
18 match fn {
19 type_ => || ffi::gst_video_sink_get_type(),
20 }
21}
22
23impl VideoSink {
24 pub const NONE: Option<&'static VideoSink> = None;
25}
26
27unsafe impl Send for VideoSink {}
28unsafe impl Sync for VideoSink {}
29
30mod sealed {
31 pub trait Sealed {}
32 impl<T: super::IsA<super::VideoSink>> Sealed for T {}
33}
34
35pub trait VideoSinkExt: IsA<VideoSink> + sealed::Sealed + 'static {
36 #[doc(alias = "show-preroll-frame")]
37 fn shows_preroll_frame(&self) -> bool {
38 ObjectExt::property(self.as_ref(), "show-preroll-frame")
39 }
40
41 #[doc(alias = "show-preroll-frame")]
42 fn set_show_preroll_frame(&self, show_preroll_frame: bool) {
43 ObjectExt::set_property(self.as_ref(), "show-preroll-frame", show_preroll_frame)
44 }
45
46 #[doc(alias = "show-preroll-frame")]
47 fn connect_show_preroll_frame_notify<F: Fn(&Self) + Send + Sync + 'static>(
48 &self,
49 f: F,
50 ) -> SignalHandlerId {
51 unsafe extern "C" fn notify_show_preroll_frame_trampoline<
52 P: IsA<VideoSink>,
53 F: Fn(&P) + Send + Sync + 'static,
54 >(
55 this: *mut ffi::GstVideoSink,
56 _param_spec: glib::ffi::gpointer,
57 f: glib::ffi::gpointer,
58 ) {
59 let f: &F = &*(f as *const F);
60 f(VideoSink::from_glib_borrow(this).unsafe_cast_ref())
61 }
62 unsafe {
63 let f: Box_<F> = Box_::new(f);
64 connect_raw(
65 self.as_ptr() as *mut _,
66 b"notify::show-preroll-frame\0".as_ptr() as *const _,
67 Some(transmute::<_, unsafe extern "C" fn()>(
68 notify_show_preroll_frame_trampoline::<Self, F> as *const (),
69 )),
70 Box_::into_raw(f),
71 )
72 }
73 }
74}
75
76impl<O: IsA<VideoSink>> VideoSinkExt for O {}
77