gstreamer_video/auto/
video_aggregator_pad.rs1use 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")]
97    pub struct VideoAggregatorPad(Object<ffi::GstVideoAggregatorPad, ffi::GstVideoAggregatorPadClass>) @extends gst_base::AggregatorPad, gst::Pad, gst::Object;
98
99    match fn {
100        type_ => || ffi::gst_video_aggregator_pad_get_type(),
101    }
102}
103
104impl VideoAggregatorPad {
105    pub const NONE: Option<&'static VideoAggregatorPad> = None;
106}
107
108unsafe impl Send for VideoAggregatorPad {}
109unsafe impl Sync for VideoAggregatorPad {}
110
111pub trait VideoAggregatorPadExt: IsA<VideoAggregatorPad> + 'static {
117    #[doc(alias = "gst_video_aggregator_pad_set_needs_alpha")]
121    fn set_needs_alpha(&self, needs_alpha: bool) {
122        unsafe {
123            ffi::gst_video_aggregator_pad_set_needs_alpha(
124                self.as_ref().to_glib_none().0,
125                needs_alpha.into_glib(),
126            );
127        }
128    }
129
130    #[doc(alias = "max-last-buffer-repeat")]
131    fn max_last_buffer_repeat(&self) -> u64 {
132        ObjectExt::property(self.as_ref(), "max-last-buffer-repeat")
133    }
134
135    #[doc(alias = "max-last-buffer-repeat")]
136    fn set_max_last_buffer_repeat(&self, max_last_buffer_repeat: u64) {
137        ObjectExt::set_property(
138            self.as_ref(),
139            "max-last-buffer-repeat",
140            max_last_buffer_repeat,
141        )
142    }
143
144    #[doc(alias = "repeat-after-eos")]
145    fn is_repeat_after_eos(&self) -> bool {
146        ObjectExt::property(self.as_ref(), "repeat-after-eos")
147    }
148
149    #[doc(alias = "repeat-after-eos")]
150    fn set_repeat_after_eos(&self, repeat_after_eos: bool) {
151        ObjectExt::set_property(self.as_ref(), "repeat-after-eos", repeat_after_eos)
152    }
153
154    fn zorder(&self) -> u32 {
155        ObjectExt::property(self.as_ref(), "zorder")
156    }
157
158    fn set_zorder(&self, zorder: u32) {
159        ObjectExt::set_property(self.as_ref(), "zorder", zorder)
160    }
161
162    #[doc(alias = "max-last-buffer-repeat")]
163    fn connect_max_last_buffer_repeat_notify<F: Fn(&Self) + Send + Sync + 'static>(
164        &self,
165        f: F,
166    ) -> SignalHandlerId {
167        unsafe extern "C" fn notify_max_last_buffer_repeat_trampoline<
168            P: IsA<VideoAggregatorPad>,
169            F: Fn(&P) + Send + Sync + 'static,
170        >(
171            this: *mut ffi::GstVideoAggregatorPad,
172            _param_spec: glib::ffi::gpointer,
173            f: glib::ffi::gpointer,
174        ) {
175            let f: &F = &*(f as *const F);
176            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
177        }
178        unsafe {
179            let f: Box_<F> = Box_::new(f);
180            connect_raw(
181                self.as_ptr() as *mut _,
182                c"notify::max-last-buffer-repeat".as_ptr() as *const _,
183                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
184                    notify_max_last_buffer_repeat_trampoline::<Self, F> as *const (),
185                )),
186                Box_::into_raw(f),
187            )
188        }
189    }
190
191    #[doc(alias = "repeat-after-eos")]
192    fn connect_repeat_after_eos_notify<F: Fn(&Self) + Send + Sync + 'static>(
193        &self,
194        f: F,
195    ) -> SignalHandlerId {
196        unsafe extern "C" fn notify_repeat_after_eos_trampoline<
197            P: IsA<VideoAggregatorPad>,
198            F: Fn(&P) + Send + Sync + 'static,
199        >(
200            this: *mut ffi::GstVideoAggregatorPad,
201            _param_spec: glib::ffi::gpointer,
202            f: glib::ffi::gpointer,
203        ) {
204            let f: &F = &*(f as *const F);
205            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
206        }
207        unsafe {
208            let f: Box_<F> = Box_::new(f);
209            connect_raw(
210                self.as_ptr() as *mut _,
211                c"notify::repeat-after-eos".as_ptr() as *const _,
212                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
213                    notify_repeat_after_eos_trampoline::<Self, F> as *const (),
214                )),
215                Box_::into_raw(f),
216            )
217        }
218    }
219
220    #[doc(alias = "zorder")]
221    fn connect_zorder_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
222        unsafe extern "C" fn notify_zorder_trampoline<
223            P: IsA<VideoAggregatorPad>,
224            F: Fn(&P) + Send + Sync + 'static,
225        >(
226            this: *mut ffi::GstVideoAggregatorPad,
227            _param_spec: glib::ffi::gpointer,
228            f: glib::ffi::gpointer,
229        ) {
230            let f: &F = &*(f as *const F);
231            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
232        }
233        unsafe {
234            let f: Box_<F> = Box_::new(f);
235            connect_raw(
236                self.as_ptr() as *mut _,
237                c"notify::zorder".as_ptr() as *const _,
238                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
239                    notify_zorder_trampoline::<Self, F> as *const (),
240                )),
241                Box_::into_raw(f),
242            )
243        }
244    }
245}
246
247impl<O: IsA<VideoAggregatorPad>> VideoAggregatorPadExt for O {}