gstreamer_audio/auto/
audio_aggregator_convert_pad.rs1use crate::{AudioAggregatorPad, ffi};
7use glib::{
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 #[doc(alias = "GstAudioAggregatorConvertPad")]
16 pub struct AudioAggregatorConvertPad(Object<ffi::GstAudioAggregatorConvertPad, ffi::GstAudioAggregatorConvertPadClass>) @extends AudioAggregatorPad, gst_base::AggregatorPad, gst::Object;
17
18 match fn {
19 type_ => || ffi::gst_audio_aggregator_convert_pad_get_type(),
20 }
21}
22
23impl AudioAggregatorConvertPad {
24 pub const NONE: Option<&'static AudioAggregatorConvertPad> = None;
25}
26
27unsafe impl Send for AudioAggregatorConvertPad {}
28unsafe impl Sync for AudioAggregatorConvertPad {}
29
30pub trait AudioAggregatorConvertPadExt: IsA<AudioAggregatorConvertPad> + 'static {
31 #[doc(alias = "converter-config")]
42 fn connect_converter_config_notify<F: Fn(&Self) + Send + Sync + 'static>(
43 &self,
44 f: F,
45 ) -> SignalHandlerId {
46 unsafe extern "C" fn notify_converter_config_trampoline<
47 P: IsA<AudioAggregatorConvertPad>,
48 F: Fn(&P) + Send + Sync + 'static,
49 >(
50 this: *mut ffi::GstAudioAggregatorConvertPad,
51 _param_spec: glib::ffi::gpointer,
52 f: glib::ffi::gpointer,
53 ) {
54 unsafe {
55 let f: &F = &*(f as *const F);
56 f(AudioAggregatorConvertPad::from_glib_borrow(this).unsafe_cast_ref())
57 }
58 }
59 unsafe {
60 let f: Box_<F> = Box_::new(f);
61 connect_raw(
62 self.as_ptr() as *mut _,
63 c"notify::converter-config".as_ptr(),
64 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
65 notify_converter_config_trampoline::<Self, F> as *const (),
66 )),
67 Box_::into_raw(f),
68 )
69 }
70 }
71}
72
73impl<O: IsA<AudioAggregatorConvertPad>> AudioAggregatorConvertPadExt for O {}