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