Struct gstreamer_audio::AudioStreamAlign [−]
pub struct 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
Methods
impl AudioStreamAlign
[src]
impl AudioStreamAlign
pub fn new(
rate: i32,
alignment_threshold: ClockTime,
discont_wait: ClockTime
) -> AudioStreamAlign
[src]
pub fn new(
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
gst_audio_discont_wait_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(&mut self) -> ClockTime
[src]
pub fn get_alignment_threshold(&mut self) -> ClockTime
pub fn get_discont_wait(&mut self) -> ClockTime
[src]
pub fn get_discont_wait(&mut self) -> ClockTime
pub fn get_rate(&mut self) -> i32
[src]
pub fn get_rate(&mut self) -> i32
pub fn get_samples_since_discont(&mut self) -> u64
[src]
pub fn get_samples_since_discont(&mut self) -> u64
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(&mut self) -> ClockTime
[src]
pub fn get_timestamp_at_discont(&mut self) -> ClockTime
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]
pub fn mark_discont(&mut self)
Marks the next buffer as discontinuous and resets timestamp tracking.
Feature: v1_14
pub fn set_alignment_threshold(&mut self, alignment_threshold: ClockTime)
[src]
pub fn set_alignment_threshold(&mut self, alignment_threshold: ClockTime)
pub fn set_discont_wait(&mut self, discont_wait: ClockTime)
[src]
pub fn set_discont_wait(&mut self, discont_wait: ClockTime)
pub fn set_rate(&mut self, rate: i32)
[src]
pub fn set_rate(&mut self, rate: i32)
impl AudioStreamAlign
[src]
impl AudioStreamAlign
pub fn process(
&mut self,
discont: bool,
timestamp: ClockTime,
n_samples: u32
) -> (bool, ClockTime, ClockTime, u64)
[src]
pub fn process(
&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 Debug for AudioStreamAlign
[src]
impl Debug for AudioStreamAlign
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for AudioStreamAlign
[src]
impl PartialEq for AudioStreamAlign
fn eq(&self, other: &AudioStreamAlign) -> bool
[src]
fn eq(&self, other: &AudioStreamAlign) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &AudioStreamAlign) -> bool
[src]
fn ne(&self, other: &AudioStreamAlign) -> bool
This method tests for !=
.
impl Eq for AudioStreamAlign
[src]
impl Eq for AudioStreamAlign
impl PartialOrd for AudioStreamAlign
[src]
impl PartialOrd for AudioStreamAlign
fn partial_cmp(&self, other: &AudioStreamAlign) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &AudioStreamAlign) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &AudioStreamAlign) -> bool
[src]
fn lt(&self, other: &AudioStreamAlign) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &AudioStreamAlign) -> bool
[src]
fn le(&self, other: &AudioStreamAlign) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &AudioStreamAlign) -> bool
[src]
fn gt(&self, other: &AudioStreamAlign) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &AudioStreamAlign) -> bool
[src]
fn ge(&self, other: &AudioStreamAlign) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for AudioStreamAlign
[src]
impl Ord for AudioStreamAlign
fn cmp(&self, other: &AudioStreamAlign) -> Ordering
[src]
fn cmp(&self, other: &AudioStreamAlign) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for AudioStreamAlign
[src]
impl Hash for AudioStreamAlign
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for AudioStreamAlign
impl Clone for AudioStreamAlign
fn clone(&self) -> AudioStreamAlign
fn clone(&self) -> AudioStreamAlign
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl StaticType for AudioStreamAlign
impl StaticType for AudioStreamAlign
fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl Send for AudioStreamAlign
[src]
impl Send for AudioStreamAlign
impl Sync for AudioStreamAlign
[src]
impl Sync for AudioStreamAlign