gstreamer_video/auto/
video_aggregator_pad.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::{connect_raw, SignalHandlerId},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    #[doc(alias = "GstVideoAggregatorPad")]
16    pub struct VideoAggregatorPad(Object<ffi::GstVideoAggregatorPad, ffi::GstVideoAggregatorPadClass>) @extends gst_base::AggregatorPad, gst::Pad, gst::Object;
17
18    match fn {
19        type_ => || ffi::gst_video_aggregator_pad_get_type(),
20    }
21}
22
23impl VideoAggregatorPad {
24    pub const NONE: Option<&'static VideoAggregatorPad> = None;
25}
26
27unsafe impl Send for VideoAggregatorPad {}
28unsafe impl Sync for VideoAggregatorPad {}
29
30mod sealed {
31    pub trait Sealed {}
32    impl<T: super::IsA<super::VideoAggregatorPad>> Sealed for T {}
33}
34
35pub trait VideoAggregatorPadExt: IsA<VideoAggregatorPad> + sealed::Sealed + 'static {
36    #[doc(alias = "gst_video_aggregator_pad_set_needs_alpha")]
37    fn set_needs_alpha(&self, needs_alpha: bool) {
38        unsafe {
39            ffi::gst_video_aggregator_pad_set_needs_alpha(
40                self.as_ref().to_glib_none().0,
41                needs_alpha.into_glib(),
42            );
43        }
44    }
45
46    #[doc(alias = "max-last-buffer-repeat")]
47    fn max_last_buffer_repeat(&self) -> u64 {
48        ObjectExt::property(self.as_ref(), "max-last-buffer-repeat")
49    }
50
51    #[doc(alias = "max-last-buffer-repeat")]
52    fn set_max_last_buffer_repeat(&self, max_last_buffer_repeat: u64) {
53        ObjectExt::set_property(
54            self.as_ref(),
55            "max-last-buffer-repeat",
56            max_last_buffer_repeat,
57        )
58    }
59
60    #[doc(alias = "repeat-after-eos")]
61    fn is_repeat_after_eos(&self) -> bool {
62        ObjectExt::property(self.as_ref(), "repeat-after-eos")
63    }
64
65    #[doc(alias = "repeat-after-eos")]
66    fn set_repeat_after_eos(&self, repeat_after_eos: bool) {
67        ObjectExt::set_property(self.as_ref(), "repeat-after-eos", repeat_after_eos)
68    }
69
70    fn zorder(&self) -> u32 {
71        ObjectExt::property(self.as_ref(), "zorder")
72    }
73
74    fn set_zorder(&self, zorder: u32) {
75        ObjectExt::set_property(self.as_ref(), "zorder", zorder)
76    }
77
78    #[doc(alias = "max-last-buffer-repeat")]
79    fn connect_max_last_buffer_repeat_notify<F: Fn(&Self) + Send + Sync + 'static>(
80        &self,
81        f: F,
82    ) -> SignalHandlerId {
83        unsafe extern "C" fn notify_max_last_buffer_repeat_trampoline<
84            P: IsA<VideoAggregatorPad>,
85            F: Fn(&P) + Send + Sync + 'static,
86        >(
87            this: *mut ffi::GstVideoAggregatorPad,
88            _param_spec: glib::ffi::gpointer,
89            f: glib::ffi::gpointer,
90        ) {
91            let f: &F = &*(f as *const F);
92            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
93        }
94        unsafe {
95            let f: Box_<F> = Box_::new(f);
96            connect_raw(
97                self.as_ptr() as *mut _,
98                b"notify::max-last-buffer-repeat\0".as_ptr() as *const _,
99                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
100                    notify_max_last_buffer_repeat_trampoline::<Self, F> as *const (),
101                )),
102                Box_::into_raw(f),
103            )
104        }
105    }
106
107    #[doc(alias = "repeat-after-eos")]
108    fn connect_repeat_after_eos_notify<F: Fn(&Self) + Send + Sync + 'static>(
109        &self,
110        f: F,
111    ) -> SignalHandlerId {
112        unsafe extern "C" fn notify_repeat_after_eos_trampoline<
113            P: IsA<VideoAggregatorPad>,
114            F: Fn(&P) + Send + Sync + 'static,
115        >(
116            this: *mut ffi::GstVideoAggregatorPad,
117            _param_spec: glib::ffi::gpointer,
118            f: glib::ffi::gpointer,
119        ) {
120            let f: &F = &*(f as *const F);
121            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
122        }
123        unsafe {
124            let f: Box_<F> = Box_::new(f);
125            connect_raw(
126                self.as_ptr() as *mut _,
127                b"notify::repeat-after-eos\0".as_ptr() as *const _,
128                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
129                    notify_repeat_after_eos_trampoline::<Self, F> as *const (),
130                )),
131                Box_::into_raw(f),
132            )
133        }
134    }
135
136    #[doc(alias = "zorder")]
137    fn connect_zorder_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
138        unsafe extern "C" fn notify_zorder_trampoline<
139            P: IsA<VideoAggregatorPad>,
140            F: Fn(&P) + Send + Sync + 'static,
141        >(
142            this: *mut ffi::GstVideoAggregatorPad,
143            _param_spec: glib::ffi::gpointer,
144            f: glib::ffi::gpointer,
145        ) {
146            let f: &F = &*(f as *const F);
147            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
148        }
149        unsafe {
150            let f: Box_<F> = Box_::new(f);
151            connect_raw(
152                self.as_ptr() as *mut _,
153                b"notify::zorder\0".as_ptr() as *const _,
154                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
155                    notify_zorder_trampoline::<Self, F> as *const (),
156                )),
157                Box_::into_raw(f),
158            )
159        }
160    }
161}
162
163impl<O: IsA<VideoAggregatorPad>> VideoAggregatorPadExt for O {}