gstreamer-rs/gstreamer-audio/src/audio_stream_align.rs

39 lines
1.3 KiB
Rust
Raw Normal View History

2020-12-15 10:53:31 +00:00
// Take a look at the license at the top of the repository in the LICENSE file.
2018-03-15 08:03:01 +00:00
use std::mem;
2018-03-15 08:03:01 +00:00
2018-03-15 08:46:49 +00:00
use glib::translate::*;
use crate::AudioStreamAlign;
2018-03-15 08:46:49 +00:00
2018-03-15 08:03:01 +00:00
impl AudioStreamAlign {
#[doc(alias = "gst_audio_stream_align_process")]
2018-04-01 08:30:03 +00:00
pub fn process(
&mut self,
discont: bool,
timestamp: gst::ClockTime,
n_samples: u32,
) -> (bool, gst::ClockTime, gst::ClockTime, u64) {
2018-03-15 08:03:01 +00:00
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(ffi::gst_audio_stream_align_process(
2018-04-01 08:30:03 +00:00
self.to_glib_none_mut().0,
discont.into_glib(),
timestamp.into_glib(),
2018-04-01 08:30:03 +00:00
n_samples,
out_timestamp.as_mut_ptr(),
out_duration.as_mut_ptr(),
out_sample_position.as_mut_ptr(),
2018-04-01 08:30:03 +00:00
));
(
ret,
2021-04-28 22:29:13 +00:00
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(),
2018-04-01 08:30:03 +00:00
)
2018-03-15 08:03:01 +00:00
}
}
}