gstreamer_audio/auto/
audio_aggregator_pad.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::prelude::*;
8#[cfg(feature = "v1_20")]
9#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
10use glib::{
11    signal::{connect_raw, SignalHandlerId},
12    translate::*,
13};
14#[cfg(feature = "v1_20")]
15#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    /// The default implementation of GstPad used with [`AudioAggregator`][crate::AudioAggregator]
20    ///
21    /// ## Properties
22    ///
23    ///
24    /// #### `qos-messages`
25    ///  Emit QoS messages when dropping buffers.
26    ///
27    /// Readable | Writeable
28    /// <details><summary><h4>AggregatorPad</h4></summary>
29    ///
30    ///
31    /// #### `current-level-buffers`
32    ///  The number of currently queued buffers inside this pad
33    ///
34    /// Readable
35    ///
36    ///
37    /// #### `current-level-bytes`
38    ///  The number of currently queued bytes inside this pad
39    ///
40    /// Readable
41    ///
42    ///
43    /// #### `current-level-time`
44    ///  The amount of currently queued time inside this pad
45    ///
46    /// Readable
47    ///
48    ///
49    /// #### `emit-signals`
50    ///  Enables the emission of signals such as [`buffer-consumed`][struct@crate::gst_base::AggregatorPad#buffer-consumed]
51    ///
52    /// Readable | Writeable
53    /// </details>
54    /// <details><summary><h4>Pad</h4></summary>
55    ///
56    ///
57    /// #### `caps`
58    ///  Readable
59    ///
60    ///
61    /// #### `direction`
62    ///  Readable | Writeable | Construct Only
63    ///
64    ///
65    /// #### `offset`
66    ///  The offset that will be applied to the running time of the pad.
67    ///
68    /// Readable | Writeable
69    ///
70    ///
71    /// #### `template`
72    ///  Readable | Writeable
73    /// </details>
74    /// <details><summary><h4>Object</h4></summary>
75    ///
76    ///
77    /// #### `name`
78    ///  Readable | Writeable | Construct
79    ///
80    ///
81    /// #### `parent`
82    ///  The parent of the object. Please note, that when changing the 'parent'
83    /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
84    /// signals due to locking issues. In some cases one can use
85    /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
86    /// achieve a similar effect.
87    ///
88    /// Readable | Writeable
89    /// </details>
90    ///
91    /// # Implements
92    ///
93    /// [`AudioAggregatorPadExt`][trait@crate::prelude::AudioAggregatorPadExt], [`trait@gst_base::prelude::AggregatorPadExt`], [`trait@gst::prelude::GstObjectExt`], [`trait@glib::ObjectExt`]
94    #[doc(alias = "GstAudioAggregatorPad")]
95    pub struct AudioAggregatorPad(Object<ffi::GstAudioAggregatorPad, ffi::GstAudioAggregatorPadClass>) @extends gst_base::AggregatorPad, gst::Object;
96
97    match fn {
98        type_ => || ffi::gst_audio_aggregator_pad_get_type(),
99    }
100}
101
102impl AudioAggregatorPad {
103    pub const NONE: Option<&'static AudioAggregatorPad> = None;
104}
105
106unsafe impl Send for AudioAggregatorPad {}
107unsafe impl Sync for AudioAggregatorPad {}
108
109/// Trait containing all [`struct@AudioAggregatorPad`] methods.
110///
111/// # Implementors
112///
113/// [`AudioAggregatorConvertPad`][struct@crate::AudioAggregatorConvertPad], [`AudioAggregatorPad`][struct@crate::AudioAggregatorPad]
114pub trait AudioAggregatorPadExt: IsA<AudioAggregatorPad> + 'static {
115    /// Emit QoS messages when dropping buffers.
116    #[cfg(feature = "v1_20")]
117    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
118    #[doc(alias = "qos-messages")]
119    fn is_qos_messages(&self) -> bool {
120        ObjectExt::property(self.as_ref(), "qos-messages")
121    }
122
123    /// Emit QoS messages when dropping buffers.
124    #[cfg(feature = "v1_20")]
125    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
126    #[doc(alias = "qos-messages")]
127    fn set_qos_messages(&self, qos_messages: bool) {
128        ObjectExt::set_property(self.as_ref(), "qos-messages", qos_messages)
129    }
130
131    #[cfg(feature = "v1_20")]
132    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
133    #[doc(alias = "qos-messages")]
134    fn connect_qos_messages_notify<F: Fn(&Self) + Send + Sync + 'static>(
135        &self,
136        f: F,
137    ) -> SignalHandlerId {
138        unsafe extern "C" fn notify_qos_messages_trampoline<
139            P: IsA<AudioAggregatorPad>,
140            F: Fn(&P) + Send + Sync + 'static,
141        >(
142            this: *mut ffi::GstAudioAggregatorPad,
143            _param_spec: glib::ffi::gpointer,
144            f: glib::ffi::gpointer,
145        ) {
146            let f: &F = &*(f as *const F);
147            f(AudioAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
148        }
149        unsafe {
150            let f: Box_<F> = Box_::new(f);
151            connect_raw(
152                self.as_ptr() as *mut _,
153                c"notify::qos-messages".as_ptr() as *const _,
154                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
155                    notify_qos_messages_trampoline::<Self, F> as *const (),
156                )),
157                Box_::into_raw(f),
158            )
159        }
160    }
161}
162
163impl<O: IsA<AudioAggregatorPad>> AudioAggregatorPadExt for O {}