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
91mod sealed {
92 pub trait Sealed {}
93 impl<T: super::IsA<super::AudioAggregatorPad>> Sealed for T {}
94}
95
96/// Trait containing all [`struct@AudioAggregatorPad`] methods.
97///
98/// # Implementors
99///
100/// [`AudioAggregatorConvertPad`][struct@crate::AudioAggregatorConvertPad], [`AudioAggregatorPad`][struct@crate::AudioAggregatorPad]
101pub trait AudioAggregatorPadExt: IsA<AudioAggregatorPad> + sealed::Sealed + 'static {
102 /// Emit QoS messages when dropping buffers.
103 #[cfg(feature = "v1_20")]
104 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
105 #[doc(alias = "qos-messages")]
106 fn is_qos_messages(&self) -> bool {
107 ObjectExt::property(self.as_ref(), "qos-messages")
108 }
109
110 /// Emit QoS messages when dropping buffers.
111 #[cfg(feature = "v1_20")]
112 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
113 #[doc(alias = "qos-messages")]
114 fn set_qos_messages(&self, qos_messages: bool) {
115 ObjectExt::set_property(self.as_ref(), "qos-messages", qos_messages)
116 }
117
118 #[cfg(feature = "v1_20")]
119 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
120 #[doc(alias = "qos-messages")]
121 fn connect_qos_messages_notify<F: Fn(&Self) + Send + Sync + 'static>(
122 &self,
123 f: F,
124 ) -> SignalHandlerId {
125 unsafe extern "C" fn notify_qos_messages_trampoline<
126 P: IsA<AudioAggregatorPad>,
127 F: Fn(&P) + Send + Sync + 'static,
128 >(
129 this: *mut ffi::GstAudioAggregatorPad,
130 _param_spec: glib::ffi::gpointer,
131 f: glib::ffi::gpointer,
132 ) {
133 let f: &F = &*(f as *const F);
134 f(AudioAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
135 }
136 unsafe {
137 let f: Box_<F> = Box_::new(f);
138 connect_raw(
139 self.as_ptr() as *mut _,
140 b"notify::qos-messages\0".as_ptr() as *const _,
141 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
142 notify_qos_messages_trampoline::<Self, F> as *const (),
143 )),
144 Box_::into_raw(f),
145 )
146 }
147 }
148}
149
150impl<O: IsA<AudioAggregatorPad>> AudioAggregatorPadExt for O {}