pub struct SwAudioEncoderOptions {
pub codec: AudioCodec,
pub sample_rate: u32,
pub channels: u16,
pub time_base: Rational,
pub bit_rate: usize,
}Expand description
Construction-time options for SwAudioEncoder::new. sample_rate/
channels/time_base must already be known — same convention as
crate::elements::SwEncoder’s own width/height/time_base —
rather than inferred from the first frame, since avcodec_open2 needs
them set before this can be opened at all. What’s actually fed to
this element doesn’t have to match sample_rate/channels exactly —
see SwAudioEncoder’s own docs on why.
Fields§
§codec: AudioCodec§sample_rate: u32§channels: u16§time_base: RationalMust match the pts unit of whatever frames this receives — e.g.
crate::elements::TestAudioSource::time_base/
crate::elements::AudioMixer::time_base.
bit_rate: usizeTrait Implementations§
Source§impl Clone for SwAudioEncoderOptions
impl Clone for SwAudioEncoderOptions
Source§fn clone(&self) -> SwAudioEncoderOptions
fn clone(&self) -> SwAudioEncoderOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SwAudioEncoderOptions
Auto Trait Implementations§
impl Freeze for SwAudioEncoderOptions
impl RefUnwindSafe for SwAudioEncoderOptions
impl Send for SwAudioEncoderOptions
impl Sync for SwAudioEncoderOptions
impl Unpin for SwAudioEncoderOptions
impl UnsafeUnpin for SwAudioEncoderOptions
impl UnwindSafe for SwAudioEncoderOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more