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
|
|
|
|
2023-01-03 18:58:25 +00:00
|
|
|
use std::mem;
|
2018-03-15 08:03:01 +00:00
|
|
|
|
2018-03-15 08:46:49 +00:00
|
|
|
use glib::translate::*;
|
2023-01-03 18:58:25 +00:00
|
|
|
|
|
|
|
use crate::AudioStreamAlign;
|
2018-03-15 08:46:49 +00:00
|
|
|
|
2018-03-15 08:03:01 +00:00
|
|
|
impl AudioStreamAlign {
|
2021-05-19 20:35:47 +00:00
|
|
|
#[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 {
|
2019-07-11 12:34:28 +00:00
|
|
|
let mut out_timestamp = mem::MaybeUninit::uninit();
|
|
|
|
let mut out_duration = mem::MaybeUninit::uninit();
|
|
|
|
let mut out_sample_position = mem::MaybeUninit::uninit();
|
2024-06-02 08:48:53 +00:00
|
|
|
let ret = from_glib(crate::ffi::gst_audio_stream_align_process(
|
2018-04-01 08:30:03 +00:00
|
|
|
self.to_glib_none_mut().0,
|
2021-04-27 15:15:46 +00:00
|
|
|
discont.into_glib(),
|
|
|
|
timestamp.into_glib(),
|
2018-04-01 08:30:03 +00:00
|
|
|
n_samples,
|
2019-07-11 12:34:28 +00:00
|
|
|
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"),
|
2019-07-11 12:34:28 +00:00
|
|
|
out_sample_position.assume_init(),
|
2018-04-01 08:30:03 +00:00
|
|
|
)
|
2018-03-15 08:03:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|