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 #[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
34mod sealed {
35 pub trait Sealed {}
36 impl<T: super::IsA<super::AudioAggregatorPad>> Sealed for T {}
37}
38
39pub trait AudioAggregatorPadExt: IsA<AudioAggregatorPad> + sealed::Sealed + 'static {
40 #[cfg(feature = "v1_20")]
41 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
42 #[doc(alias = "qos-messages")]
43 fn is_qos_messages(&self) -> bool {
44 ObjectExt::property(self.as_ref(), "qos-messages")
45 }
46
47 #[cfg(feature = "v1_20")]
48 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
49 #[doc(alias = "qos-messages")]
50 fn set_qos_messages(&self, qos_messages: bool) {
51 ObjectExt::set_property(self.as_ref(), "qos-messages", qos_messages)
52 }
53
54 #[cfg(feature = "v1_20")]
55 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
56 #[doc(alias = "qos-messages")]
57 fn connect_qos_messages_notify<F: Fn(&Self) + Send + Sync + 'static>(
58 &self,
59 f: F,
60 ) -> SignalHandlerId {
61 unsafe extern "C" fn notify_qos_messages_trampoline<
62 P: IsA<AudioAggregatorPad>,
63 F: Fn(&P) + Send + Sync + 'static,
64 >(
65 this: *mut ffi::GstAudioAggregatorPad,
66 _param_spec: glib::ffi::gpointer,
67 f: glib::ffi::gpointer,
68 ) {
69 let f: &F = &*(f as *const F);
70 f(AudioAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
71 }
72 unsafe {
73 let f: Box_<F> = Box_::new(f);
74 connect_raw(
75 self.as_ptr() as *mut _,
76 b"notify::qos-messages\0".as_ptr() as *const _,
77 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
78 notify_qos_messages_trampoline::<Self, F> as *const (),
79 )),
80 Box_::into_raw(f),
81 )
82 }
83 }
84}
85
86impl<O: IsA<AudioAggregatorPad>> AudioAggregatorPadExt for O {}
87