[−][src]Struct gstreamer_audio::AudioStreamAlign
AudioStreamAlign
provides a helper object that helps tracking audio
stream alignment and discontinuities, and detects discontinuities if
possible.
See AudioStreamAlign::new
for a description of its parameters and
AudioStreamAlign::process
for the details of the processing.
Feature: v1_14
Implementations
impl AudioStreamAlign
[src]
pub fn new(
rate: i32,
alignment_threshold: ClockTime,
discont_wait: ClockTime
) -> AudioStreamAlign
[src]
rate: i32,
alignment_threshold: ClockTime,
discont_wait: ClockTime
) -> AudioStreamAlign
Allocate a new AudioStreamAlign
with the given configuration. All
processing happens according to sample rate rate
, until
AudioStreamAlign::set_rate
is called with a new rate
.
A negative rate can be used for reverse playback.
alignment_threshold
gives the tolerance in nanoseconds after which a
timestamp difference is considered a discontinuity. Once detected,
discont_wait
nanoseconds have to pass without going below the threshold
again until the output buffer is marked as a discontinuity. These can later
be re-configured with AudioStreamAlign::set_alignment_threshold
and
AudioStreamAlign::set_discont_wait
.
Feature: v1_14
rate
a sample rate
alignment_threshold
a alignment threshold in nanoseconds
discont_wait
discont wait in nanoseconds
Returns
a new AudioStreamAlign
. free with AudioStreamAlign::free
.
pub fn get_alignment_threshold(&self) -> ClockTime
[src]
Gets the currently configured alignment threshold.
Feature: v1_14
Returns
The currently configured alignment threshold
pub fn get_discont_wait(&self) -> ClockTime
[src]
Gets the currently configured discont wait.
Feature: v1_14
Returns
The currently configured discont wait
pub fn get_rate(&self) -> i32
[src]
Gets the currently configured sample rate.
Feature: v1_14
Returns
The currently configured sample rate
pub fn get_samples_since_discont(&self) -> u64
[src]
Returns the number of samples that were processed since the last discontinuity was detected.
Feature: v1_14
Returns
The number of samples processed since the last discontinuity.
pub fn get_timestamp_at_discont(&self) -> ClockTime
[src]
Timestamp that was passed when a discontinuity was detected, i.e. the first timestamp after the discontinuity.
Feature: v1_14
Returns
The last timestamp at when a discontinuity was detected
pub fn mark_discont(&mut self)
[src]
Marks the next buffer as discontinuous and resets timestamp tracking.
Feature: v1_14
pub fn set_alignment_threshold(&mut self, alignment_threshold: ClockTime)
[src]
Sets alignment_treshold
as new alignment threshold for the following processing.
Feature: v1_14
alignment_threshold
a new alignment threshold
pub fn set_discont_wait(&mut self, discont_wait: ClockTime)
[src]
Sets alignment_treshold
as new discont wait for the following processing.
Feature: v1_14
discont_wait
a new discont wait
pub fn set_rate(&mut self, rate: i32)
[src]
Sets rate
as new sample rate for the following processing. If the sample
rate differs this implicitly marks the next data as discontinuous.
Feature: v1_14
rate
a new sample rate
impl AudioStreamAlign
[src]
pub fn process(
&mut self,
discont: bool,
timestamp: ClockTime,
n_samples: u32
) -> (bool, ClockTime, ClockTime, u64)
[src]
&mut self,
discont: bool,
timestamp: ClockTime,
n_samples: u32
) -> (bool, ClockTime, ClockTime, u64)
Processes data with timestamp
and n_samples
, and returns the output
timestamp, duration and sample position together with a boolean to signal
whether a discontinuity was detected or not. All non-discontinuous data
will have perfect timestamps and durations.
A discontinuity is detected once the difference between the actual timestamp and the timestamp calculated from the sample count since the last discontinuity differs by more than the alignment threshold for a duration longer than discont wait.
Note: In reverse playback, every buffer is considered discontinuous in the context of buffer flags because the last sample of the previous buffer is discontinuous with the first sample of the current one. However for this function they are only considered discontinuous in reverse playback if the first sample of the previous buffer is discontinuous with the last sample of the current one.
Feature: v1_14
discont
if this data is considered to be discontinuous
timestamp
a gst::ClockTime
of the start of the data
n_samples
number of samples to process
out_timestamp
output timestamp of the data
out_duration
output duration of the data
out_sample_position
output sample position of the start of the data
Returns
true
if a discontinuity was detected, false
otherwise.
Trait Implementations
impl Clone for AudioStreamAlign
[src]
fn clone(&self) -> AudioStreamAlign
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for AudioStreamAlign
[src]
impl Eq for AudioStreamAlign
[src]
impl Hash for AudioStreamAlign
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for AudioStreamAlign
[src]
fn cmp(&self, other: &AudioStreamAlign) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<AudioStreamAlign> for AudioStreamAlign
[src]
fn eq(&self, other: &AudioStreamAlign) -> bool
[src]
fn ne(&self, other: &AudioStreamAlign) -> bool
[src]
impl PartialOrd<AudioStreamAlign> for AudioStreamAlign
[src]
fn partial_cmp(&self, other: &AudioStreamAlign) -> Option<Ordering>
[src]
fn lt(&self, other: &AudioStreamAlign) -> bool
[src]
fn le(&self, other: &AudioStreamAlign) -> bool
[src]
fn gt(&self, other: &AudioStreamAlign) -> bool
[src]
fn ge(&self, other: &AudioStreamAlign) -> bool
[src]
impl Send for AudioStreamAlign
[src]
impl StaticType for AudioStreamAlign
[src]
fn static_type() -> Type
[src]
impl StructuralEq for AudioStreamAlign
[src]
impl StructuralPartialEq for AudioStreamAlign
[src]
impl Sync for AudioStreamAlign
[src]
Auto Trait Implementations
impl RefUnwindSafe for AudioStreamAlign
impl Unpin for AudioStreamAlign
impl UnwindSafe for AudioStreamAlign
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToSendValue for T where
T: ToValue + SetValue + Send + ?Sized,
[src]
T: ToValue + SetValue + Send + ?Sized,
fn to_send_value(&self) -> SendValue
[src]
impl<T> ToValue for T where
T: SetValue + ?Sized,
[src]
T: SetValue + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,