From a4f1300f7213692228cbe13f6b90f92f818def07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 15 Mar 2018 10:03:01 +0200 Subject: [PATCH] Update gstreamer-audio --- Gir_GstAudio.toml | 14 +++ gir-files/GstAudio-1.0.gir | 1 + gstreamer-audio/Cargo.toml | 1 + gstreamer-audio/src/audio_stream_align.rs | 24 +++++ .../src/auto/audio_stream_align.rs | 98 +++++++++++++++++++ gstreamer-audio/src/auto/enums.rs | 2 +- gstreamer-audio/src/auto/flags.rs | 2 +- gstreamer-audio/src/auto/mod.rs | 7 +- gstreamer-audio/src/auto/stream_volume.rs | 2 +- gstreamer-audio/src/lib.rs | 1 + 10 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 gstreamer-audio/src/audio_stream_align.rs create mode 100644 gstreamer-audio/src/auto/audio_stream_align.rs diff --git a/Gir_GstAudio.toml b/Gir_GstAudio.toml index c52ac73cb..6f19bbde7 100644 --- a/Gir_GstAudio.toml +++ b/Gir_GstAudio.toml @@ -36,6 +36,11 @@ name = "Gst.Caps" status = "manual" ref_mode = "ref" +[[object]] +name = "Gst.ClockTime" +status = "manual" +conversion_type = "scalar" + [[object]] name = "GstAudio.AudioFormat" status = "generate" @@ -109,3 +114,12 @@ status = "generate" name = "f64" # Platform dependant ignore = true + +[[object]] +name = "GstAudio.AudioStreamAlign" +status = "generate" + + [[object.function]] + name = "process" + # bool does not signal error + ignore = true diff --git a/gir-files/GstAudio-1.0.gir b/gir-files/GstAudio-1.0.gir index 2187c9dc4..e35d0857c 100644 --- a/gir-files/GstAudio-1.0.gir +++ b/gir-files/GstAudio-1.0.gir @@ -8417,6 +8417,7 @@ functionality. diff --git a/gstreamer-audio/Cargo.toml b/gstreamer-audio/Cargo.toml index 3dc0958e9..21bb22bd1 100644 --- a/gstreamer-audio/Cargo.toml +++ b/gstreamer-audio/Cargo.toml @@ -29,6 +29,7 @@ optional = true [features] v1_10 = ["gstreamer-sys/v1_10", "gstreamer-audio-sys/v1_10"] v1_12 = ["gstreamer-sys/v1_12", "gstreamer-audio-sys/v1_12", "v1_10"] +v1_14 = ["gstreamer-sys/v1_14", "gstreamer-audio-sys/v1_14", "v1_12"] embed-lgpl-docs = ["rustdoc-stripper"] purge-lgpl-docs = ["rustdoc-stripper"] dox = ["gstreamer-audio-sys/dox", "glib/dox", "gstreamer/dox"] diff --git a/gstreamer-audio/src/audio_stream_align.rs b/gstreamer-audio/src/audio_stream_align.rs new file mode 100644 index 000000000..69a2030c6 --- /dev/null +++ b/gstreamer-audio/src/audio_stream_align.rs @@ -0,0 +1,24 @@ +// Copyright (C) 2018 Sebastian Dröge +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use ffi; + +use AudioStreamAlign; + +impl AudioStreamAlign { + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn process(&mut self, discont: bool, timestamp: gst::ClockTime, n_samples: u32) -> (bool, gst::ClockTime, gst::ClockTime, u64) { + unsafe { + let mut out_timestamp = mem::uninitialized(); + let mut out_duration = mem::uninitialized(); + let mut out_sample_position = mem::uninitialized(); + let ret = from_glib(ffi::gst_audio_stream_align_process(self.to_glib_none_mut().0, discont.to_glib(), timestamp.to_glib(), n_samples, &mut out_timestamp, &mut out_duration, &mut out_sample_position)); + (from_glib(ret), from_glib(out_timestamp), from_glib(out_duration), out_sample_position)) + } + } +} diff --git a/gstreamer-audio/src/auto/audio_stream_align.rs b/gstreamer-audio/src/auto/audio_stream_align.rs new file mode 100644 index 000000000..b1f2419e6 --- /dev/null +++ b/gstreamer-audio/src/auto/audio_stream_align.rs @@ -0,0 +1,98 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +#[cfg(any(feature = "v1_14", feature = "dox"))] +use gst; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct AudioStreamAlign(Boxed); + + match fn { + 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(), + } +} + +impl AudioStreamAlign { + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn new(rate: i32, alignment_threshold: gst::ClockTime, discont_wait: gst::ClockTime) -> AudioStreamAlign { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_audio_stream_align_new(rate, alignment_threshold.to_glib(), discont_wait.to_glib())) + } + } + + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn get_alignment_threshold(&mut self) -> gst::ClockTime { + unsafe { + from_glib(ffi::gst_audio_stream_align_get_alignment_threshold(self.to_glib_none_mut().0)) + } + } + + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn get_discont_wait(&mut self) -> gst::ClockTime { + unsafe { + from_glib(ffi::gst_audio_stream_align_get_discont_wait(self.to_glib_none_mut().0)) + } + } + + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn get_rate(&mut self) -> i32 { + unsafe { + ffi::gst_audio_stream_align_get_rate(self.to_glib_none_mut().0) + } + } + + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn get_samples_since_discont(&mut self) -> u64 { + unsafe { + ffi::gst_audio_stream_align_get_samples_since_discont(self.to_glib_none_mut().0) + } + } + + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn get_timestamp_at_discont(&mut self) -> gst::ClockTime { + unsafe { + from_glib(ffi::gst_audio_stream_align_get_timestamp_at_discont(self.to_glib_none_mut().0)) + } + } + + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn mark_discont(&mut self) { + unsafe { + ffi::gst_audio_stream_align_mark_discont(self.to_glib_none_mut().0); + } + } + + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn set_alignment_threshold(&mut self, alignment_threshold: gst::ClockTime) { + unsafe { + ffi::gst_audio_stream_align_set_alignment_threshold(self.to_glib_none_mut().0, alignment_threshold.to_glib()); + } + } + + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn set_discont_wait(&mut self, discont_wait: gst::ClockTime) { + unsafe { + ffi::gst_audio_stream_align_set_discont_wait(self.to_glib_none_mut().0, discont_wait.to_glib()); + } + } + + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn set_rate(&mut self, rate: i32) { + unsafe { + ffi::gst_audio_stream_align_set_rate(self.to_glib_none_mut().0, rate); + } + } +} + +unsafe impl Send for AudioStreamAlign {} +unsafe impl Sync for AudioStreamAlign {} diff --git a/gstreamer-audio/src/auto/enums.rs b/gstreamer-audio/src/auto/enums.rs index 2fe0f525a..66c54b199 100644 --- a/gstreamer-audio/src/auto/enums.rs +++ b/gstreamer-audio/src/auto/enums.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4) +// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127) // from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT diff --git a/gstreamer-audio/src/auto/flags.rs b/gstreamer-audio/src/auto/flags.rs index 696189a5f..aadbd08b2 100644 --- a/gstreamer-audio/src/auto/flags.rs +++ b/gstreamer-audio/src/auto/flags.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4) +// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127) // from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT diff --git a/gstreamer-audio/src/auto/mod.rs b/gstreamer-audio/src/auto/mod.rs index a78ec07ef..2f35a18c9 100644 --- a/gstreamer-audio/src/auto/mod.rs +++ b/gstreamer-audio/src/auto/mod.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4) +// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127) // from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT @@ -6,6 +6,11 @@ mod stream_volume; pub use self::stream_volume::StreamVolume; pub use self::stream_volume::StreamVolumeExt; +#[cfg(any(feature = "v1_14", feature = "dox"))] +mod audio_stream_align; +#[cfg(any(feature = "v1_14", feature = "dox"))] +pub use self::audio_stream_align::AudioStreamAlign; + mod enums; pub use self::enums::AudioChannelPosition; pub use self::enums::AudioFormat; diff --git a/gstreamer-audio/src/auto/stream_volume.rs b/gstreamer-audio/src/auto/stream_volume.rs index 491265701..f31f92352 100644 --- a/gstreamer-audio/src/auto/stream_volume.rs +++ b/gstreamer-audio/src/auto/stream_volume.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4) +// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127) // from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT diff --git a/gstreamer-audio/src/lib.rs b/gstreamer-audio/src/lib.rs index d127f1a7b..41a5170d0 100644 --- a/gstreamer-audio/src/lib.rs +++ b/gstreamer-audio/src/lib.rs @@ -54,6 +54,7 @@ mod audio_info; pub use audio_info::*; mod audio_channel_position; pub use audio_channel_position::*; +mod audio_stream_align; use glib::translate::{from_glib_full, ToGlibPtr}; pub fn audio_buffer_clip(