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