gstreamer_audio/auto/
audio_aggregator.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 = "GstAudioAggregator")]
16 pub struct AudioAggregator(Object<ffi::GstAudioAggregator, ffi::GstAudioAggregatorClass>) @extends gst_base::Aggregator, gst::Element, gst::Object;
17
18 match fn {
19 type_ => || ffi::gst_audio_aggregator_get_type(),
20 }
21}
22
23impl AudioAggregator {
24 pub const NONE: Option<&'static AudioAggregator> = None;
25}
26
27unsafe impl Send for AudioAggregator {}
28unsafe impl Sync for AudioAggregator {}
29
30pub trait AudioAggregatorExt: IsA<AudioAggregator> + 'static {
31 #[doc(alias = "alignment-threshold")]
32 fn alignment_threshold(&self) -> u64 {
33 ObjectExt::property(self.as_ref(), "alignment-threshold")
34 }
35
36 #[doc(alias = "alignment-threshold")]
37 fn set_alignment_threshold(&self, alignment_threshold: u64) {
38 ObjectExt::set_property(self.as_ref(), "alignment-threshold", alignment_threshold)
39 }
40
41 #[doc(alias = "discont-wait")]
42 fn discont_wait(&self) -> u64 {
43 ObjectExt::property(self.as_ref(), "discont-wait")
44 }
45
46 #[doc(alias = "discont-wait")]
47 fn set_discont_wait(&self, discont_wait: u64) {
48 ObjectExt::set_property(self.as_ref(), "discont-wait", discont_wait)
49 }
50
51 #[doc(alias = "output-buffer-duration")]
52 fn output_buffer_duration(&self) -> u64 {
53 ObjectExt::property(self.as_ref(), "output-buffer-duration")
54 }
55
56 #[doc(alias = "output-buffer-duration")]
57 fn set_output_buffer_duration(&self, output_buffer_duration: u64) {
58 ObjectExt::set_property(
59 self.as_ref(),
60 "output-buffer-duration",
61 output_buffer_duration,
62 )
63 }
64
65 #[doc(alias = "alignment-threshold")]
66 fn connect_alignment_threshold_notify<F: Fn(&Self) + Send + Sync + 'static>(
67 &self,
68 f: F,
69 ) -> SignalHandlerId {
70 unsafe extern "C" fn notify_alignment_threshold_trampoline<
71 P: IsA<AudioAggregator>,
72 F: Fn(&P) + Send + Sync + 'static,
73 >(
74 this: *mut ffi::GstAudioAggregator,
75 _param_spec: glib::ffi::gpointer,
76 f: glib::ffi::gpointer,
77 ) {
78 unsafe {
79 let f: &F = &*(f as *const F);
80 f(AudioAggregator::from_glib_borrow(this).unsafe_cast_ref())
81 }
82 }
83 unsafe {
84 let f: Box_<F> = Box_::new(f);
85 connect_raw(
86 self.as_ptr() as *mut _,
87 c"notify::alignment-threshold".as_ptr(),
88 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
89 notify_alignment_threshold_trampoline::<Self, F> as *const (),
90 )),
91 Box_::into_raw(f),
92 )
93 }
94 }
95
96 #[doc(alias = "discont-wait")]
97 fn connect_discont_wait_notify<F: Fn(&Self) + Send + Sync + 'static>(
98 &self,
99 f: F,
100 ) -> SignalHandlerId {
101 unsafe extern "C" fn notify_discont_wait_trampoline<
102 P: IsA<AudioAggregator>,
103 F: Fn(&P) + Send + Sync + 'static,
104 >(
105 this: *mut ffi::GstAudioAggregator,
106 _param_spec: glib::ffi::gpointer,
107 f: glib::ffi::gpointer,
108 ) {
109 unsafe {
110 let f: &F = &*(f as *const F);
111 f(AudioAggregator::from_glib_borrow(this).unsafe_cast_ref())
112 }
113 }
114 unsafe {
115 let f: Box_<F> = Box_::new(f);
116 connect_raw(
117 self.as_ptr() as *mut _,
118 c"notify::discont-wait".as_ptr(),
119 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
120 notify_discont_wait_trampoline::<Self, F> as *const (),
121 )),
122 Box_::into_raw(f),
123 )
124 }
125 }
126
127 #[doc(alias = "output-buffer-duration")]
128 fn connect_output_buffer_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
129 &self,
130 f: F,
131 ) -> SignalHandlerId {
132 unsafe extern "C" fn notify_output_buffer_duration_trampoline<
133 P: IsA<AudioAggregator>,
134 F: Fn(&P) + Send + Sync + 'static,
135 >(
136 this: *mut ffi::GstAudioAggregator,
137 _param_spec: glib::ffi::gpointer,
138 f: glib::ffi::gpointer,
139 ) {
140 unsafe {
141 let f: &F = &*(f as *const F);
142 f(AudioAggregator::from_glib_borrow(this).unsafe_cast_ref())
143 }
144 }
145 unsafe {
146 let f: Box_<F> = Box_::new(f);
147 connect_raw(
148 self.as_ptr() as *mut _,
149 c"notify::output-buffer-duration".as_ptr(),
150 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
151 notify_output_buffer_duration_trampoline::<Self, F> as *const (),
152 )),
153 Box_::into_raw(f),
154 )
155 }
156 }
157}
158
159impl<O: IsA<AudioAggregator>> AudioAggregatorExt for O {}