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 | |
6 | use glib::{ |
7 | prelude::*, |
8 | signal::{connect_raw, SignalHandlerId}, |
9 | translate::*, |
10 | }; |
11 | use std::{boxed::Box as Box_, mem::transmute}; |
12 | |
13 | glib::wrapper! { |
14 | #[doc (alias = "GstAudioBaseSink" )] |
15 | pub struct AudioBaseSink(Object<ffi::GstAudioBaseSink, ffi::GstAudioBaseSinkClass>) @extends gst_base::BaseSink, gst::Element, gst::Object; |
16 | |
17 | match fn { |
18 | type_ => || ffi::gst_audio_base_sink_get_type(), |
19 | } |
20 | } |
21 | |
22 | impl AudioBaseSink { |
23 | pub const NONE: Option<&'static AudioBaseSink> = None; |
24 | } |
25 | |
26 | unsafe impl Send for AudioBaseSink {} |
27 | unsafe impl Sync for AudioBaseSink {} |
28 | |
29 | mod sealed { |
30 | pub trait Sealed {} |
31 | impl<T: super::IsA<super::AudioBaseSink>> Sealed for T {} |
32 | } |
33 | |
34 | pub trait AudioBaseSinkExt: IsA<AudioBaseSink> + sealed::Sealed + 'static { |
35 | //#[doc(alias = "gst_audio_base_sink_create_ringbuffer")] |
36 | //fn create_ringbuffer(&self) -> /*Ignored*/Option<AudioRingBuffer> { |
37 | // unsafe { TODO: call ffi:gst_audio_base_sink_create_ringbuffer() } |
38 | //} |
39 | |
40 | #[doc (alias = "gst_audio_base_sink_get_alignment_threshold" )] |
41 | #[doc (alias = "get_alignment_threshold" )] |
42 | fn alignment_threshold(&self) -> gst::ClockTime { |
43 | unsafe { |
44 | try_from_glib(ffi::gst_audio_base_sink_get_alignment_threshold( |
45 | self.as_ref().to_glib_none().0, |
46 | )) |
47 | .expect("mandatory glib value is None" ) |
48 | } |
49 | } |
50 | |
51 | #[doc (alias = "gst_audio_base_sink_get_discont_wait" )] |
52 | #[doc (alias = "get_discont_wait" )] |
53 | fn discont_wait(&self) -> gst::ClockTime { |
54 | unsafe { |
55 | try_from_glib(ffi::gst_audio_base_sink_get_discont_wait( |
56 | self.as_ref().to_glib_none().0, |
57 | )) |
58 | .expect("mandatory glib value is None" ) |
59 | } |
60 | } |
61 | |
62 | #[doc (alias = "gst_audio_base_sink_get_drift_tolerance" )] |
63 | #[doc (alias = "get_drift_tolerance" )] |
64 | fn drift_tolerance(&self) -> i64 { |
65 | unsafe { ffi::gst_audio_base_sink_get_drift_tolerance(self.as_ref().to_glib_none().0) } |
66 | } |
67 | |
68 | #[doc (alias = "gst_audio_base_sink_get_provide_clock" )] |
69 | #[doc (alias = "get_provide_clock" )] |
70 | fn is_provide_clock(&self) -> bool { |
71 | unsafe { |
72 | from_glib(ffi::gst_audio_base_sink_get_provide_clock( |
73 | self.as_ref().to_glib_none().0, |
74 | )) |
75 | } |
76 | } |
77 | |
78 | //#[doc(alias = "gst_audio_base_sink_get_slave_method")] |
79 | //#[doc(alias = "get_slave_method")] |
80 | //fn slave_method(&self) -> /*Ignored*/AudioBaseSinkSlaveMethod { |
81 | // unsafe { TODO: call ffi:gst_audio_base_sink_get_slave_method() } |
82 | //} |
83 | |
84 | #[doc (alias = "gst_audio_base_sink_report_device_failure" )] |
85 | fn report_device_failure(&self) { |
86 | unsafe { |
87 | ffi::gst_audio_base_sink_report_device_failure(self.as_ref().to_glib_none().0); |
88 | } |
89 | } |
90 | |
91 | #[doc (alias = "gst_audio_base_sink_set_alignment_threshold" )] |
92 | fn set_alignment_threshold(&self, alignment_threshold: gst::ClockTime) { |
93 | unsafe { |
94 | ffi::gst_audio_base_sink_set_alignment_threshold( |
95 | self.as_ref().to_glib_none().0, |
96 | alignment_threshold.into_glib(), |
97 | ); |
98 | } |
99 | } |
100 | |
101 | //#[doc(alias = "gst_audio_base_sink_set_custom_slaving_callback")] |
102 | //fn set_custom_slaving_callback(&self, callback: /*Unimplemented*/Fn(&AudioBaseSink, impl Into<Option<gst::ClockTime>>, impl Into<Option<gst::ClockTime>>, gst::ClockTimeDiff, /*Ignored*/AudioBaseSinkDiscontReason), user_data: /*Unimplemented*/Option<Basic: Pointer>) { |
103 | // unsafe { TODO: call ffi:gst_audio_base_sink_set_custom_slaving_callback() } |
104 | //} |
105 | |
106 | #[doc (alias = "gst_audio_base_sink_set_discont_wait" )] |
107 | fn set_discont_wait(&self, discont_wait: gst::ClockTime) { |
108 | unsafe { |
109 | ffi::gst_audio_base_sink_set_discont_wait( |
110 | self.as_ref().to_glib_none().0, |
111 | discont_wait.into_glib(), |
112 | ); |
113 | } |
114 | } |
115 | |
116 | #[doc (alias = "gst_audio_base_sink_set_drift_tolerance" )] |
117 | fn set_drift_tolerance(&self, drift_tolerance: i64) { |
118 | unsafe { |
119 | ffi::gst_audio_base_sink_set_drift_tolerance( |
120 | self.as_ref().to_glib_none().0, |
121 | drift_tolerance, |
122 | ); |
123 | } |
124 | } |
125 | |
126 | #[doc (alias = "gst_audio_base_sink_set_provide_clock" )] |
127 | fn set_provide_clock(&self, provide: bool) { |
128 | unsafe { |
129 | ffi::gst_audio_base_sink_set_provide_clock( |
130 | self.as_ref().to_glib_none().0, |
131 | provide.into_glib(), |
132 | ); |
133 | } |
134 | } |
135 | |
136 | //#[doc(alias = "gst_audio_base_sink_set_slave_method")] |
137 | //fn set_slave_method(&self, method: /*Ignored*/AudioBaseSinkSlaveMethod) { |
138 | // unsafe { TODO: call ffi:gst_audio_base_sink_set_slave_method() } |
139 | //} |
140 | |
141 | #[doc (alias = "buffer-time" )] |
142 | fn buffer_time(&self) -> i64 { |
143 | ObjectExt::property(self.as_ref(), "buffer-time" ) |
144 | } |
145 | |
146 | #[doc (alias = "buffer-time" )] |
147 | fn set_buffer_time(&self, buffer_time: i64) { |
148 | ObjectExt::set_property(self.as_ref(), "buffer-time" , buffer_time) |
149 | } |
150 | |
151 | #[doc (alias = "can-activate-pull" )] |
152 | fn can_activate_pull(&self) -> bool { |
153 | ObjectExt::property(self.as_ref(), "can-activate-pull" ) |
154 | } |
155 | |
156 | #[doc (alias = "can-activate-pull" )] |
157 | fn set_can_activate_pull(&self, can_activate_pull: bool) { |
158 | ObjectExt::set_property(self.as_ref(), "can-activate-pull" , can_activate_pull) |
159 | } |
160 | |
161 | #[doc (alias = "latency-time" )] |
162 | fn latency_time(&self) -> i64 { |
163 | ObjectExt::property(self.as_ref(), "latency-time" ) |
164 | } |
165 | |
166 | #[doc (alias = "latency-time" )] |
167 | fn set_latency_time(&self, latency_time: i64) { |
168 | ObjectExt::set_property(self.as_ref(), "latency-time" , latency_time) |
169 | } |
170 | |
171 | #[doc (alias = "alignment-threshold" )] |
172 | fn connect_alignment_threshold_notify<F: Fn(&Self) + Send + Sync + 'static>( |
173 | &self, |
174 | f: F, |
175 | ) -> SignalHandlerId { |
176 | unsafe extern "C" fn notify_alignment_threshold_trampoline< |
177 | P: IsA<AudioBaseSink>, |
178 | F: Fn(&P) + Send + Sync + 'static, |
179 | >( |
180 | this: *mut ffi::GstAudioBaseSink, |
181 | _param_spec: glib::ffi::gpointer, |
182 | f: glib::ffi::gpointer, |
183 | ) { |
184 | let f: &F = &*(f as *const F); |
185 | f(AudioBaseSink::from_glib_borrow(this).unsafe_cast_ref()) |
186 | } |
187 | unsafe { |
188 | let f: Box_<F> = Box_::new(f); |
189 | connect_raw( |
190 | self.as_ptr() as *mut _, |
191 | b"notify::alignment-threshold \0" .as_ptr() as *const _, |
192 | Some(transmute::<_, unsafe extern "C" fn()>( |
193 | notify_alignment_threshold_trampoline::<Self, F> as *const (), |
194 | )), |
195 | Box_::into_raw(f), |
196 | ) |
197 | } |
198 | } |
199 | |
200 | #[doc (alias = "buffer-time" )] |
201 | fn connect_buffer_time_notify<F: Fn(&Self) + Send + Sync + 'static>( |
202 | &self, |
203 | f: F, |
204 | ) -> SignalHandlerId { |
205 | unsafe extern "C" fn notify_buffer_time_trampoline< |
206 | P: IsA<AudioBaseSink>, |
207 | F: Fn(&P) + Send + Sync + 'static, |
208 | >( |
209 | this: *mut ffi::GstAudioBaseSink, |
210 | _param_spec: glib::ffi::gpointer, |
211 | f: glib::ffi::gpointer, |
212 | ) { |
213 | let f: &F = &*(f as *const F); |
214 | f(AudioBaseSink::from_glib_borrow(this).unsafe_cast_ref()) |
215 | } |
216 | unsafe { |
217 | let f: Box_<F> = Box_::new(f); |
218 | connect_raw( |
219 | self.as_ptr() as *mut _, |
220 | b"notify::buffer-time \0" .as_ptr() as *const _, |
221 | Some(transmute::<_, unsafe extern "C" fn()>( |
222 | notify_buffer_time_trampoline::<Self, F> as *const (), |
223 | )), |
224 | Box_::into_raw(f), |
225 | ) |
226 | } |
227 | } |
228 | |
229 | #[doc (alias = "can-activate-pull" )] |
230 | fn connect_can_activate_pull_notify<F: Fn(&Self) + Send + Sync + 'static>( |
231 | &self, |
232 | f: F, |
233 | ) -> SignalHandlerId { |
234 | unsafe extern "C" fn notify_can_activate_pull_trampoline< |
235 | P: IsA<AudioBaseSink>, |
236 | F: Fn(&P) + Send + Sync + 'static, |
237 | >( |
238 | this: *mut ffi::GstAudioBaseSink, |
239 | _param_spec: glib::ffi::gpointer, |
240 | f: glib::ffi::gpointer, |
241 | ) { |
242 | let f: &F = &*(f as *const F); |
243 | f(AudioBaseSink::from_glib_borrow(this).unsafe_cast_ref()) |
244 | } |
245 | unsafe { |
246 | let f: Box_<F> = Box_::new(f); |
247 | connect_raw( |
248 | self.as_ptr() as *mut _, |
249 | b"notify::can-activate-pull \0" .as_ptr() as *const _, |
250 | Some(transmute::<_, unsafe extern "C" fn()>( |
251 | notify_can_activate_pull_trampoline::<Self, F> as *const (), |
252 | )), |
253 | Box_::into_raw(f), |
254 | ) |
255 | } |
256 | } |
257 | |
258 | #[doc (alias = "discont-wait" )] |
259 | fn connect_discont_wait_notify<F: Fn(&Self) + Send + Sync + 'static>( |
260 | &self, |
261 | f: F, |
262 | ) -> SignalHandlerId { |
263 | unsafe extern "C" fn notify_discont_wait_trampoline< |
264 | P: IsA<AudioBaseSink>, |
265 | F: Fn(&P) + Send + Sync + 'static, |
266 | >( |
267 | this: *mut ffi::GstAudioBaseSink, |
268 | _param_spec: glib::ffi::gpointer, |
269 | f: glib::ffi::gpointer, |
270 | ) { |
271 | let f: &F = &*(f as *const F); |
272 | f(AudioBaseSink::from_glib_borrow(this).unsafe_cast_ref()) |
273 | } |
274 | unsafe { |
275 | let f: Box_<F> = Box_::new(f); |
276 | connect_raw( |
277 | self.as_ptr() as *mut _, |
278 | b"notify::discont-wait \0" .as_ptr() as *const _, |
279 | Some(transmute::<_, unsafe extern "C" fn()>( |
280 | notify_discont_wait_trampoline::<Self, F> as *const (), |
281 | )), |
282 | Box_::into_raw(f), |
283 | ) |
284 | } |
285 | } |
286 | |
287 | #[doc (alias = "drift-tolerance" )] |
288 | fn connect_drift_tolerance_notify<F: Fn(&Self) + Send + Sync + 'static>( |
289 | &self, |
290 | f: F, |
291 | ) -> SignalHandlerId { |
292 | unsafe extern "C" fn notify_drift_tolerance_trampoline< |
293 | P: IsA<AudioBaseSink>, |
294 | F: Fn(&P) + Send + Sync + 'static, |
295 | >( |
296 | this: *mut ffi::GstAudioBaseSink, |
297 | _param_spec: glib::ffi::gpointer, |
298 | f: glib::ffi::gpointer, |
299 | ) { |
300 | let f: &F = &*(f as *const F); |
301 | f(AudioBaseSink::from_glib_borrow(this).unsafe_cast_ref()) |
302 | } |
303 | unsafe { |
304 | let f: Box_<F> = Box_::new(f); |
305 | connect_raw( |
306 | self.as_ptr() as *mut _, |
307 | b"notify::drift-tolerance \0" .as_ptr() as *const _, |
308 | Some(transmute::<_, unsafe extern "C" fn()>( |
309 | notify_drift_tolerance_trampoline::<Self, F> as *const (), |
310 | )), |
311 | Box_::into_raw(f), |
312 | ) |
313 | } |
314 | } |
315 | |
316 | #[doc (alias = "latency-time" )] |
317 | fn connect_latency_time_notify<F: Fn(&Self) + Send + Sync + 'static>( |
318 | &self, |
319 | f: F, |
320 | ) -> SignalHandlerId { |
321 | unsafe extern "C" fn notify_latency_time_trampoline< |
322 | P: IsA<AudioBaseSink>, |
323 | F: Fn(&P) + Send + Sync + 'static, |
324 | >( |
325 | this: *mut ffi::GstAudioBaseSink, |
326 | _param_spec: glib::ffi::gpointer, |
327 | f: glib::ffi::gpointer, |
328 | ) { |
329 | let f: &F = &*(f as *const F); |
330 | f(AudioBaseSink::from_glib_borrow(this).unsafe_cast_ref()) |
331 | } |
332 | unsafe { |
333 | let f: Box_<F> = Box_::new(f); |
334 | connect_raw( |
335 | self.as_ptr() as *mut _, |
336 | b"notify::latency-time \0" .as_ptr() as *const _, |
337 | Some(transmute::<_, unsafe extern "C" fn()>( |
338 | notify_latency_time_trampoline::<Self, F> as *const (), |
339 | )), |
340 | Box_::into_raw(f), |
341 | ) |
342 | } |
343 | } |
344 | |
345 | #[doc (alias = "provide-clock" )] |
346 | fn connect_provide_clock_notify<F: Fn(&Self) + Send + Sync + 'static>( |
347 | &self, |
348 | f: F, |
349 | ) -> SignalHandlerId { |
350 | unsafe extern "C" fn notify_provide_clock_trampoline< |
351 | P: IsA<AudioBaseSink>, |
352 | F: Fn(&P) + Send + Sync + 'static, |
353 | >( |
354 | this: *mut ffi::GstAudioBaseSink, |
355 | _param_spec: glib::ffi::gpointer, |
356 | f: glib::ffi::gpointer, |
357 | ) { |
358 | let f: &F = &*(f as *const F); |
359 | f(AudioBaseSink::from_glib_borrow(this).unsafe_cast_ref()) |
360 | } |
361 | unsafe { |
362 | let f: Box_<F> = Box_::new(f); |
363 | connect_raw( |
364 | self.as_ptr() as *mut _, |
365 | b"notify::provide-clock \0" .as_ptr() as *const _, |
366 | Some(transmute::<_, unsafe extern "C" fn()>( |
367 | notify_provide_clock_trampoline::<Self, F> as *const (), |
368 | )), |
369 | Box_::into_raw(f), |
370 | ) |
371 | } |
372 | } |
373 | |
374 | #[doc (alias = "slave-method" )] |
375 | fn connect_slave_method_notify<F: Fn(&Self) + Send + Sync + 'static>( |
376 | &self, |
377 | f: F, |
378 | ) -> SignalHandlerId { |
379 | unsafe extern "C" fn notify_slave_method_trampoline< |
380 | P: IsA<AudioBaseSink>, |
381 | F: Fn(&P) + Send + Sync + 'static, |
382 | >( |
383 | this: *mut ffi::GstAudioBaseSink, |
384 | _param_spec: glib::ffi::gpointer, |
385 | f: glib::ffi::gpointer, |
386 | ) { |
387 | let f: &F = &*(f as *const F); |
388 | f(AudioBaseSink::from_glib_borrow(this).unsafe_cast_ref()) |
389 | } |
390 | unsafe { |
391 | let f: Box_<F> = Box_::new(f); |
392 | connect_raw( |
393 | self.as_ptr() as *mut _, |
394 | b"notify::slave-method \0" .as_ptr() as *const _, |
395 | Some(transmute::<_, unsafe extern "C" fn()>( |
396 | notify_slave_method_trampoline::<Self, F> as *const (), |
397 | )), |
398 | Box_::into_raw(f), |
399 | ) |
400 | } |
401 | } |
402 | } |
403 | |
404 | impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {} |
405 | |