pub struct NativeAudioEncodeSink { /* private fields */ }Expand description
One encoded audio stream muxed alone through the linked FFmpeg libraries: the audio half of
NativeAvEncodeSink, encoded on the calling thread.
Implementations§
Source§impl NativeAudioEncodeSink
impl NativeAudioEncodeSink
Sourcepub fn create(
path: impl Into<OutputTarget>,
container: Container,
stream: AudioStreamConfig,
) -> Result<Self, EncodeError>
pub fn create( path: impl Into<OutputTarget>, container: Container, stream: AudioStreamConfig, ) -> Result<Self, EncodeError>
Creates the encoder and the muxer of container without touching the destination.
§Errors
For a codec the container does not offer, an invalid stream, an encoder the runtime lacks or cannot open, an existing output or a file-system failure.
Sourcepub fn encoder_name(&self) -> &str
pub fn encoder_name(&self) -> &str
The FFmpeg name of the encoder that opened.
Sourcepub const fn frames_written(&self) -> u64
pub const fn frames_written(&self) -> u64
Project-rate samples per channel taken so far.
Sourcepub const fn stage_timings(&self) -> EncodeStageTimings
pub const fn stage_timings(&self) -> EncodeStageTimings
Where this sink’s time has gone so far.
Sourcepub const fn publish_report(&self) -> Option<PublishReport>
pub const fn publish_report(&self) -> Option<PublishReport>
How the finished file was published; None until it is.
Sourcepub fn seal(&mut self) -> Result<(), EncodeError>
pub fn seal(&mut self) -> Result<(), EncodeError>
Flushes the encoder, writes the trailer and closes the file, which stays a partial file
until Self::publish.
§Errors
When the encoder, the muxer or the file system refuses.
Sourcepub fn publish(
&mut self,
cancel: &CancelToken,
) -> Result<PublishReport, EncodeError>
pub fn publish( &mut self, cancel: &CancelToken, ) -> Result<PublishReport, EncodeError>
Trait Implementations§
Source§impl AudioBlockSink for NativeAudioEncodeSink
impl AudioBlockSink for NativeAudioEncodeSink
Source§fn write_audio(
&mut self,
block: &AudioBlock,
cancel: &CancelToken,
) -> Result<(), EncodeError>
fn write_audio( &mut self, block: &AudioBlock, cancel: &CancelToken, ) -> Result<(), EncodeError>
Writes one monotonic audio block. Read more
Source§fn finish_audio(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>
fn finish_audio(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>
Drains and commits the sink. Read more
Source§fn abort_audio(&mut self) -> Result<(), EncodeError>
fn abort_audio(&mut self) -> Result<(), EncodeError>
Discards partial output. Read more
Source§impl Drop for NativeAudioEncodeSink
impl Drop for NativeAudioEncodeSink
Auto Trait Implementations§
impl !RefUnwindSafe for NativeAudioEncodeSink
impl !Sync for NativeAudioEncodeSink
impl !UnwindSafe for NativeAudioEncodeSink
impl Forget for NativeAudioEncodeSink
impl Freeze for NativeAudioEncodeSinkwhere
*const AVFormatContext is !null: Freeze,
*const AVIOContext is !null: Freeze,
*const Opaque is !null: Freeze,
PhantomData<Opaque>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
I32NotAllOnes: Freeze,
*const AVCodecContext is !null: Freeze,
PhantomData<Segment>: Freeze,
PhantomData<VecDeque<f32>>: Freeze,
impl Move for NativeAudioEncodeSink
impl Send for NativeAudioEncodeSink
impl Unpin for NativeAudioEncodeSink
impl UnsafeUnpin for NativeAudioEncodeSinkwhere
*const AVFormatContext is !null: UnsafeUnpin,
*const AVIOContext is !null: UnsafeUnpin,
*const Opaque is !null: UnsafeUnpin,
PhantomData<Opaque>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
I32NotAllOnes: UnsafeUnpin,
*const AVCodecContext is !null: UnsafeUnpin,
PhantomData<Segment>: UnsafeUnpin,
PhantomData<VecDeque<f32>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more