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
6use glib::{
7 prelude::*,
8 signal::{connect_raw, SignalHandlerId},
9 translate::*,
10};
11use std::{boxed::Box as Box_, mem::transmute};
12
13glib::wrapper! {
14 #[doc(alias = "GstAudioBaseSrc")]
15 pub struct AudioBaseSrc(Object<ffi::GstAudioBaseSrc, ffi::GstAudioBaseSrcClass>) @extends gst_base::BaseSrc, gst::Element, gst::Object;
16
17 match fn {
18 type_ => || ffi::gst_audio_base_src_get_type(),
19 }
20}
21
22impl AudioBaseSrc {
23 pub const NONE: Option<&'static AudioBaseSrc> = None;
24}
25
26unsafe impl Send for AudioBaseSrc {}
27unsafe impl Sync for AudioBaseSrc {}
28
29mod sealed {
30 pub trait Sealed {}
31 impl<T: super::IsA<super::AudioBaseSrc>> Sealed for T {}
32}
33
34pub trait AudioBaseSrcExt: IsA<AudioBaseSrc> + sealed::Sealed + 'static {
35 //#[doc(alias = "gst_audio_base_src_create_ringbuffer")]
36 //fn create_ringbuffer(&self) -> /*Ignored*/Option<AudioRingBuffer> {
37 // unsafe { TODO: call ffi:gst_audio_base_src_create_ringbuffer() }
38 //}
39
40 #[doc(alias = "gst_audio_base_src_get_provide_clock")]
41 #[doc(alias = "get_provide_clock")]
42 fn is_provide_clock(&self) -> bool {
43 unsafe {
44 from_glib(ffi::gst_audio_base_src_get_provide_clock(
45 self.as_ref().to_glib_none().0,
46 ))
47 }
48 }
49
50 //#[doc(alias = "gst_audio_base_src_get_slave_method")]
51 //#[doc(alias = "get_slave_method")]
52 //fn slave_method(&self) -> /*Ignored*/AudioBaseSrcSlaveMethod {
53 // unsafe { TODO: call ffi:gst_audio_base_src_get_slave_method() }
54 //}
55
56 #[doc(alias = "gst_audio_base_src_set_provide_clock")]
57 fn set_provide_clock(&self, provide: bool) {
58 unsafe {
59 ffi::gst_audio_base_src_set_provide_clock(
60 self.as_ref().to_glib_none().0,
61 provide.into_glib(),
62 );
63 }
64 }
65
66 //#[doc(alias = "gst_audio_base_src_set_slave_method")]
67 //fn set_slave_method(&self, method: /*Ignored*/AudioBaseSrcSlaveMethod) {
68 // unsafe { TODO: call ffi:gst_audio_base_src_set_slave_method() }
69 //}
70
71 #[doc(alias = "actual-buffer-time")]
72 fn actual_buffer_time(&self) -> i64 {
73 ObjectExt::property(self.as_ref(), "actual-buffer-time")
74 }
75
76 #[doc(alias = "actual-latency-time")]
77 fn actual_latency_time(&self) -> i64 {
78 ObjectExt::property(self.as_ref(), "actual-latency-time")
79 }
80
81 #[doc(alias = "buffer-time")]
82 fn buffer_time(&self) -> i64 {
83 ObjectExt::property(self.as_ref(), "buffer-time")
84 }
85
86 #[doc(alias = "buffer-time")]
87 fn set_buffer_time(&self, buffer_time: i64) {
88 ObjectExt::set_property(self.as_ref(), "buffer-time", buffer_time)
89 }
90
91 #[doc(alias = "latency-time")]
92 fn latency_time(&self) -> i64 {
93 ObjectExt::property(self.as_ref(), "latency-time")
94 }
95
96 #[doc(alias = "latency-time")]
97 fn set_latency_time(&self, latency_time: i64) {
98 ObjectExt::set_property(self.as_ref(), "latency-time", latency_time)
99 }
100
101 #[doc(alias = "actual-buffer-time")]
102 fn connect_actual_buffer_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
103 &self,
104 f: F,
105 ) -> SignalHandlerId {
106 unsafe extern "C" fn notify_actual_buffer_time_trampoline<
107 P: IsA<AudioBaseSrc>,
108 F: Fn(&P) + Send + Sync + 'static,
109 >(
110 this: *mut ffi::GstAudioBaseSrc,
111 _param_spec: glib::ffi::gpointer,
112 f: glib::ffi::gpointer,
113 ) {
114 let f: &F = &*(f as *const F);
115 f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
116 }
117 unsafe {
118 let f: Box_<F> = Box_::new(f);
119 connect_raw(
120 self.as_ptr() as *mut _,
121 b"notify::actual-buffer-time\0".as_ptr() as *const _,
122 Some(transmute::<_, unsafe extern "C" fn()>(
123 notify_actual_buffer_time_trampoline::<Self, F> as *const (),
124 )),
125 Box_::into_raw(f),
126 )
127 }
128 }
129
130 #[doc(alias = "actual-latency-time")]
131 fn connect_actual_latency_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
132 &self,
133 f: F,
134 ) -> SignalHandlerId {
135 unsafe extern "C" fn notify_actual_latency_time_trampoline<
136 P: IsA<AudioBaseSrc>,
137 F: Fn(&P) + Send + Sync + 'static,
138 >(
139 this: *mut ffi::GstAudioBaseSrc,
140 _param_spec: glib::ffi::gpointer,
141 f: glib::ffi::gpointer,
142 ) {
143 let f: &F = &*(f as *const F);
144 f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
145 }
146 unsafe {
147 let f: Box_<F> = Box_::new(f);
148 connect_raw(
149 self.as_ptr() as *mut _,
150 b"notify::actual-latency-time\0".as_ptr() as *const _,
151 Some(transmute::<_, unsafe extern "C" fn()>(
152 notify_actual_latency_time_trampoline::<Self, F> as *const (),
153 )),
154 Box_::into_raw(f),
155 )
156 }
157 }
158
159 #[doc(alias = "buffer-time")]
160 fn connect_buffer_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
161 &self,
162 f: F,
163 ) -> SignalHandlerId {
164 unsafe extern "C" fn notify_buffer_time_trampoline<
165 P: IsA<AudioBaseSrc>,
166 F: Fn(&P) + Send + Sync + 'static,
167 >(
168 this: *mut ffi::GstAudioBaseSrc,
169 _param_spec: glib::ffi::gpointer,
170 f: glib::ffi::gpointer,
171 ) {
172 let f: &F = &*(f as *const F);
173 f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
174 }
175 unsafe {
176 let f: Box_<F> = Box_::new(f);
177 connect_raw(
178 self.as_ptr() as *mut _,
179 b"notify::buffer-time\0".as_ptr() as *const _,
180 Some(transmute::<_, unsafe extern "C" fn()>(
181 notify_buffer_time_trampoline::<Self, F> as *const (),
182 )),
183 Box_::into_raw(f),
184 )
185 }
186 }
187
188 #[doc(alias = "latency-time")]
189 fn connect_latency_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
190 &self,
191 f: F,
192 ) -> SignalHandlerId {
193 unsafe extern "C" fn notify_latency_time_trampoline<
194 P: IsA<AudioBaseSrc>,
195 F: Fn(&P) + Send + Sync + 'static,
196 >(
197 this: *mut ffi::GstAudioBaseSrc,
198 _param_spec: glib::ffi::gpointer,
199 f: glib::ffi::gpointer,
200 ) {
201 let f: &F = &*(f as *const F);
202 f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
203 }
204 unsafe {
205 let f: Box_<F> = Box_::new(f);
206 connect_raw(
207 self.as_ptr() as *mut _,
208 b"notify::latency-time\0".as_ptr() as *const _,
209 Some(transmute::<_, unsafe extern "C" fn()>(
210 notify_latency_time_trampoline::<Self, F> as *const (),
211 )),
212 Box_::into_raw(f),
213 )
214 }
215 }
216
217 #[doc(alias = "provide-clock")]
218 fn connect_provide_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(
219 &self,
220 f: F,
221 ) -> SignalHandlerId {
222 unsafe extern "C" fn notify_provide_clock_trampoline<
223 P: IsA<AudioBaseSrc>,
224 F: Fn(&P) + Send + Sync + 'static,
225 >(
226 this: *mut ffi::GstAudioBaseSrc,
227 _param_spec: glib::ffi::gpointer,
228 f: glib::ffi::gpointer,
229 ) {
230 let f: &F = &*(f as *const F);
231 f(AudioBaseSrc::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 b"notify::provide-clock\0".as_ptr() as *const _,
238 Some(transmute::<_, unsafe extern "C" fn()>(
239 notify_provide_clock_trampoline::<Self, F> as *const (),
240 )),
241 Box_::into_raw(f),
242 )
243 }
244 }
245
246 #[doc(alias = "slave-method")]
247 fn connect_slave_method_notify<F: Fn(&Self) + Send + Sync + 'static>(
248 &self,
249 f: F,
250 ) -> SignalHandlerId {
251 unsafe extern "C" fn notify_slave_method_trampoline<
252 P: IsA<AudioBaseSrc>,
253 F: Fn(&P) + Send + Sync + 'static,
254 >(
255 this: *mut ffi::GstAudioBaseSrc,
256 _param_spec: glib::ffi::gpointer,
257 f: glib::ffi::gpointer,
258 ) {
259 let f: &F = &*(f as *const F);
260 f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
261 }
262 unsafe {
263 let f: Box_<F> = Box_::new(f);
264 connect_raw(
265 self.as_ptr() as *mut _,
266 b"notify::slave-method\0".as_ptr() as *const _,
267 Some(transmute::<_, unsafe extern "C" fn()>(
268 notify_slave_method_trampoline::<Self, F> as *const (),
269 )),
270 Box_::into_raw(f),
271 )
272 }
273 }
274}
275
276impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {}
277