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
|
|
|
|
2020-11-21 18:17:20 +00:00
|
|
|
use crate::AudioStreamAlign;
|
2018-03-15 08:03:01 +00:00
|
|
|
|
2018-03-15 08:46:49 +00:00
|
|
|
use glib::translate::*;
|
|
|
|
use std::mem;
|
|
|
|
|
2018-03-15 08:03:01 +00:00
|
|
|
impl AudioStreamAlign {
|
2020-11-27 13:37:49 +00:00
|
|
|
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
|
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();
|
2020-11-21 18:17:20 +00:00
|
|
|
let ret = from_glib(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,
|
2019-07-11 12:34:28 +00:00
|
|
|
from_glib(out_timestamp.assume_init()),
|
|
|
|
from_glib(out_duration.assume_init()),
|
|
|
|
out_sample_position.assume_init(),
|
2018-04-01 08:30:03 +00:00
|
|
|
)
|
2018-03-15 08:03:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|