gstreamer-rs/gstreamer-audio/src/audio_stream_align.rs
Bilal Elmoussaoui 4ebec84f5e Adapt to no longer renamed ffi crates
Allows us to set all the crates in the main workspace file, so changing
their versions or branch is much simpler and reduce the amount of noise
in the diff

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1450>
2024-06-02 11:20:55 +02:00

38 lines
1.3 KiB
Rust

// Take a look at the license at the top of the repository in the LICENSE file.
use std::mem;
use glib::translate::*;
use crate::AudioStreamAlign;
impl AudioStreamAlign {
#[doc(alias = "gst_audio_stream_align_process")]
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::MaybeUninit::uninit();
let mut out_duration = mem::MaybeUninit::uninit();
let mut out_sample_position = mem::MaybeUninit::uninit();
let ret = from_glib(crate::ffi::gst_audio_stream_align_process(
self.to_glib_none_mut().0,
discont.into_glib(),
timestamp.into_glib(),
n_samples,
out_timestamp.as_mut_ptr(),
out_duration.as_mut_ptr(),
out_sample_position.as_mut_ptr(),
));
(
ret,
try_from_glib(out_timestamp.assume_init()).expect("undefined out_timestamp"),
try_from_glib(out_duration.assume_init()).expect("undefined out_duration"),
out_sample_position.assume_init(),
)
}
}
}