pub struct Session { /* private fields */ }Expand description
An open oneVPL session (MFXInitEx succeeded) plus the Loader it was created from.
Drop calls MFXClose — callers that already closed the encoder should
still let this run (idempotent-safe: a session is only ever closed once,
Session has no close-without-drop path this stage).
Implementations§
Source§impl Session
impl Session
Sourcepub fn query_version(&mut self) -> Result<mfxVersion, VplError>
pub fn query_version(&mut self) -> Result<mfxVersion, VplError>
Sourcepub fn query_impl(&mut self) -> Result<mfxIMPL, VplError>
pub fn query_impl(&mut self) -> Result<mfxIMPL, VplError>
MFXQueryIMPL — which implementation the runtime actually selected
(hardware vs. a software fallback the caller did not ask for).
§Errors
VplError::Status on a negative mfxStatus.
Sourcepub fn encode_query(
&mut self,
par: &mut mfxVideoParam,
) -> Result<mfxStatus, VplError>
pub fn encode_query( &mut self, par: &mut mfxVideoParam, ) -> Result<mfxStatus, VplError>
MFXVideoENCODE_Query — validate/adjust par before Init.
§Errors
VplError::Status on a negative mfxStatus.
Sourcepub fn encode_init(&mut self, par: &mut mfxVideoParam) -> Result<(), VplError>
pub fn encode_init(&mut self, par: &mut mfxVideoParam) -> Result<(), VplError>
Sourcepub fn encode_close(&mut self) -> Result<(), VplError>
pub fn encode_close(&mut self) -> Result<(), VplError>
Sourcepub fn encode_frame_async(
&mut self,
surface: Option<&mut mfxFrameSurface1>,
bs: &mut mfxBitstream,
) -> Result<(mfxStatus, mfxSyncPoint), VplError>
pub fn encode_frame_async( &mut self, surface: Option<&mut mfxFrameSurface1>, bs: &mut mfxBitstream, ) -> Result<(mfxStatus, mfxSyncPoint), VplError>
MFXVideoENCODE_EncodeFrameAsync. Pass surface = None to signal
end-of-stream (drain buffered frames during flush).
Returns the raw mfxStatus (not just success/error) so the caller can
distinguish MFX_ERR_NONE (packet ready, syncp populated) from
MFX_ERR_MORE_DATA (no packet yet — not a failure) and
MFX_WRN_DEVICE_BUSY (retry).
§Errors
VplError::Status only for status values this crate does not know
how to interpret as non-fatal (i.e. a genuine negative status other
than MFX_ERR_MORE_DATA).
Sourcepub fn sync_operation(
&mut self,
syncp: mfxSyncPoint,
wait_ms: u32,
) -> Result<(), VplError>
pub fn sync_operation( &mut self, syncp: mfxSyncPoint, wait_ms: u32, ) -> Result<(), VplError>
MFXVideoCORE_SyncOperation — block (up to wait_ms) for syncp to
complete, after a MFX_ERR_NONE Self::encode_frame_async.
§Errors
VplError::Status on a negative mfxStatus.