gstreamer-audio: Regenerate

This commit is contained in:
Sebastian Dröge 2020-11-21 20:17:37 +02:00
parent 5a70dd1756
commit 1e489ee1e2
11 changed files with 364 additions and 487 deletions

View file

@ -9,19 +9,14 @@ use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use gst_audio_sys;
use gst_base;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct AudioBaseSink(Object<gst_audio_sys::GstAudioBaseSink, gst_audio_sys::GstAudioBaseSinkClass>) @extends gst_base::BaseSink, gst::Element, gst::Object;
glib::glib_wrapper! {
pub struct AudioBaseSink(Object<ffi::GstAudioBaseSink, ffi::GstAudioBaseSinkClass>) @extends gst_base::BaseSink, gst::Element, gst::Object;
match fn {
get_type => || gst_audio_sys::gst_audio_base_sink_get_type(),
get_type => || ffi::gst_audio_base_sink_get_type(),
}
}
@ -112,12 +107,12 @@ pub trait AudioBaseSinkExt: 'static {
impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
//fn create_ringbuffer(&self) -> /*Ignored*/Option<AudioRingBuffer> {
// unsafe { TODO: call gst_audio_sys:gst_audio_base_sink_create_ringbuffer() }
// unsafe { TODO: call ffi:gst_audio_base_sink_create_ringbuffer() }
//}
fn get_alignment_threshold(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_audio_sys::gst_audio_base_sink_get_alignment_threshold(
from_glib(ffi::gst_audio_base_sink_get_alignment_threshold(
self.as_ref().to_glib_none().0,
))
}
@ -125,41 +120,37 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
fn get_discont_wait(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_audio_sys::gst_audio_base_sink_get_discont_wait(
from_glib(ffi::gst_audio_base_sink_get_discont_wait(
self.as_ref().to_glib_none().0,
))
}
}
fn get_drift_tolerance(&self) -> i64 {
unsafe {
gst_audio_sys::gst_audio_base_sink_get_drift_tolerance(self.as_ref().to_glib_none().0)
}
unsafe { ffi::gst_audio_base_sink_get_drift_tolerance(self.as_ref().to_glib_none().0) }
}
fn get_provide_clock(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_base_sink_get_provide_clock(
from_glib(ffi::gst_audio_base_sink_get_provide_clock(
self.as_ref().to_glib_none().0,
))
}
}
//fn get_slave_method(&self) -> /*Ignored*/AudioBaseSinkSlaveMethod {
// unsafe { TODO: call gst_audio_sys:gst_audio_base_sink_get_slave_method() }
// unsafe { TODO: call ffi:gst_audio_base_sink_get_slave_method() }
//}
fn report_device_failure(&self) {
unsafe {
gst_audio_sys::gst_audio_base_sink_report_device_failure(
self.as_ref().to_glib_none().0,
);
ffi::gst_audio_base_sink_report_device_failure(self.as_ref().to_glib_none().0);
}
}
fn set_alignment_threshold(&self, alignment_threshold: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_base_sink_set_alignment_threshold(
ffi::gst_audio_base_sink_set_alignment_threshold(
self.as_ref().to_glib_none().0,
alignment_threshold.to_glib(),
);
@ -167,12 +158,12 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
}
//fn set_custom_slaving_callback(&self, callback: /*Unimplemented*/Fn(&AudioBaseSink, gst::ClockTime, gst::ClockTime, /*Ignored*/gst::ClockTimeDiff, /*Ignored*/AudioBaseSinkDiscontReason), user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call gst_audio_sys:gst_audio_base_sink_set_custom_slaving_callback() }
// unsafe { TODO: call ffi:gst_audio_base_sink_set_custom_slaving_callback() }
//}
fn set_discont_wait(&self, discont_wait: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_base_sink_set_discont_wait(
ffi::gst_audio_base_sink_set_discont_wait(
self.as_ref().to_glib_none().0,
discont_wait.to_glib(),
);
@ -181,7 +172,7 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
fn set_drift_tolerance(&self, drift_tolerance: i64) {
unsafe {
gst_audio_sys::gst_audio_base_sink_set_drift_tolerance(
ffi::gst_audio_base_sink_set_drift_tolerance(
self.as_ref().to_glib_none().0,
drift_tolerance,
);
@ -190,7 +181,7 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
fn set_provide_clock(&self, provide: bool) {
unsafe {
gst_audio_sys::gst_audio_base_sink_set_provide_clock(
ffi::gst_audio_base_sink_set_provide_clock(
self.as_ref().to_glib_none().0,
provide.to_glib(),
);
@ -198,14 +189,14 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
}
//fn set_slave_method(&self, method: /*Ignored*/AudioBaseSinkSlaveMethod) {
// unsafe { TODO: call gst_audio_sys:gst_audio_base_sink_set_slave_method() }
// unsafe { TODO: call ffi:gst_audio_base_sink_set_slave_method() }
//}
fn get_property_buffer_time(&self) -> i64 {
unsafe {
let mut value = Value::from_type(<i64 as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"buffer-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -218,8 +209,8 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
fn set_property_buffer_time(&self, buffer_time: i64) {
unsafe {
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"buffer-time\0".as_ptr() as *const _,
Value::from(&buffer_time).to_glib_none().0,
);
@ -229,8 +220,8 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
fn get_property_can_activate_pull(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"can-activate-pull\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -243,8 +234,8 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
fn set_property_can_activate_pull(&self, can_activate_pull: bool) {
unsafe {
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"can-activate-pull\0".as_ptr() as *const _,
Value::from(&can_activate_pull).to_glib_none().0,
);
@ -254,8 +245,8 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
fn get_property_latency_time(&self) -> i64 {
unsafe {
let mut value = Value::from_type(<i64 as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"latency-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -268,8 +259,8 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
fn set_property_latency_time(&self, latency_time: i64) {
unsafe {
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"latency-time\0".as_ptr() as *const _,
Value::from(&latency_time).to_glib_none().0,
);
@ -284,9 +275,9 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
P,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut gst_audio_sys::GstAudioBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSink>,
{
@ -311,9 +302,9 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_buffer_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSink>,
{
@ -341,9 +332,9 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
P,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut gst_audio_sys::GstAudioBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSink>,
{
@ -368,9 +359,9 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_discont_wait_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSink>,
{
@ -398,9 +389,9 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
P,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut gst_audio_sys::GstAudioBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSink>,
{
@ -425,9 +416,9 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_latency_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSink>,
{
@ -452,9 +443,9 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_provide_clock_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSink>,
{
@ -479,9 +470,9 @@ impl<O: IsA<AudioBaseSink>> AudioBaseSinkExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_slave_method_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSink>,
{

View file

@ -9,19 +9,14 @@ use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use gst_audio_sys;
use gst_base;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct AudioBaseSrc(Object<gst_audio_sys::GstAudioBaseSrc, gst_audio_sys::GstAudioBaseSrcClass>) @extends gst_base::BaseSrc, gst::Element, gst::Object;
glib::glib_wrapper! {
pub struct AudioBaseSrc(Object<ffi::GstAudioBaseSrc, ffi::GstAudioBaseSrcClass>) @extends gst_base::BaseSrc, gst::Element, gst::Object;
match fn {
get_type => || gst_audio_sys::gst_audio_base_src_get_type(),
get_type => || ffi::gst_audio_base_src_get_type(),
}
}
@ -86,24 +81,24 @@ pub trait AudioBaseSrcExt: 'static {
impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
//fn create_ringbuffer(&self) -> /*Ignored*/Option<AudioRingBuffer> {
// unsafe { TODO: call gst_audio_sys:gst_audio_base_src_create_ringbuffer() }
// unsafe { TODO: call ffi:gst_audio_base_src_create_ringbuffer() }
//}
fn get_provide_clock(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_base_src_get_provide_clock(
from_glib(ffi::gst_audio_base_src_get_provide_clock(
self.as_ref().to_glib_none().0,
))
}
}
//fn get_slave_method(&self) -> /*Ignored*/AudioBaseSrcSlaveMethod {
// unsafe { TODO: call gst_audio_sys:gst_audio_base_src_get_slave_method() }
// unsafe { TODO: call ffi:gst_audio_base_src_get_slave_method() }
//}
fn set_provide_clock(&self, provide: bool) {
unsafe {
gst_audio_sys::gst_audio_base_src_set_provide_clock(
ffi::gst_audio_base_src_set_provide_clock(
self.as_ref().to_glib_none().0,
provide.to_glib(),
);
@ -111,14 +106,14 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
}
//fn set_slave_method(&self, method: /*Ignored*/AudioBaseSrcSlaveMethod) {
// unsafe { TODO: call gst_audio_sys:gst_audio_base_src_set_slave_method() }
// unsafe { TODO: call ffi:gst_audio_base_src_set_slave_method() }
//}
fn get_property_actual_buffer_time(&self) -> i64 {
unsafe {
let mut value = Value::from_type(<i64 as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"actual-buffer-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -132,8 +127,8 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
fn get_property_actual_latency_time(&self) -> i64 {
unsafe {
let mut value = Value::from_type(<i64 as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"actual-latency-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -147,8 +142,8 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
fn get_property_buffer_time(&self) -> i64 {
unsafe {
let mut value = Value::from_type(<i64 as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"buffer-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -161,8 +156,8 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
fn set_property_buffer_time(&self, buffer_time: i64) {
unsafe {
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"buffer-time\0".as_ptr() as *const _,
Value::from(&buffer_time).to_glib_none().0,
);
@ -172,8 +167,8 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
fn get_property_latency_time(&self) -> i64 {
unsafe {
let mut value = Value::from_type(<i64 as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"latency-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -186,8 +181,8 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
fn set_property_latency_time(&self, latency_time: i64) {
unsafe {
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"latency-time\0".as_ptr() as *const _,
Value::from(&latency_time).to_glib_none().0,
);
@ -202,9 +197,9 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
P,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut gst_audio_sys::GstAudioBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSrc>,
{
@ -232,9 +227,9 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
P,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut gst_audio_sys::GstAudioBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSrc>,
{
@ -259,9 +254,9 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_buffer_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSrc>,
{
@ -286,9 +281,9 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_latency_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSrc>,
{
@ -313,9 +308,9 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_provide_clock_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSrc>,
{
@ -340,9 +335,9 @@ impl<O: IsA<AudioBaseSrc>> AudioBaseSrcExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_slave_method_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioBaseSrc,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioBaseSrc>,
{

View file

@ -2,25 +2,21 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::AudioInfo;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib_sys;
use gst;
use gst_audio_sys;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
use AudioInfo;
glib_wrapper! {
pub struct AudioDecoder(Object<gst_audio_sys::GstAudioDecoder, gst_audio_sys::GstAudioDecoderClass>) @extends gst::Element, gst::Object;
glib::glib_wrapper! {
pub struct AudioDecoder(Object<ffi::GstAudioDecoder, ffi::GstAudioDecoderClass>) @extends gst::Element, gst::Object;
match fn {
get_type => || gst_audio_sys::gst_audio_decoder_get_type(),
get_type => || ffi::gst_audio_decoder_get_type(),
}
}
@ -110,45 +106,43 @@ pub trait AudioDecoderExt: 'static {
impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn allocate_output_buffer(&self, size: usize) -> Result<gst::Buffer, glib::BoolError> {
unsafe {
Option::<_>::from_glib_full(gst_audio_sys::gst_audio_decoder_allocate_output_buffer(
Option::<_>::from_glib_full(ffi::gst_audio_decoder_allocate_output_buffer(
self.as_ref().to_glib_none().0,
size,
))
.ok_or_else(|| glib_bool_error!("Failed to allocate output buffer"))
.ok_or_else(|| glib::glib_bool_error!("Failed to allocate output buffer"))
}
}
fn get_audio_info(&self) -> Option<AudioInfo> {
unsafe {
from_glib_full(gst_audio_sys::gst_audio_decoder_get_audio_info(
from_glib_full(ffi::gst_audio_decoder_get_audio_info(
self.as_ref().to_glib_none().0,
))
}
}
fn get_delay(&self) -> i32 {
unsafe { gst_audio_sys::gst_audio_decoder_get_delay(self.as_ref().to_glib_none().0) }
unsafe { ffi::gst_audio_decoder_get_delay(self.as_ref().to_glib_none().0) }
}
fn get_drainable(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_decoder_get_drainable(
from_glib(ffi::gst_audio_decoder_get_drainable(
self.as_ref().to_glib_none().0,
))
}
}
fn get_estimate_rate(&self) -> i32 {
unsafe {
gst_audio_sys::gst_audio_decoder_get_estimate_rate(self.as_ref().to_glib_none().0)
}
unsafe { ffi::gst_audio_decoder_get_estimate_rate(self.as_ref().to_glib_none().0) }
}
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime) {
unsafe {
let mut min = mem::MaybeUninit::uninit();
let mut max = mem::MaybeUninit::uninit();
gst_audio_sys::gst_audio_decoder_get_latency(
ffi::gst_audio_decoder_get_latency(
self.as_ref().to_glib_none().0,
min.as_mut_ptr(),
max.as_mut_ptr(),
@ -160,12 +154,12 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
}
fn get_max_errors(&self) -> i32 {
unsafe { gst_audio_sys::gst_audio_decoder_get_max_errors(self.as_ref().to_glib_none().0) }
unsafe { ffi::gst_audio_decoder_get_max_errors(self.as_ref().to_glib_none().0) }
}
fn get_min_latency(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_audio_sys::gst_audio_decoder_get_min_latency(
from_glib(ffi::gst_audio_decoder_get_min_latency(
self.as_ref().to_glib_none().0,
))
}
@ -173,7 +167,7 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn get_needs_format(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_decoder_get_needs_format(
from_glib(ffi::gst_audio_decoder_get_needs_format(
self.as_ref().to_glib_none().0,
))
}
@ -183,7 +177,7 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
unsafe {
let mut sync = mem::MaybeUninit::uninit();
let mut eos = mem::MaybeUninit::uninit();
gst_audio_sys::gst_audio_decoder_get_parse_state(
ffi::gst_audio_decoder_get_parse_state(
self.as_ref().to_glib_none().0,
sync.as_mut_ptr(),
eos.as_mut_ptr(),
@ -196,19 +190,19 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn get_plc(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_decoder_get_plc(
from_glib(ffi::gst_audio_decoder_get_plc(
self.as_ref().to_glib_none().0,
))
}
}
fn get_plc_aware(&self) -> i32 {
unsafe { gst_audio_sys::gst_audio_decoder_get_plc_aware(self.as_ref().to_glib_none().0) }
unsafe { ffi::gst_audio_decoder_get_plc_aware(self.as_ref().to_glib_none().0) }
}
fn get_tolerance(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_audio_sys::gst_audio_decoder_get_tolerance(
from_glib(ffi::gst_audio_decoder_get_tolerance(
self.as_ref().to_glib_none().0,
))
}
@ -216,7 +210,7 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode) {
unsafe {
gst_audio_sys::gst_audio_decoder_merge_tags(
ffi::gst_audio_decoder_merge_tags(
self.as_ref().to_glib_none().0,
tags.to_glib_none().0,
mode.to_glib(),
@ -226,7 +220,7 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe {
from_glib_full(gst_audio_sys::gst_audio_decoder_proxy_getcaps(
from_glib_full(ffi::gst_audio_decoder_proxy_getcaps(
self.as_ref().to_glib_none().0,
caps.to_glib_none().0,
filter.to_glib_none().0,
@ -238,7 +232,7 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
fn set_allocation_caps(&self, allocation_caps: Option<&gst::Caps>) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_allocation_caps(
ffi::gst_audio_decoder_set_allocation_caps(
self.as_ref().to_glib_none().0,
allocation_caps.to_glib_none().0,
);
@ -247,16 +241,13 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn set_drainable(&self, enabled: bool) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_drainable(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
ffi::gst_audio_decoder_set_drainable(self.as_ref().to_glib_none().0, enabled.to_glib());
}
}
fn set_estimate_rate(&self, enabled: bool) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_estimate_rate(
ffi::gst_audio_decoder_set_estimate_rate(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
@ -265,7 +256,7 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn set_latency(&self, min: gst::ClockTime, max: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_latency(
ffi::gst_audio_decoder_set_latency(
self.as_ref().to_glib_none().0,
min.to_glib(),
max.to_glib(),
@ -275,22 +266,19 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn set_max_errors(&self, num: i32) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_max_errors(self.as_ref().to_glib_none().0, num);
ffi::gst_audio_decoder_set_max_errors(self.as_ref().to_glib_none().0, num);
}
}
fn set_min_latency(&self, num: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_min_latency(
self.as_ref().to_glib_none().0,
num.to_glib(),
);
ffi::gst_audio_decoder_set_min_latency(self.as_ref().to_glib_none().0, num.to_glib());
}
}
fn set_needs_format(&self, enabled: bool) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_needs_format(
ffi::gst_audio_decoder_set_needs_format(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
@ -299,25 +287,19 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn set_plc(&self, enabled: bool) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_plc(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
ffi::gst_audio_decoder_set_plc(self.as_ref().to_glib_none().0, enabled.to_glib());
}
}
fn set_plc_aware(&self, plc: bool) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_plc_aware(
self.as_ref().to_glib_none().0,
plc.to_glib(),
);
ffi::gst_audio_decoder_set_plc_aware(self.as_ref().to_glib_none().0, plc.to_glib());
}
}
fn set_tolerance(&self, tolerance: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_tolerance(
ffi::gst_audio_decoder_set_tolerance(
self.as_ref().to_glib_none().0,
tolerance.to_glib(),
);
@ -326,7 +308,7 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
fn set_use_default_pad_acceptcaps(&self, use_: bool) {
unsafe {
gst_audio_sys::gst_audio_decoder_set_use_default_pad_acceptcaps(
ffi::gst_audio_decoder_set_use_default_pad_acceptcaps(
self.as_ref().to_glib_none().0,
use_.to_glib(),
);
@ -340,9 +322,9 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_errors_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioDecoder,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioDecoder>,
{
@ -367,9 +349,9 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_min_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioDecoder,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioDecoder>,
{
@ -394,9 +376,9 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_plc_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioDecoder,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioDecoder>,
{
@ -421,9 +403,9 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_tolerance_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioDecoder,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioDecoder>,
{

View file

@ -2,24 +2,20 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::AudioInfo;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib_sys;
use gst;
use gst_audio_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use AudioInfo;
glib_wrapper! {
pub struct AudioEncoder(Object<gst_audio_sys::GstAudioEncoder, gst_audio_sys::GstAudioEncoderClass>) @extends gst::Element, gst::Object;
glib::glib_wrapper! {
pub struct AudioEncoder(Object<ffi::GstAudioEncoder, ffi::GstAudioEncoderClass>) @extends gst::Element, gst::Object;
match fn {
get_type => || gst_audio_sys::gst_audio_encoder_get_type(),
get_type => || ffi::gst_audio_encoder_get_type(),
}
}
@ -109,17 +105,17 @@ pub trait AudioEncoderExt: 'static {
impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn allocate_output_buffer(&self, size: usize) -> Result<gst::Buffer, glib::BoolError> {
unsafe {
Option::<_>::from_glib_full(gst_audio_sys::gst_audio_encoder_allocate_output_buffer(
Option::<_>::from_glib_full(ffi::gst_audio_encoder_allocate_output_buffer(
self.as_ref().to_glib_none().0,
size,
))
.ok_or_else(|| glib_bool_error!("Failed to allocate output buffer"))
.ok_or_else(|| glib::glib_bool_error!("Failed to allocate output buffer"))
}
}
fn get_audio_info(&self) -> Option<AudioInfo> {
unsafe {
from_glib_full(gst_audio_sys::gst_audio_encoder_get_audio_info(
from_glib_full(ffi::gst_audio_encoder_get_audio_info(
self.as_ref().to_glib_none().0,
))
}
@ -127,31 +123,27 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn get_drainable(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_encoder_get_drainable(
from_glib(ffi::gst_audio_encoder_get_drainable(
self.as_ref().to_glib_none().0,
))
}
}
fn get_frame_max(&self) -> i32 {
unsafe { gst_audio_sys::gst_audio_encoder_get_frame_max(self.as_ref().to_glib_none().0) }
unsafe { ffi::gst_audio_encoder_get_frame_max(self.as_ref().to_glib_none().0) }
}
fn get_frame_samples_max(&self) -> i32 {
unsafe {
gst_audio_sys::gst_audio_encoder_get_frame_samples_max(self.as_ref().to_glib_none().0)
}
unsafe { ffi::gst_audio_encoder_get_frame_samples_max(self.as_ref().to_glib_none().0) }
}
fn get_frame_samples_min(&self) -> i32 {
unsafe {
gst_audio_sys::gst_audio_encoder_get_frame_samples_min(self.as_ref().to_glib_none().0)
}
unsafe { ffi::gst_audio_encoder_get_frame_samples_min(self.as_ref().to_glib_none().0) }
}
fn get_hard_min(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_encoder_get_hard_min(
from_glib(ffi::gst_audio_encoder_get_hard_min(
self.as_ref().to_glib_none().0,
))
}
@ -159,19 +151,19 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn get_hard_resync(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_encoder_get_hard_resync(
from_glib(ffi::gst_audio_encoder_get_hard_resync(
self.as_ref().to_glib_none().0,
))
}
}
fn get_lookahead(&self) -> i32 {
unsafe { gst_audio_sys::gst_audio_encoder_get_lookahead(self.as_ref().to_glib_none().0) }
unsafe { ffi::gst_audio_encoder_get_lookahead(self.as_ref().to_glib_none().0) }
}
fn get_mark_granule(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_encoder_get_mark_granule(
from_glib(ffi::gst_audio_encoder_get_mark_granule(
self.as_ref().to_glib_none().0,
))
}
@ -179,7 +171,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn get_perfect_timestamp(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_audio_encoder_get_perfect_timestamp(
from_glib(ffi::gst_audio_encoder_get_perfect_timestamp(
self.as_ref().to_glib_none().0,
))
}
@ -187,7 +179,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn get_tolerance(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_audio_sys::gst_audio_encoder_get_tolerance(
from_glib(ffi::gst_audio_encoder_get_tolerance(
self.as_ref().to_glib_none().0,
))
}
@ -195,7 +187,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode) {
unsafe {
gst_audio_sys::gst_audio_encoder_merge_tags(
ffi::gst_audio_encoder_merge_tags(
self.as_ref().to_glib_none().0,
tags.to_glib_none().0,
mode.to_glib(),
@ -205,7 +197,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe {
from_glib_full(gst_audio_sys::gst_audio_encoder_proxy_getcaps(
from_glib_full(ffi::gst_audio_encoder_proxy_getcaps(
self.as_ref().to_glib_none().0,
caps.to_glib_none().0,
filter.to_glib_none().0,
@ -217,7 +209,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
fn set_allocation_caps(&self, allocation_caps: Option<&gst::Caps>) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_allocation_caps(
ffi::gst_audio_encoder_set_allocation_caps(
self.as_ref().to_glib_none().0,
allocation_caps.to_glib_none().0,
);
@ -226,49 +218,37 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn set_drainable(&self, enabled: bool) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_drainable(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
ffi::gst_audio_encoder_set_drainable(self.as_ref().to_glib_none().0, enabled.to_glib());
}
}
fn set_frame_max(&self, num: i32) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_frame_max(self.as_ref().to_glib_none().0, num);
ffi::gst_audio_encoder_set_frame_max(self.as_ref().to_glib_none().0, num);
}
}
fn set_frame_samples_max(&self, num: i32) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_frame_samples_max(
self.as_ref().to_glib_none().0,
num,
);
ffi::gst_audio_encoder_set_frame_samples_max(self.as_ref().to_glib_none().0, num);
}
}
fn set_frame_samples_min(&self, num: i32) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_frame_samples_min(
self.as_ref().to_glib_none().0,
num,
);
ffi::gst_audio_encoder_set_frame_samples_min(self.as_ref().to_glib_none().0, num);
}
}
fn set_hard_min(&self, enabled: bool) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_hard_min(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
ffi::gst_audio_encoder_set_hard_min(self.as_ref().to_glib_none().0, enabled.to_glib());
}
}
fn set_hard_resync(&self, enabled: bool) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_hard_resync(
ffi::gst_audio_encoder_set_hard_resync(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
@ -277,7 +257,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn set_headers(&self, headers: &[&gst::Buffer]) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_headers(
ffi::gst_audio_encoder_set_headers(
self.as_ref().to_glib_none().0,
headers.to_glib_full(),
);
@ -286,7 +266,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn set_latency(&self, min: gst::ClockTime, max: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_latency(
ffi::gst_audio_encoder_set_latency(
self.as_ref().to_glib_none().0,
min.to_glib(),
max.to_glib(),
@ -296,13 +276,13 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn set_lookahead(&self, num: i32) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_lookahead(self.as_ref().to_glib_none().0, num);
ffi::gst_audio_encoder_set_lookahead(self.as_ref().to_glib_none().0, num);
}
}
fn set_mark_granule(&self, enabled: bool) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_mark_granule(
ffi::gst_audio_encoder_set_mark_granule(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
@ -311,7 +291,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn set_perfect_timestamp(&self, enabled: bool) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_perfect_timestamp(
ffi::gst_audio_encoder_set_perfect_timestamp(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
@ -320,7 +300,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
fn set_tolerance(&self, tolerance: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_encoder_set_tolerance(
ffi::gst_audio_encoder_set_tolerance(
self.as_ref().to_glib_none().0,
tolerance.to_glib(),
);
@ -332,9 +312,9 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_hard_resync_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioEncoder,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioEncoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioEncoder>,
{
@ -359,9 +339,9 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_mark_granule_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioEncoder,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioEncoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioEncoder>,
{
@ -389,9 +369,9 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
P,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut gst_audio_sys::GstAudioEncoder,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioEncoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioEncoder>,
{
@ -416,9 +396,9 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_tolerance_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstAudioEncoder,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstAudioEncoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<AudioEncoder>,
{

View file

@ -2,17 +2,14 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::AudioBaseSink;
use glib::translate::*;
use gst;
use gst_audio_sys;
use gst_base;
use AudioBaseSink;
glib_wrapper! {
pub struct AudioSink(Object<gst_audio_sys::GstAudioSink, gst_audio_sys::GstAudioSinkClass>) @extends AudioBaseSink, gst_base::BaseSink, gst::Element, gst::Object;
glib::glib_wrapper! {
pub struct AudioSink(Object<ffi::GstAudioSink, ffi::GstAudioSinkClass>) @extends AudioBaseSink, gst_base::BaseSink, gst::Element, gst::Object;
match fn {
get_type => || gst_audio_sys::gst_audio_sink_get_type(),
get_type => || ffi::gst_audio_sink_get_type(),
}
}

View file

@ -2,17 +2,14 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::AudioBaseSrc;
use glib::translate::*;
use gst;
use gst_audio_sys;
use gst_base;
use AudioBaseSrc;
glib_wrapper! {
pub struct AudioSrc(Object<gst_audio_sys::GstAudioSrc, gst_audio_sys::GstAudioSrcClass>) @extends AudioBaseSrc, gst_base::BaseSrc, gst::Element, gst::Object;
glib::glib_wrapper! {
pub struct AudioSrc(Object<ffi::GstAudioSrc, ffi::GstAudioSrcClass>) @extends AudioBaseSrc, gst_base::BaseSrc, gst::Element, gst::Object;
match fn {
get_type => || gst_audio_sys::gst_audio_src_get_type(),
get_type => || ffi::gst_audio_src_get_type(),
}
}

View file

@ -5,19 +5,15 @@
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
use glib::translate::*;
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
use gst;
use gst_audio_sys;
glib_wrapper! {
glib::glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct AudioStreamAlign(Boxed<gst_audio_sys::GstAudioStreamAlign>);
pub struct AudioStreamAlign(Boxed<ffi::GstAudioStreamAlign>);
match fn {
copy => |ptr| gst_audio_sys::gst_audio_stream_align_copy(mut_override(ptr)),
free => |ptr| gst_audio_sys::gst_audio_stream_align_free(ptr),
get_type => || gst_audio_sys::gst_audio_stream_align_get_type(),
copy => |ptr| ffi::gst_audio_stream_align_copy(mut_override(ptr)),
free => |ptr| ffi::gst_audio_stream_align_free(ptr),
get_type => || ffi::gst_audio_stream_align_get_type(),
}
}
@ -31,7 +27,7 @@ impl AudioStreamAlign {
) -> AudioStreamAlign {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_audio_sys::gst_audio_stream_align_new(
from_glib_full(ffi::gst_audio_stream_align_new(
rate,
alignment_threshold.to_glib(),
discont_wait.to_glib(),
@ -43,19 +39,7 @@ impl AudioStreamAlign {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn get_alignment_threshold(&self) -> gst::ClockTime {
unsafe {
from_glib(
gst_audio_sys::gst_audio_stream_align_get_alignment_threshold(mut_override(
self.to_glib_none().0,
)),
)
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn get_discont_wait(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_audio_sys::gst_audio_stream_align_get_discont_wait(
from_glib(ffi::gst_audio_stream_align_get_alignment_threshold(
mut_override(self.to_glib_none().0),
))
}
@ -63,17 +47,25 @@ impl AudioStreamAlign {
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn get_rate(&self) -> i32 {
pub fn get_discont_wait(&self) -> gst::ClockTime {
unsafe {
gst_audio_sys::gst_audio_stream_align_get_rate(mut_override(self.to_glib_none().0))
from_glib(ffi::gst_audio_stream_align_get_discont_wait(mut_override(
self.to_glib_none().0,
)))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn get_rate(&self) -> i32 {
unsafe { ffi::gst_audio_stream_align_get_rate(mut_override(self.to_glib_none().0)) }
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn get_samples_since_discont(&self) -> u64 {
unsafe {
gst_audio_sys::gst_audio_stream_align_get_samples_since_discont(mut_override(
ffi::gst_audio_stream_align_get_samples_since_discont(mut_override(
self.to_glib_none().0,
))
}
@ -83,11 +75,9 @@ impl AudioStreamAlign {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn get_timestamp_at_discont(&self) -> gst::ClockTime {
unsafe {
from_glib(
gst_audio_sys::gst_audio_stream_align_get_timestamp_at_discont(mut_override(
self.to_glib_none().0,
)),
)
from_glib(ffi::gst_audio_stream_align_get_timestamp_at_discont(
mut_override(self.to_glib_none().0),
))
}
}
@ -95,7 +85,7 @@ impl AudioStreamAlign {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn mark_discont(&mut self) {
unsafe {
gst_audio_sys::gst_audio_stream_align_mark_discont(self.to_glib_none_mut().0);
ffi::gst_audio_stream_align_mark_discont(self.to_glib_none_mut().0);
}
}
@ -103,7 +93,7 @@ impl AudioStreamAlign {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn set_alignment_threshold(&mut self, alignment_threshold: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_stream_align_set_alignment_threshold(
ffi::gst_audio_stream_align_set_alignment_threshold(
self.to_glib_none_mut().0,
alignment_threshold.to_glib(),
);
@ -114,7 +104,7 @@ impl AudioStreamAlign {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn set_discont_wait(&mut self, discont_wait: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_stream_align_set_discont_wait(
ffi::gst_audio_stream_align_set_discont_wait(
self.to_glib_none_mut().0,
discont_wait.to_glib(),
);
@ -125,7 +115,7 @@ impl AudioStreamAlign {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub fn set_rate(&mut self, rate: i32) {
unsafe {
gst_audio_sys::gst_audio_stream_align_set_rate(self.to_glib_none_mut().0, rate);
ffi::gst_audio_stream_align_set_rate(self.to_glib_none_mut().0, rate);
}
}
}

View file

@ -9,8 +9,6 @@ use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_audio_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
@ -52,85 +50,61 @@ pub enum AudioChannelPosition {
#[doc(hidden)]
impl ToGlib for AudioChannelPosition {
type GlibType = gst_audio_sys::GstAudioChannelPosition;
type GlibType = ffi::GstAudioChannelPosition;
fn to_glib(&self) -> gst_audio_sys::GstAudioChannelPosition {
fn to_glib(&self) -> ffi::GstAudioChannelPosition {
match *self {
AudioChannelPosition::None => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_NONE,
AudioChannelPosition::Mono => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_MONO,
AudioChannelPosition::Invalid => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID,
AudioChannelPosition::FrontLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
AudioChannelPosition::FrontRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT
}
AudioChannelPosition::FrontCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER
}
AudioChannelPosition::Lfe1 => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_LFE1,
AudioChannelPosition::RearLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
AudioChannelPosition::RearRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
AudioChannelPosition::None => ffi::GST_AUDIO_CHANNEL_POSITION_NONE,
AudioChannelPosition::Mono => ffi::GST_AUDIO_CHANNEL_POSITION_MONO,
AudioChannelPosition::Invalid => ffi::GST_AUDIO_CHANNEL_POSITION_INVALID,
AudioChannelPosition::FrontLeft => ffi::GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
AudioChannelPosition::FrontRight => ffi::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
AudioChannelPosition::FrontCenter => ffi::GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
AudioChannelPosition::Lfe1 => ffi::GST_AUDIO_CHANNEL_POSITION_LFE1,
AudioChannelPosition::RearLeft => ffi::GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
AudioChannelPosition::RearRight => ffi::GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
AudioChannelPosition::FrontLeftOfCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER
ffi::GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER
}
AudioChannelPosition::FrontRightOfCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER
}
AudioChannelPosition::RearCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_CENTER
}
AudioChannelPosition::Lfe2 => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_LFE2,
AudioChannelPosition::SideLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
AudioChannelPosition::SideRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
AudioChannelPosition::TopFrontLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_LEFT
}
AudioChannelPosition::TopFrontRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT
ffi::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER
}
AudioChannelPosition::RearCenter => ffi::GST_AUDIO_CHANNEL_POSITION_REAR_CENTER,
AudioChannelPosition::Lfe2 => ffi::GST_AUDIO_CHANNEL_POSITION_LFE2,
AudioChannelPosition::SideLeft => ffi::GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
AudioChannelPosition::SideRight => ffi::GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
AudioChannelPosition::TopFrontLeft => ffi::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_LEFT,
AudioChannelPosition::TopFrontRight => ffi::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT,
AudioChannelPosition::TopFrontCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER
}
AudioChannelPosition::TopCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_CENTER,
AudioChannelPosition::TopRearLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT
}
AudioChannelPosition::TopRearRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT
}
AudioChannelPosition::TopSideLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_LEFT
}
AudioChannelPosition::TopSideRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_RIGHT
}
AudioChannelPosition::TopRearCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER
ffi::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER
}
AudioChannelPosition::TopCenter => ffi::GST_AUDIO_CHANNEL_POSITION_TOP_CENTER,
AudioChannelPosition::TopRearLeft => ffi::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT,
AudioChannelPosition::TopRearRight => ffi::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT,
AudioChannelPosition::TopSideLeft => ffi::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_LEFT,
AudioChannelPosition::TopSideRight => ffi::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_RIGHT,
AudioChannelPosition::TopRearCenter => ffi::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER,
AudioChannelPosition::BottomFrontCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_CENTER
ffi::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_CENTER
}
AudioChannelPosition::BottomFrontLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_LEFT
ffi::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_LEFT
}
AudioChannelPosition::BottomFrontRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_RIGHT
}
AudioChannelPosition::WideLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_WIDE_LEFT,
AudioChannelPosition::WideRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_WIDE_RIGHT,
AudioChannelPosition::SurroundLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SURROUND_LEFT
}
AudioChannelPosition::SurroundRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT
ffi::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_RIGHT
}
AudioChannelPosition::WideLeft => ffi::GST_AUDIO_CHANNEL_POSITION_WIDE_LEFT,
AudioChannelPosition::WideRight => ffi::GST_AUDIO_CHANNEL_POSITION_WIDE_RIGHT,
AudioChannelPosition::SurroundLeft => ffi::GST_AUDIO_CHANNEL_POSITION_SURROUND_LEFT,
AudioChannelPosition::SurroundRight => ffi::GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT,
AudioChannelPosition::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioChannelPosition> for AudioChannelPosition {
fn from_glib(value: gst_audio_sys::GstAudioChannelPosition) -> Self {
impl FromGlib<ffi::GstAudioChannelPosition> for AudioChannelPosition {
fn from_glib(value: ffi::GstAudioChannelPosition) -> Self {
skip_assert_initialized!();
match value {
-3 => AudioChannelPosition::None,
@ -171,7 +145,7 @@ impl FromGlib<gst_audio_sys::GstAudioChannelPosition> for AudioChannelPosition {
impl StaticType for AudioChannelPosition {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_channel_position_get_type()) }
unsafe { from_glib(ffi::gst_audio_channel_position_get_type()) }
}
}
@ -183,13 +157,13 @@ impl<'a> FromValueOptional<'a> for AudioChannelPosition {
impl<'a> FromValue<'a> for AudioChannelPosition {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioChannelPosition {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -234,50 +208,50 @@ pub enum AudioFormat {
#[doc(hidden)]
impl ToGlib for AudioFormat {
type GlibType = gst_audio_sys::GstAudioFormat;
type GlibType = ffi::GstAudioFormat;
fn to_glib(&self) -> gst_audio_sys::GstAudioFormat {
fn to_glib(&self) -> ffi::GstAudioFormat {
match *self {
AudioFormat::Unknown => gst_audio_sys::GST_AUDIO_FORMAT_UNKNOWN,
AudioFormat::Encoded => gst_audio_sys::GST_AUDIO_FORMAT_ENCODED,
AudioFormat::S8 => gst_audio_sys::GST_AUDIO_FORMAT_S8,
AudioFormat::U8 => gst_audio_sys::GST_AUDIO_FORMAT_U8,
AudioFormat::S16le => gst_audio_sys::GST_AUDIO_FORMAT_S16LE,
AudioFormat::S16be => gst_audio_sys::GST_AUDIO_FORMAT_S16BE,
AudioFormat::U16le => gst_audio_sys::GST_AUDIO_FORMAT_U16LE,
AudioFormat::U16be => gst_audio_sys::GST_AUDIO_FORMAT_U16BE,
AudioFormat::S2432le => gst_audio_sys::GST_AUDIO_FORMAT_S24_32LE,
AudioFormat::S2432be => gst_audio_sys::GST_AUDIO_FORMAT_S24_32BE,
AudioFormat::U2432le => gst_audio_sys::GST_AUDIO_FORMAT_U24_32LE,
AudioFormat::U2432be => gst_audio_sys::GST_AUDIO_FORMAT_U24_32BE,
AudioFormat::S32le => gst_audio_sys::GST_AUDIO_FORMAT_S32LE,
AudioFormat::S32be => gst_audio_sys::GST_AUDIO_FORMAT_S32BE,
AudioFormat::U32le => gst_audio_sys::GST_AUDIO_FORMAT_U32LE,
AudioFormat::U32be => gst_audio_sys::GST_AUDIO_FORMAT_U32BE,
AudioFormat::S24le => gst_audio_sys::GST_AUDIO_FORMAT_S24LE,
AudioFormat::S24be => gst_audio_sys::GST_AUDIO_FORMAT_S24BE,
AudioFormat::U24le => gst_audio_sys::GST_AUDIO_FORMAT_U24LE,
AudioFormat::U24be => gst_audio_sys::GST_AUDIO_FORMAT_U24BE,
AudioFormat::S20le => gst_audio_sys::GST_AUDIO_FORMAT_S20LE,
AudioFormat::S20be => gst_audio_sys::GST_AUDIO_FORMAT_S20BE,
AudioFormat::U20le => gst_audio_sys::GST_AUDIO_FORMAT_U20LE,
AudioFormat::U20be => gst_audio_sys::GST_AUDIO_FORMAT_U20BE,
AudioFormat::S18le => gst_audio_sys::GST_AUDIO_FORMAT_S18LE,
AudioFormat::S18be => gst_audio_sys::GST_AUDIO_FORMAT_S18BE,
AudioFormat::U18le => gst_audio_sys::GST_AUDIO_FORMAT_U18LE,
AudioFormat::U18be => gst_audio_sys::GST_AUDIO_FORMAT_U18BE,
AudioFormat::F32le => gst_audio_sys::GST_AUDIO_FORMAT_F32LE,
AudioFormat::F32be => gst_audio_sys::GST_AUDIO_FORMAT_F32BE,
AudioFormat::F64le => gst_audio_sys::GST_AUDIO_FORMAT_F64LE,
AudioFormat::F64be => gst_audio_sys::GST_AUDIO_FORMAT_F64BE,
AudioFormat::Unknown => ffi::GST_AUDIO_FORMAT_UNKNOWN,
AudioFormat::Encoded => ffi::GST_AUDIO_FORMAT_ENCODED,
AudioFormat::S8 => ffi::GST_AUDIO_FORMAT_S8,
AudioFormat::U8 => ffi::GST_AUDIO_FORMAT_U8,
AudioFormat::S16le => ffi::GST_AUDIO_FORMAT_S16LE,
AudioFormat::S16be => ffi::GST_AUDIO_FORMAT_S16BE,
AudioFormat::U16le => ffi::GST_AUDIO_FORMAT_U16LE,
AudioFormat::U16be => ffi::GST_AUDIO_FORMAT_U16BE,
AudioFormat::S2432le => ffi::GST_AUDIO_FORMAT_S24_32LE,
AudioFormat::S2432be => ffi::GST_AUDIO_FORMAT_S24_32BE,
AudioFormat::U2432le => ffi::GST_AUDIO_FORMAT_U24_32LE,
AudioFormat::U2432be => ffi::GST_AUDIO_FORMAT_U24_32BE,
AudioFormat::S32le => ffi::GST_AUDIO_FORMAT_S32LE,
AudioFormat::S32be => ffi::GST_AUDIO_FORMAT_S32BE,
AudioFormat::U32le => ffi::GST_AUDIO_FORMAT_U32LE,
AudioFormat::U32be => ffi::GST_AUDIO_FORMAT_U32BE,
AudioFormat::S24le => ffi::GST_AUDIO_FORMAT_S24LE,
AudioFormat::S24be => ffi::GST_AUDIO_FORMAT_S24BE,
AudioFormat::U24le => ffi::GST_AUDIO_FORMAT_U24LE,
AudioFormat::U24be => ffi::GST_AUDIO_FORMAT_U24BE,
AudioFormat::S20le => ffi::GST_AUDIO_FORMAT_S20LE,
AudioFormat::S20be => ffi::GST_AUDIO_FORMAT_S20BE,
AudioFormat::U20le => ffi::GST_AUDIO_FORMAT_U20LE,
AudioFormat::U20be => ffi::GST_AUDIO_FORMAT_U20BE,
AudioFormat::S18le => ffi::GST_AUDIO_FORMAT_S18LE,
AudioFormat::S18be => ffi::GST_AUDIO_FORMAT_S18BE,
AudioFormat::U18le => ffi::GST_AUDIO_FORMAT_U18LE,
AudioFormat::U18be => ffi::GST_AUDIO_FORMAT_U18BE,
AudioFormat::F32le => ffi::GST_AUDIO_FORMAT_F32LE,
AudioFormat::F32be => ffi::GST_AUDIO_FORMAT_F32BE,
AudioFormat::F64le => ffi::GST_AUDIO_FORMAT_F64LE,
AudioFormat::F64be => ffi::GST_AUDIO_FORMAT_F64BE,
AudioFormat::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioFormat> for AudioFormat {
fn from_glib(value: gst_audio_sys::GstAudioFormat) -> Self {
impl FromGlib<ffi::GstAudioFormat> for AudioFormat {
fn from_glib(value: ffi::GstAudioFormat) -> Self {
skip_assert_initialized!();
match value {
0 => AudioFormat::Unknown,
@ -319,7 +293,7 @@ impl FromGlib<gst_audio_sys::GstAudioFormat> for AudioFormat {
impl StaticType for AudioFormat {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_format_get_type()) }
unsafe { from_glib(ffi::gst_audio_format_get_type()) }
}
}
@ -331,13 +305,13 @@ impl<'a> FromValueOptional<'a> for AudioFormat {
impl<'a> FromValue<'a> for AudioFormat {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioFormat {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -352,20 +326,20 @@ pub enum AudioLayout {
#[doc(hidden)]
impl ToGlib for AudioLayout {
type GlibType = gst_audio_sys::GstAudioLayout;
type GlibType = ffi::GstAudioLayout;
fn to_glib(&self) -> gst_audio_sys::GstAudioLayout {
fn to_glib(&self) -> ffi::GstAudioLayout {
match *self {
AudioLayout::Interleaved => gst_audio_sys::GST_AUDIO_LAYOUT_INTERLEAVED,
AudioLayout::NonInterleaved => gst_audio_sys::GST_AUDIO_LAYOUT_NON_INTERLEAVED,
AudioLayout::Interleaved => ffi::GST_AUDIO_LAYOUT_INTERLEAVED,
AudioLayout::NonInterleaved => ffi::GST_AUDIO_LAYOUT_NON_INTERLEAVED,
AudioLayout::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioLayout> for AudioLayout {
fn from_glib(value: gst_audio_sys::GstAudioLayout) -> Self {
impl FromGlib<ffi::GstAudioLayout> for AudioLayout {
fn from_glib(value: ffi::GstAudioLayout) -> Self {
skip_assert_initialized!();
match value {
0 => AudioLayout::Interleaved,
@ -377,7 +351,7 @@ impl FromGlib<gst_audio_sys::GstAudioLayout> for AudioLayout {
impl StaticType for AudioLayout {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_layout_get_type()) }
unsafe { from_glib(ffi::gst_audio_layout_get_type()) }
}
}
@ -389,13 +363,13 @@ impl<'a> FromValueOptional<'a> for AudioLayout {
impl<'a> FromValue<'a> for AudioLayout {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioLayout {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -429,58 +403,40 @@ pub enum AudioRingBufferFormatType {
#[doc(hidden)]
impl ToGlib for AudioRingBufferFormatType {
type GlibType = gst_audio_sys::GstAudioRingBufferFormatType;
type GlibType = ffi::GstAudioRingBufferFormatType;
fn to_glib(&self) -> gst_audio_sys::GstAudioRingBufferFormatType {
fn to_glib(&self) -> ffi::GstAudioRingBufferFormatType {
match *self {
AudioRingBufferFormatType::Raw => gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW,
AudioRingBufferFormatType::MuLaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW
}
AudioRingBufferFormatType::ALaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW
}
AudioRingBufferFormatType::ImaAdpcm => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IMA_ADPCM
}
AudioRingBufferFormatType::Mpeg => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG
}
AudioRingBufferFormatType::Gsm => gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_GSM,
AudioRingBufferFormatType::Iec958 => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958
}
AudioRingBufferFormatType::Ac3 => gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3,
AudioRingBufferFormatType::Eac3 => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3
}
AudioRingBufferFormatType::Dts => gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS,
AudioRingBufferFormatType::Mpeg2Aac => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC
}
AudioRingBufferFormatType::Mpeg4Aac => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC
}
AudioRingBufferFormatType::Raw => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW,
AudioRingBufferFormatType::MuLaw => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW,
AudioRingBufferFormatType::ALaw => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW,
AudioRingBufferFormatType::ImaAdpcm => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IMA_ADPCM,
AudioRingBufferFormatType::Mpeg => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG,
AudioRingBufferFormatType::Gsm => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_GSM,
AudioRingBufferFormatType::Iec958 => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958,
AudioRingBufferFormatType::Ac3 => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3,
AudioRingBufferFormatType::Eac3 => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3,
AudioRingBufferFormatType::Dts => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS,
AudioRingBufferFormatType::Mpeg2Aac => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC,
AudioRingBufferFormatType::Mpeg4Aac => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC,
#[cfg(any(feature = "v1_12", feature = "dox"))]
AudioRingBufferFormatType::Mpeg2AacRaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC_RAW
ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC_RAW
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
AudioRingBufferFormatType::Mpeg4AacRaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC_RAW
ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC_RAW
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
AudioRingBufferFormatType::Flac => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_FLAC
}
AudioRingBufferFormatType::Flac => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_FLAC,
AudioRingBufferFormatType::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioRingBufferFormatType> for AudioRingBufferFormatType {
fn from_glib(value: gst_audio_sys::GstAudioRingBufferFormatType) -> Self {
impl FromGlib<ffi::GstAudioRingBufferFormatType> for AudioRingBufferFormatType {
fn from_glib(value: ffi::GstAudioRingBufferFormatType) -> Self {
skip_assert_initialized!();
match value {
0 => AudioRingBufferFormatType::Raw,
@ -508,7 +464,7 @@ impl FromGlib<gst_audio_sys::GstAudioRingBufferFormatType> for AudioRingBufferFo
impl StaticType for AudioRingBufferFormatType {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_ring_buffer_format_type_get_type()) }
unsafe { from_glib(ffi::gst_audio_ring_buffer_format_type_get_type()) }
}
}
@ -520,13 +476,13 @@ impl<'a> FromValueOptional<'a> for AudioRingBufferFormatType {
impl<'a> FromValue<'a> for AudioRingBufferFormatType {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for AudioRingBufferFormatType {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -542,21 +498,21 @@ pub enum StreamVolumeFormat {
#[doc(hidden)]
impl ToGlib for StreamVolumeFormat {
type GlibType = gst_audio_sys::GstStreamVolumeFormat;
type GlibType = ffi::GstStreamVolumeFormat;
fn to_glib(&self) -> gst_audio_sys::GstStreamVolumeFormat {
fn to_glib(&self) -> ffi::GstStreamVolumeFormat {
match *self {
StreamVolumeFormat::Linear => gst_audio_sys::GST_STREAM_VOLUME_FORMAT_LINEAR,
StreamVolumeFormat::Cubic => gst_audio_sys::GST_STREAM_VOLUME_FORMAT_CUBIC,
StreamVolumeFormat::Db => gst_audio_sys::GST_STREAM_VOLUME_FORMAT_DB,
StreamVolumeFormat::Linear => ffi::GST_STREAM_VOLUME_FORMAT_LINEAR,
StreamVolumeFormat::Cubic => ffi::GST_STREAM_VOLUME_FORMAT_CUBIC,
StreamVolumeFormat::Db => ffi::GST_STREAM_VOLUME_FORMAT_DB,
StreamVolumeFormat::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstStreamVolumeFormat> for StreamVolumeFormat {
fn from_glib(value: gst_audio_sys::GstStreamVolumeFormat) -> Self {
impl FromGlib<ffi::GstStreamVolumeFormat> for StreamVolumeFormat {
fn from_glib(value: ffi::GstStreamVolumeFormat) -> Self {
skip_assert_initialized!();
match value {
0 => StreamVolumeFormat::Linear,

View file

@ -2,6 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use bitflags::bitflags;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
@ -9,8 +10,6 @@ use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_audio_sys;
bitflags! {
pub struct AudioFlags: u32 {
@ -20,16 +19,16 @@ bitflags! {
#[doc(hidden)]
impl ToGlib for AudioFlags {
type GlibType = gst_audio_sys::GstAudioFlags;
type GlibType = ffi::GstAudioFlags;
fn to_glib(&self) -> gst_audio_sys::GstAudioFlags {
fn to_glib(&self) -> ffi::GstAudioFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioFlags> for AudioFlags {
fn from_glib(value: gst_audio_sys::GstAudioFlags) -> AudioFlags {
impl FromGlib<ffi::GstAudioFlags> for AudioFlags {
fn from_glib(value: ffi::GstAudioFlags) -> AudioFlags {
skip_assert_initialized!();
AudioFlags::from_bits_truncate(value)
}
@ -37,7 +36,7 @@ impl FromGlib<gst_audio_sys::GstAudioFlags> for AudioFlags {
impl StaticType for AudioFlags {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_flags_get_type()) }
unsafe { from_glib(ffi::gst_audio_flags_get_type()) }
}
}
@ -49,13 +48,13 @@ impl<'a> FromValueOptional<'a> for AudioFlags {
impl<'a> FromValue<'a> for AudioFlags {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl SetValue for AudioFlags {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -71,16 +70,16 @@ bitflags! {
#[doc(hidden)]
impl ToGlib for AudioFormatFlags {
type GlibType = gst_audio_sys::GstAudioFormatFlags;
type GlibType = ffi::GstAudioFormatFlags;
fn to_glib(&self) -> gst_audio_sys::GstAudioFormatFlags {
fn to_glib(&self) -> ffi::GstAudioFormatFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioFormatFlags> for AudioFormatFlags {
fn from_glib(value: gst_audio_sys::GstAudioFormatFlags) -> AudioFormatFlags {
impl FromGlib<ffi::GstAudioFormatFlags> for AudioFormatFlags {
fn from_glib(value: ffi::GstAudioFormatFlags) -> AudioFormatFlags {
skip_assert_initialized!();
AudioFormatFlags::from_bits_truncate(value)
}
@ -88,7 +87,7 @@ impl FromGlib<gst_audio_sys::GstAudioFormatFlags> for AudioFormatFlags {
impl StaticType for AudioFormatFlags {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_format_flags_get_type()) }
unsafe { from_glib(ffi::gst_audio_format_flags_get_type()) }
}
}
@ -100,13 +99,13 @@ impl<'a> FromValueOptional<'a> for AudioFormatFlags {
impl<'a> FromValue<'a> for AudioFormatFlags {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl SetValue for AudioFormatFlags {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -118,16 +117,16 @@ bitflags! {
#[doc(hidden)]
impl ToGlib for AudioPackFlags {
type GlibType = gst_audio_sys::GstAudioPackFlags;
type GlibType = ffi::GstAudioPackFlags;
fn to_glib(&self) -> gst_audio_sys::GstAudioPackFlags {
fn to_glib(&self) -> ffi::GstAudioPackFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<gst_audio_sys::GstAudioPackFlags> for AudioPackFlags {
fn from_glib(value: gst_audio_sys::GstAudioPackFlags) -> AudioPackFlags {
impl FromGlib<ffi::GstAudioPackFlags> for AudioPackFlags {
fn from_glib(value: ffi::GstAudioPackFlags) -> AudioPackFlags {
skip_assert_initialized!();
AudioPackFlags::from_bits_truncate(value)
}
@ -135,7 +134,7 @@ impl FromGlib<gst_audio_sys::GstAudioPackFlags> for AudioPackFlags {
impl StaticType for AudioPackFlags {
fn static_type() -> Type {
unsafe { from_glib(gst_audio_sys::gst_audio_pack_flags_get_type()) }
unsafe { from_glib(ffi::gst_audio_pack_flags_get_type()) }
}
}
@ -147,12 +146,12 @@ impl<'a> FromValueOptional<'a> for AudioPackFlags {
impl<'a> FromValue<'a> for AudioPackFlags {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl SetValue for AudioPackFlags {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,31 +2,27 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::StreamVolumeFormat;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib_sys;
use gst_audio_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use StreamVolumeFormat;
glib_wrapper! {
pub struct StreamVolume(Interface<gst_audio_sys::GstStreamVolume>);
glib::glib_wrapper! {
pub struct StreamVolume(Interface<ffi::GstStreamVolume>);
match fn {
get_type => || gst_audio_sys::gst_stream_volume_get_type(),
get_type => || ffi::gst_stream_volume_get_type(),
}
}
impl StreamVolume {
pub fn convert_volume(from: StreamVolumeFormat, to: StreamVolumeFormat, val: f64) -> f64 {
assert_initialized_main_thread!();
unsafe {
gst_audio_sys::gst_stream_volume_convert_volume(from.to_glib(), to.to_glib(), val)
}
unsafe { ffi::gst_stream_volume_convert_volume(from.to_glib(), to.to_glib(), val) }
}
}
@ -58,7 +54,7 @@ pub trait StreamVolumeExt: 'static {
impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
fn get_mute(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_stream_volume_get_mute(
from_glib(ffi::gst_stream_volume_get_mute(
self.as_ref().to_glib_none().0,
))
}
@ -66,25 +62,19 @@ impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
fn get_volume(&self, format: StreamVolumeFormat) -> f64 {
unsafe {
gst_audio_sys::gst_stream_volume_get_volume(
self.as_ref().to_glib_none().0,
format.to_glib(),
)
ffi::gst_stream_volume_get_volume(self.as_ref().to_glib_none().0, format.to_glib())
}
}
fn set_mute(&self, mute: bool) {
unsafe {
gst_audio_sys::gst_stream_volume_set_mute(
self.as_ref().to_glib_none().0,
mute.to_glib(),
);
ffi::gst_stream_volume_set_mute(self.as_ref().to_glib_none().0, mute.to_glib());
}
}
fn set_volume(&self, format: StreamVolumeFormat, val: f64) {
unsafe {
gst_audio_sys::gst_stream_volume_set_volume(
ffi::gst_stream_volume_set_volume(
self.as_ref().to_glib_none().0,
format.to_glib(),
val,
@ -97,9 +87,9 @@ impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_mute_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstStreamVolume,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstStreamVolume,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<StreamVolume>,
{
@ -124,9 +114,9 @@ impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_volume_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstStreamVolume,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstStreamVolume,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<StreamVolume>,
{

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 062b3d6)
from gir-files (https://github.com/gtk-rs/gir-files @ b84cead5)
Generated by gir (https://github.com/gtk-rs/gir @ 694b4b8)
from gir-files (https://github.com/gtk-rs/gir-files @ 58bda97d)