pub struct HardwareEncodeSession(/* private fields */);Expand description
The encode worker’s half of a hardware session.
Implementations§
Source§impl HardwareEncodeSession
impl HardwareEncodeSession
Sourcepub fn selection(&self) -> &NativeVideoEncoderSelection
pub fn selection(&self) -> &NativeVideoEncoderSelection
The encoder this session opened, reported like every other export path.
Sourcepub fn stage_timings(&self) -> EncodeStageTimings
pub fn stage_timings(&self) -> EncodeStageTimings
Where this session’s time has gone, split like the software sinks.
Sourcepub fn encode(&mut self, surface: &EncoderSurface) -> Result<(), EncodeError>
pub fn encode(&mut self, surface: &EncoderSurface) -> Result<(), EncodeError>
Submits surface and muxes whatever packets it produced.
§Errors
Returns an adapter failure when the encoder rejects the frame or packets cannot be written.
Sourcepub fn write_audio(&mut self, block: &AudioBlock) -> Result<(), EncodeError>
pub fn write_audio(&mut self, block: &AudioBlock) -> Result<(), EncodeError>
Buffers one audio block for the audio stream.
§Errors
Returns an adapter failure for a format change, a non-monotonic block, or a failed encode.
Sourcepub fn finish(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>
pub fn finish(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>
Flushes video and audio, writes the trailer, and publishes the output.
§Errors
Returns an adapter failure from the flush or trailer; EncodeError::Publish when the
finished file was kept beside its target; EncodeError::Cancelled when cancel
stopped the publish retries.
Sourcepub fn publish_report(&self) -> Option<PublishReport>
pub fn publish_report(&self) -> Option<PublishReport>
How the finished file was published; None until Self::finish has published it.
Auto Trait Implementations§
impl !RefUnwindSafe for HardwareEncodeSession
impl !Sync for HardwareEncodeSession
impl !UnwindSafe for HardwareEncodeSession
impl Forget for HardwareEncodeSession
impl Freeze for HardwareEncodeSessionwhere
*const AVCodecContext is !null: Freeze,
*const AVBSFContext is !null: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const AVFormatContext is !null: Freeze,
*const AVIOContext is !null: Freeze,
*const Opaque is !null: Freeze,
PhantomData<Opaque>: Freeze,
I32NotAllOnes: Freeze,
*mut Counter<Channel<AudioCommand>>: Freeze,
*mut Counter<Channel<AudioCommand>>: Freeze,
*mut Counter<Channel<AudioCommand>>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<Packet<'static, ()>> is !null: Freeze,
PhantomData<ArcInner<Packet<'static, ()>>>: Freeze,
*const ArcInner<Mutex<AudioQueueState>> is !null: Freeze,
PhantomData<ArcInner<Mutex<AudioQueueState>>>: Freeze,
PhantomData<Segment>: Freeze,
PhantomData<VecDeque<f32>>: Freeze,
PhantomData<QueuedPacket>: Freeze,
PhantomData<NativeVideoEncoderFallback>: Freeze,
impl Move for HardwareEncodeSession
impl Send for HardwareEncodeSessionwhere
AVCodecContext: Send,
AVBSFContextUninit: Send,
RawVecInner: Send,
AVFormatContextOutput: Send,
I32NotAllOnes: Send,
SyncSender<AudioCommand>: Send,
JoinHandle<()>: Send,
Arc<Mutex<AudioQueueState>>: Send,
AVPacket: Send,
impl Unpin for HardwareEncodeSessionwhere
*const AVCodecContext is !null: Unpin,
*const AVBSFContext is !null: Unpin,
*const u8 is !null: Unpin,
*const AVFormatContext is !null: Unpin,
*const AVIOContext is !null: Unpin,
Box<Opaque>: Unpin,
I32NotAllOnes: Unpin,
*mut Counter<Channel<AudioCommand>>: Unpin,
*mut Counter<Channel<AudioCommand>>: Unpin,
*mut Counter<Channel<AudioCommand>>: Unpin,
Arc<Inner, System>: Unpin,
Arc<Packet<'static, ()>>: Unpin,
Arc<Mutex<AudioQueueState>>: Unpin,
*const AVPacket is !null: Unpin,
impl UnsafeUnpin for HardwareEncodeSessionwhere
*const AVCodecContext is !null: UnsafeUnpin,
*const AVBSFContext is !null: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const AVFormatContext is !null: UnsafeUnpin,
*const AVIOContext is !null: UnsafeUnpin,
*const Opaque is !null: UnsafeUnpin,
PhantomData<Opaque>: UnsafeUnpin,
I32NotAllOnes: UnsafeUnpin,
*mut Counter<Channel<AudioCommand>>: UnsafeUnpin,
*mut Counter<Channel<AudioCommand>>: UnsafeUnpin,
*mut Counter<Channel<AudioCommand>>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<Packet<'static, ()>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Packet<'static, ()>>>: UnsafeUnpin,
*const ArcInner<Mutex<AudioQueueState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<AudioQueueState>>>: UnsafeUnpin,
PhantomData<Segment>: UnsafeUnpin,
PhantomData<VecDeque<f32>>: UnsafeUnpin,
PhantomData<QueuedPacket>: UnsafeUnpin,
PhantomData<NativeVideoEncoderFallback>: 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
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> ⓘ
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> ⓘ
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