gstreamer_video/auto/
video_aggregator_pad.rs1use crate::ffi;
7use glib::{
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
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 unsafe {
176 let f: &F = &*(f as *const F);
177 f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
178 }
179 }
180 unsafe {
181 let f: Box_<F> = Box_::new(f);
182 connect_raw(
183 self.as_ptr() as *mut _,
184 c"notify::max-last-buffer-repeat".as_ptr(),
185 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
186 notify_max_last_buffer_repeat_trampoline::<Self, F> as *const (),
187 )),
188 Box_::into_raw(f),
189 )
190 }
191 }
192
193 #[doc(alias = "repeat-after-eos")]
194 fn connect_repeat_after_eos_notify<F: Fn(&Self) + Send + Sync + 'static>(
195 &self,
196 f: F,
197 ) -> SignalHandlerId {
198 unsafe extern "C" fn notify_repeat_after_eos_trampoline<
199 P: IsA<VideoAggregatorPad>,
200 F: Fn(&P) + Send + Sync + 'static,
201 >(
202 this: *mut ffi::GstVideoAggregatorPad,
203 _param_spec: glib::ffi::gpointer,
204 f: glib::ffi::gpointer,
205 ) {
206 unsafe {
207 let f: &F = &*(f as *const F);
208 f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
209 }
210 }
211 unsafe {
212 let f: Box_<F> = Box_::new(f);
213 connect_raw(
214 self.as_ptr() as *mut _,
215 c"notify::repeat-after-eos".as_ptr(),
216 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
217 notify_repeat_after_eos_trampoline::<Self, F> as *const (),
218 )),
219 Box_::into_raw(f),
220 )
221 }
222 }
223
224 #[doc(alias = "zorder")]
225 fn connect_zorder_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
226 unsafe extern "C" fn notify_zorder_trampoline<
227 P: IsA<VideoAggregatorPad>,
228 F: Fn(&P) + Send + Sync + 'static,
229 >(
230 this: *mut ffi::GstVideoAggregatorPad,
231 _param_spec: glib::ffi::gpointer,
232 f: glib::ffi::gpointer,
233 ) {
234 unsafe {
235 let f: &F = &*(f as *const F);
236 f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
237 }
238 }
239 unsafe {
240 let f: Box_<F> = Box_::new(f);
241 connect_raw(
242 self.as_ptr() as *mut _,
243 c"notify::zorder".as_ptr(),
244 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
245 notify_zorder_trampoline::<Self, F> as *const (),
246 )),
247 Box_::into_raw(f),
248 )
249 }
250 }
251}
252
253impl<O: IsA<VideoAggregatorPad>> VideoAggregatorPadExt for O {}