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