gstreamer_audio/auto/
audio_aggregator_convert_pad.rs1use crate::{ffi, AudioAggregatorPad};
7use glib::{
8 prelude::*,
9 signal::{connect_raw, SignalHandlerId},
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 let f: &F = &*(f as *const F);
55 f(AudioAggregatorConvertPad::from_glib_borrow(this).unsafe_cast_ref())
56 }
57 unsafe {
58 let f: Box_<F> = Box_::new(f);
59 connect_raw(
60 self.as_ptr() as *mut _,
61 c"notify::converter-config".as_ptr() as *const _,
62 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
63 notify_converter_config_trampoline::<Self, F> as *const (),
64 )),
65 Box_::into_raw(f),
66 )
67 }
68 }
69}
70
71impl<O: IsA<AudioAggregatorConvertPad>> AudioAggregatorConvertPadExt for O {}