mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-23 15:38:19 +00:00
audio: Add bindings for audio_buffer_truncate()
This commit is contained in:
parent
71bb12564f
commit
d6b5126c87
1 changed files with 19 additions and 1 deletions
|
@ -9,7 +9,6 @@
|
|||
use glib::translate::{from_glib_full, ToGlibPtr};
|
||||
use gst;
|
||||
|
||||
|
||||
pub fn audio_buffer_clip(
|
||||
buffer: gst::Buffer,
|
||||
segment: &gst::Segment,
|
||||
|
@ -27,3 +26,22 @@ pub fn audio_buffer_clip(
|
|||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn audio_buffer_truncate(
|
||||
buffer: gst::Buffer,
|
||||
bpf: u32,
|
||||
trim: usize,
|
||||
samples: Option<usize>,
|
||||
) -> gst::Buffer {
|
||||
skip_assert_initialized!();
|
||||
|
||||
unsafe {
|
||||
from_glib_full(gst_audio_sys::gst_audio_buffer_truncate(
|
||||
buffer.into_ptr(),
|
||||
bpf as i32,
|
||||
trim,
|
||||
samples.unwrap_or(std::usize::MAX),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue