gstreamer_audio/auto/
audio_aggregator.rs1use 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 = "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 let f: &F = &*(f as *const F);
79 f(AudioAggregator::from_glib_borrow(this).unsafe_cast_ref())
80 }
81 unsafe {
82 let f: Box_<F> = Box_::new(f);
83 connect_raw(
84 self.as_ptr() as *mut _,
85 c"notify::alignment-threshold".as_ptr() as *const _,
86 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
87 notify_alignment_threshold_trampoline::<Self, F> as *const (),
88 )),
89 Box_::into_raw(f),
90 )
91 }
92 }
93
94 #[doc(alias = "discont-wait")]
95 fn connect_discont_wait_notify<F: Fn(&Self) + Send + Sync + 'static>(
96 &self,
97 f: F,
98 ) -> SignalHandlerId {
99 unsafe extern "C" fn notify_discont_wait_trampoline<
100 P: IsA<AudioAggregator>,
101 F: Fn(&P) + Send + Sync + 'static,
102 >(
103 this: *mut ffi::GstAudioAggregator,
104 _param_spec: glib::ffi::gpointer,
105 f: glib::ffi::gpointer,
106 ) {
107 let f: &F = &*(f as *const F);
108 f(AudioAggregator::from_glib_borrow(this).unsafe_cast_ref())
109 }
110 unsafe {
111 let f: Box_<F> = Box_::new(f);
112 connect_raw(
113 self.as_ptr() as *mut _,
114 c"notify::discont-wait".as_ptr() as *const _,
115 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
116 notify_discont_wait_trampoline::<Self, F> as *const (),
117 )),
118 Box_::into_raw(f),
119 )
120 }
121 }
122
123 #[doc(alias = "output-buffer-duration")]
124 fn connect_output_buffer_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
125 &self,
126 f: F,
127 ) -> SignalHandlerId {
128 unsafe extern "C" fn notify_output_buffer_duration_trampoline<
129 P: IsA<AudioAggregator>,
130 F: Fn(&P) + Send + Sync + 'static,
131 >(
132 this: *mut ffi::GstAudioAggregator,
133 _param_spec: glib::ffi::gpointer,
134 f: glib::ffi::gpointer,
135 ) {
136 let f: &F = &*(f as *const F);
137 f(AudioAggregator::from_glib_borrow(this).unsafe_cast_ref())
138 }
139 unsafe {
140 let f: Box_<F> = Box_::new(f);
141 connect_raw(
142 self.as_ptr() as *mut _,
143 c"notify::output-buffer-duration".as_ptr() as *const _,
144 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
145 notify_output_buffer_duration_trampoline::<Self, F> as *const (),
146 )),
147 Box_::into_raw(f),
148 )
149 }
150 }
151}
152
153impl<O: IsA<AudioAggregator>> AudioAggregatorExt for O {}