Struct gstreamer_audio::AudioStreamAlign [−][src]
pub struct AudioStreamAlign(_);
Expand description
AudioStreamAlign
provides a helper object that helps tracking audio
stream alignment and discontinuities, and detects discontinuities if
possible.
See new()
for a description of its parameters and
process()
for the details of the processing.
Implementations
pub fn new(
rate: i32,
alignment_threshold: ClockTime,
discont_wait: ClockTime
) -> AudioStreamAlign
[src]This is supported on crate feature v1_14
only.
pub fn new(
rate: i32,
alignment_threshold: ClockTime,
discont_wait: ClockTime
) -> AudioStreamAlign
[src]v1_14
only.Allocate a new AudioStreamAlign
with the given configuration. All
processing happens according to sample rate rate
, until
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 set_alignment_threshold()
and
set_discont_wait()
.
rate
a sample rate
alignment_threshold
a alignment threshold in nanoseconds
discont_wait
discont wait in nanoseconds
Returns
a new AudioStreamAlign
. free with gst_audio_stream_align_free()
.
This is supported on crate feature v1_14
only.
v1_14
only.Gets the currently configured alignment threshold.
Returns
The currently configured alignment threshold
This is supported on crate feature v1_14
only.
v1_14
only.This is supported on crate feature v1_14
only.
v1_14
only.This is supported on crate feature v1_14
only.
v1_14
only.Returns the number of samples that were processed since the last discontinuity was detected.
Returns
The number of samples processed since the last discontinuity.
This is supported on crate feature v1_14
only.
v1_14
only.Timestamp that was passed when a discontinuity was detected, i.e. the first timestamp after the discontinuity.
Returns
The last timestamp at when a discontinuity was detected
This is supported on crate feature v1_14
only.
v1_14
only.Marks the next buffer as discontinuous and resets timestamp tracking.
This is supported on crate feature v1_14
only.
v1_14
only.Sets alignment_treshold
as new alignment threshold for the following processing.
alignment_threshold
a new alignment threshold
This is supported on crate feature v1_14
only.
v1_14
only.Sets alignment_treshold
as new discont wait for the following processing.
discont_wait
a new discont wait
pub fn process(
&mut self,
discont: bool,
timestamp: ClockTime,
n_samples: u32
) -> (bool, ClockTime, ClockTime, u64)
[src]This is supported on crate feature v1_14
only.
pub fn process(
&mut self,
discont: bool,
timestamp: ClockTime,
n_samples: u32
) -> (bool, ClockTime, ClockTime, u64)
[src]v1_14
only.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.
discont
if this data is considered to be discontinuous
timestamp
a GstClockTime
of the start of the data
n_samples
number of samples to process
Returns
true
if a discontinuity was detected, false
otherwise.
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
Trait Implementations
v1_14
only.v1_14
only.v1_14
only.v1_14
only.v1_14
only.This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
v1_14
only.This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
v1_14
only.Returns the type identifier of Self
.
v1_14
only.v1_14
only.v1_14
only.v1_14
only.v1_14
only.Auto Trait Implementations
impl RefUnwindSafe for AudioStreamAlign
impl Unpin for AudioStreamAlign
impl UnwindSafe for AudioStreamAlign
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns a SendValue
clone of self
.
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,
[src]