gstreamer_audio/auto/
audio_aggregator_pad.rs1use 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 #[doc(alias = "GstAudioAggregatorPad")]
20 pub struct AudioAggregatorPad(Object<ffi::GstAudioAggregatorPad, ffi::GstAudioAggregatorPadClass>) @extends gst_base::AggregatorPad, gst::Object;
21
22 match fn {
23 type_ => || ffi::gst_audio_aggregator_pad_get_type(),
24 }
25}
26
27impl AudioAggregatorPad {
28 pub const NONE: Option<&'static AudioAggregatorPad> = None;
29}
30
31unsafe impl Send for AudioAggregatorPad {}
32unsafe impl Sync for AudioAggregatorPad {}
33
34pub trait AudioAggregatorPadExt: IsA<AudioAggregatorPad> + 'static {
35 #[cfg(feature = "v1_20")]
36 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
37 #[doc(alias = "qos-messages")]
38 fn is_qos_messages(&self) -> bool {
39 ObjectExt::property(self.as_ref(), "qos-messages")
40 }
41
42 #[cfg(feature = "v1_20")]
43 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
44 #[doc(alias = "qos-messages")]
45 fn set_qos_messages(&self, qos_messages: bool) {
46 ObjectExt::set_property(self.as_ref(), "qos-messages", qos_messages)
47 }
48
49 #[cfg(feature = "v1_20")]
50 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
51 #[doc(alias = "qos-messages")]
52 fn connect_qos_messages_notify<F: Fn(&Self) + Send + Sync + 'static>(
53 &self,
54 f: F,
55 ) -> SignalHandlerId {
56 unsafe extern "C" fn notify_qos_messages_trampoline<
57 P: IsA<AudioAggregatorPad>,
58 F: Fn(&P) + Send + Sync + 'static,
59 >(
60 this: *mut ffi::GstAudioAggregatorPad,
61 _param_spec: glib::ffi::gpointer,
62 f: glib::ffi::gpointer,
63 ) {
64 let f: &F = &*(f as *const F);
65 f(AudioAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
66 }
67 unsafe {
68 let f: Box_<F> = Box_::new(f);
69 connect_raw(
70 self.as_ptr() as *mut _,
71 c"notify::qos-messages".as_ptr() as *const _,
72 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
73 notify_qos_messages_trampoline::<Self, F> as *const (),
74 )),
75 Box_::into_raw(f),
76 )
77 }
78 }
79}
80
81impl<O: IsA<AudioAggregatorPad>> AudioAggregatorPadExt for O {}