gstreamer-rs/gstreamer-audio/src/auto/audio_base_src.rs

277 lines
9.1 KiB
Rust
Raw Normal View History

// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::{boxed::Box as Box_, mem::transmute};
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstAudioBaseSrc")]
2020-11-21 18:17:37 +00:00
pub struct AudioBaseSrc(Object<ffi::GstAudioBaseSrc, ffi::GstAudioBaseSrcClass>) @extends gst_base::BaseSrc, gst::Element, gst::Object;
match fn {
type_ => || ffi::gst_audio_base_src_get_type(),
}
}
2021-11-03 17:28:46 +00:00
impl AudioBaseSrc {
pub const NONE: Option<&'static AudioBaseSrc> = None;
}
2021-11-16 14:02:58 +00:00
unsafe impl Send for AudioBaseSrc {}
unsafe impl Sync for AudioBaseSrc {}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::AudioBaseSrc>> Sealed for T {}
}
pub trait AudioBaseSrcExt: IsA<AudioBaseSrc> + sealed::Sealed + 'static {
//#[doc(alias = "gst_audio_base_src_create_ringbuffer")]
//fn create_ringbuffer(&self) -> /*Ignored*/Option<AudioRingBuffer> {
2020-11-21 18:17:37 +00:00
// unsafe { TODO: call ffi:gst_audio_base_src_create_ringbuffer() }
//}
#[doc(alias = "gst_audio_base_src_get_provide_clock")]
#[doc(alias = "get_provide_clock")]
2021-04-11 19:38:18 +00:00
fn is_provide_clock(&self) -> bool {
unsafe {
2020-11-21 18:17:37 +00:00
from_glib(ffi::gst_audio_base_src_get_provide_clock(
self.as_ref().to_glib_none().0,
))
}
}
//#[doc(alias = "gst_audio_base_src_get_slave_method")]
//#[doc(alias = "get_slave_method")]
2021-04-11 19:38:18 +00:00
//fn slave_method(&self) -> /*Ignored*/AudioBaseSrcSlaveMethod {
2020-11-21 18:17:37 +00:00
// unsafe { TODO: call ffi:gst_audio_base_src_get_slave_method() }
//}
#[doc(alias = "gst_audio_base_src_set_provide_clock")]
fn set_provide_clock(&self, provide: bool) {
unsafe {
2020-11-21 18:17:37 +00:00
ffi::gst_audio_base_src_set_provide_clock(
self.as_ref().to_glib_none().0,
provide.into_glib(),
);
}
}
//#[doc(alias = "gst_audio_base_src_set_slave_method")]
//fn set_slave_method(&self, method: /*Ignored*/AudioBaseSrcSlaveMethod) {
2020-11-21 18:17:37 +00:00
// unsafe { TODO: call ffi:gst_audio_base_src_set_slave_method() }
//}
#[doc(alias = "actual-buffer-time")]
2021-04-11 19:38:18 +00:00
fn actual_buffer_time(&self) -> i64 {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::property(self.as_ref(), "actual-buffer-time")
}
#[doc(alias = "actual-latency-time")]
2021-04-11 19:38:18 +00:00
fn actual_latency_time(&self) -> i64 {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::property(self.as_ref(), "actual-latency-time")
}
#[doc(alias = "buffer-time")]
2021-04-11 19:38:18 +00:00
fn buffer_time(&self) -> i64 {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::property(self.as_ref(), "buffer-time")
}
#[doc(alias = "buffer-time")]
2021-04-11 19:38:18 +00:00
fn set_buffer_time(&self, buffer_time: i64) {
glib::ObjectExt::set_property(self.as_ref(), "buffer-time", buffer_time)
}
#[doc(alias = "latency-time")]
2021-04-11 19:38:18 +00:00
fn latency_time(&self) -> i64 {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::property(self.as_ref(), "latency-time")
}
#[doc(alias = "latency-time")]
2021-04-11 19:38:18 +00:00
fn set_latency_time(&self, latency_time: i64) {
glib::ObjectExt::set_property(self.as_ref(), "latency-time", latency_time)
}
#[doc(alias = "actual-buffer-time")]
fn connect_actual_buffer_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_actual_buffer_time_trampoline<
P: IsA<AudioBaseSrc>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 18:17:37 +00:00
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::actual-buffer-time\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_actual_buffer_time_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "actual-latency-time")]
fn connect_actual_latency_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_actual_latency_time_trampoline<
P: IsA<AudioBaseSrc>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 18:17:37 +00:00
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::actual-latency-time\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_actual_latency_time_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "buffer-time")]
fn connect_buffer_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_buffer_time_trampoline<
P: IsA<AudioBaseSrc>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 18:17:37 +00:00
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::buffer-time\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_buffer_time_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "latency-time")]
fn connect_latency_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_latency_time_trampoline<
P: IsA<AudioBaseSrc>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 18:17:37 +00:00
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::latency-time\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_latency_time_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "provide-clock")]
fn connect_provide_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_provide_clock_trampoline<
P: IsA<AudioBaseSrc>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 18:17:37 +00:00
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::provide-clock\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_provide_clock_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "slave-method")]
fn connect_slave_method_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_slave_method_trampoline<
P: IsA<AudioBaseSrc>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-21 18:17:37 +00:00
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(AudioBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::slave-method\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_slave_method_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {}