Skip to main content

Session

Struct Session 

Source
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

Source

pub fn query_version(&mut self) -> Result<mfxVersion, VplError>

MFXQueryVersion.

§Errors

VplError::Status on a negative mfxStatus.

Source

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.

Source

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.

Source

pub fn encode_init(&mut self, par: &mut mfxVideoParam) -> Result<(), VplError>

MFXVideoENCODE_Init.

§Errors

VplError::Status on a negative mfxStatus.

Source

pub fn encode_close(&mut self) -> Result<(), VplError>

MFXVideoENCODE_Close.

§Errors

VplError::Status on a negative mfxStatus.

Source

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).

Source

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.

Trait Implementations§

Source§

impl Drop for Session

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for Session

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.