From 78c1fed92db90d3b625aa98ffefaf1c09d67181a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 7 Jun 2020 13:39:38 +0300 Subject: [PATCH] audio: Move audio_buffer_clip() to functions module --- gstreamer-audio/src/functions.rs | 20 ++++++++++++++++++++ gstreamer-audio/src/lib.rs | 19 ------------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/gstreamer-audio/src/functions.rs b/gstreamer-audio/src/functions.rs index 2cd43dfef..aa563d171 100644 --- a/gstreamer-audio/src/functions.rs +++ b/gstreamer-audio/src/functions.rs @@ -1,3 +1,4 @@ +// Copyright (C) 2017-2020 Sebastian Dröge // Copyright (C) 2020 Guillaume Desmottes // // Licensed under the Apache License, Version 2.0 Option { + skip_assert_initialized!(); + + unsafe { + from_glib_full(gst_audio_sys::gst_audio_buffer_clip( + buffer.into_ptr(), + segment.to_glib_none().0, + rate as i32, + bpf as i32, + )) + } +} + pub fn audio_make_raw_caps( formats: &[::AudioFormat], layout: ::AudioLayout, diff --git a/gstreamer-audio/src/lib.rs b/gstreamer-audio/src/lib.rs index f4696e7fd..80a9ced54 100644 --- a/gstreamer-audio/src/lib.rs +++ b/gstreamer-audio/src/lib.rs @@ -62,25 +62,6 @@ pub use audio_decoder::AudioDecoderExtManual; mod audio_encoder; pub use audio_encoder::AudioEncoderExtManual; -use glib::translate::{from_glib_full, ToGlibPtr}; -pub fn audio_buffer_clip( - buffer: gst::Buffer, - segment: &gst::Segment, - rate: u32, - bpf: u32, -) -> Option { - skip_assert_initialized!(); - - unsafe { - from_glib_full(gst_audio_sys::gst_audio_buffer_clip( - buffer.into_ptr(), - segment.to_glib_none().0, - rate as i32, - bpf as i32, - )) - } -} - // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude {