Realm

oa::VideoEncoder

Stateful hardware encoder session for H.264 High or H.265 Main. One encoder owns a private Vulkan Video encode session, per-slot NV12 input pictures, and the RGBA→NV12 conversion on the selected Engine’s queues. Frames enter as packed RGBA8 bytes sized exactly visible_extent().width * visible_extent().height * 4; conversion, GOP cadence, rate control, DPB management, and Annex-B framing stay private. Every emitted EncodedVideoPacket is one access unit; keyframe packets carry the session’s cached SPS/PPS (and VPS for H.265) parameter sets so each random-access point is self-describing. encode waits for the submitted frame and returns its packet. flush waits for every outstanding encode job and drains the remainder — required before close when asynchronous submissions left frames in flight.

StRust public API

Declaration

pub struct VideoEncoder { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn encode( &mut self, rgba: &[u8], presentation_timestamp_micros: u64, ) -> Result<EncodedVideoPacket>
pub fn encode_rgba16( &mut self, rgba: &[u16], presentation_timestamp_micros: u64, ) -> Result<EncodedVideoPacket>
pub fn flush(&mut self) -> Result<Vec<EncodedVideoPacket>>
pub fn close(&mut self)
pub const fn is_open(&self) -> bool
pub fn coded_extent(&self) -> Option<VideoExtent>
pub fn visible_extent(&self) -> Option<VideoExtent>
pub fn codec_headers(&self) -> Option<&[u8]>

Associated Functions

pub fn new(engine: &Engine, settings: VideoEncodeConfig) -> Result<Self>

Public Method Documentation

pub fn encode( &mut self, rgba: &[u8], presentation_timestamp_micros: u64 ) -> Result<EncodedVideoPacket>
No public source comment is attached to this declaration.
pub fn encode_rgba16( &mut self, rgba: &[u16], presentation_timestamp_micros: u64 ) -> Result<EncodedVideoPacket>
No public source comment is attached to this declaration.
pub fn flush( &mut self ) -> Result<Vec<EncodedVideoPacket>>
No public source comment is attached to this declaration.
pub fn close( &mut self )
No public source comment is attached to this declaration.
pub const fn is_open( &self ) -> bool
No public source comment is attached to this declaration.
pub fn coded_extent( &self ) -> Option<VideoExtent>
No public source comment is attached to this declaration.
pub fn visible_extent( &self ) -> Option<VideoExtent>
No public source comment is attached to this declaration.
pub fn codec_headers( &self ) -> Option<&[u8]>
No public source comment is attached to this declaration.
pub fn new( engine: &Engine, settings: VideoEncodeConfig ) -> Result<Self>
No public source comment is attached to this declaration.