pub struct AvSyncRequest { /* private fields */ }Expand description
What audio an AvSync::synchronize call asks for.
AVSync selects the samples that belong to a video frame; it does not
resample. A request that names a sample rate states the rate its sample
count was computed for, and a source at another rate is reported as
AvSyncOutcome::FormatChanged rather than given audio. The audio always
has the source’s own channels.
Implementations§
Source§impl AvSyncRequest
impl AvSyncRequest
Sourcepub fn automatic() -> Self
pub fn automatic() -> Self
Take whatever audio belongs to the video frame, at the source’s rate.
Sourcepub fn new(sample_rate: Option<u32>, num_samples: Option<u32>) -> Result<Self>
pub fn new(sample_rate: Option<u32>, num_samples: Option<u32>) -> Result<Self>
State the sample rate a request is computed for, and ask for an exact
number of samples per channel. Each None leaves that choice to the
SDK.
With a video frame, the SDK returns the number asked for when it is close to the audio that belongs to the frame; otherwise it returns that audio and reports the count as adjusted.
§Errors
Error::InvalidInput with a shared crate::InputDefect::Layout
cause when a value is outside 1..=i32::MAX, or a single channel’s
sample payload exceeds 64 MiB.
Sourcepub fn sample_rate(self) -> Option<u32>
pub fn sample_rate(self) -> Option<u32>
The sample rate in hertz the request was computed for, if stated.
Sourcepub fn num_samples(self) -> Option<u32>
pub fn num_samples(self) -> Option<u32>
The requested samples per channel, if any.