pub struct HardwareEncodeInput { /* private fields */ }Expand description
The coordinator’s half of a hardware session.
Implementations§
Source§impl HardwareEncodeInput
impl HardwareEncodeInput
Sourcepub fn acquire_surface(&mut self) -> Result<EncoderSurface, EncodeError>
pub fn acquire_surface(&mut self) -> Result<EncoderSurface, EncodeError>
Takes one surface from the session’s pool.
The pool allocates on demand, so its size is the peak outstanding; the caller bounds that.
§Errors
Returns an adapter failure when the pool cannot allocate.
Sourcepub fn begin_frame(
&mut self,
surface: &EncoderSurface,
) -> Result<InputFrame, EncodeError>
pub fn begin_frame( &mut self, surface: &EncoderSurface, ) -> Result<InputFrame, EncodeError>
Begins a frame bound for surface, waiting until its planes are free. Call
it before recording the pack render into Self::planes, and submit that
render before Self::submit.
§Errors
Returns an error for a surface from another pool, or when the wait fails.
Sourcepub fn planes(&self, frame: &InputFrame) -> (&TextureView, &TextureView)
pub fn planes(&self, frame: &InputFrame) -> (&TextureView, &TextureView)
Default views of the luma and interleaved chroma textures frame is packed into.
Sourcepub fn submit(
&mut self,
frame: InputFrame,
surface: &mut EncoderSurface,
) -> Result<(), EncodeError>
pub fn submit( &mut self, frame: InputFrame, surface: &mut EncoderSurface, ) -> Result<(), EncodeError>
Moves frame’s packed planes into surface on the GPU; the
encoder waits for it on the GPU.
§Errors
Returns an error for a surface from another pool, or when the handoff cannot be submitted.
Sourcepub fn set_time(&self, surface: &mut EncoderSurface, time: MediaTime)
pub fn set_time(&self, surface: &mut EncoderSurface, time: MediaTime)
Stamps surface with its presentation time.
Sourcepub fn stats(&self) -> EncoderPoolStats
pub fn stats(&self) -> EncoderPoolStats
This session’s pool counters so far.
Auto Trait Implementations§
impl !RefUnwindSafe for HardwareEncodeInput
impl !Sync for HardwareEncodeInput
impl !UnwindSafe for HardwareEncodeInput
impl Forget for HardwareEncodeInput
impl Freeze for HardwareEncodeInputwhere
*mut c_void: Freeze,
*const AVBufferRef is !null: Freeze,
*const RetainedEncodeWork is !null: Freeze,
PhantomData<RetainedEncodeWork>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Nv12Planes>: Freeze,
PhantomData<(u64, ())>: Freeze,
impl Move for HardwareEncodeInput
impl Send for HardwareEncodeInput
impl Unpin for HardwareEncodeInput
impl UnsafeUnpin for HardwareEncodeInputwhere
*mut c_void: UnsafeUnpin,
*const AVBufferRef is !null: UnsafeUnpin,
*const RetainedEncodeWork is !null: UnsafeUnpin,
PhantomData<RetainedEncodeWork>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Nv12Planes>: UnsafeUnpin,
PhantomData<(u64, ())>: 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