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 the number of backings it ever holds is the peak number 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: waits until the planes it will be
packed into are free. Call it before recording the render that packs
the frame, 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) -> (&Texture, &Texture)
pub fn planes(&self, frame: &InputFrame) -> (&Texture, &Texture)
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 that on the GPU too, so this does not.
§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.