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