gstreamer_audio/auto/
audio_aggregator.rs

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