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 Freeze for HardwareEncodeSession
impl Send for HardwareEncodeSession
impl Unpin for HardwareEncodeSession
impl UnsafeUnpin for HardwareEncodeSession
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