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