Struct rsmpeg::ffi::AVHWDeviceContext[][src]

#[repr(C)]
pub struct AVHWDeviceContext { pub av_class: *const AVClass, pub internal: *mut AVHWDeviceInternal, pub type_: u32, pub hwctx: *mut c_void, pub free: Option<unsafe extern "C" fn(*mut AVHWDeviceContext)>, pub user_opaque: *mut c_void, }
Expand description

This struct aggregates all the (hardware/vendor-specific) “high-level” state, i.e. state that is not tied to a concrete processing configuration. E.g., in an API that supports hardware-accelerated encoding and decoding, this struct will (if possible) wrap the state that is common to both encoding and decoding and from which specific instances of encoders or decoders can be derived.

This struct is reference-counted with the AVBuffer mechanism. The av_hwdevice_ctx_alloc() constructor yields a reference, whose data field points to the actual AVHWDeviceContext. Further objects derived from AVHWDeviceContext (such as AVHWFramesContext, describing a frame pool with specific properties) will hold an internal reference to it. After all the references are released, the AVHWDeviceContext itself will be freed, optionally invoking a user-specified callback for uninitializing the hardware state.

Fields

av_class: *const AVClass
Expand description

A class for logging. Set by av_hwdevice_ctx_alloc().

internal: *mut AVHWDeviceInternal
Expand description

Private data used internally by libavutil. Must not be accessed in any way by the caller.

type_: u32
Expand description

This field identifies the underlying API used for hardware access.

This field is set when this struct is allocated and never changed afterwards.

hwctx: *mut c_void
Expand description

The format-specific data, allocated and freed by libavutil along with this context.

Should be cast by the user to the format-specific context defined in the corresponding header (hwcontext_*.h) and filled as described in the documentation before calling av_hwdevice_ctx_init().

After calling av_hwdevice_ctx_init() this struct should not be modified by the caller.

free: Option<unsafe extern "C" fn(*mut AVHWDeviceContext)>
Expand description

This field may be set by the caller before calling av_hwdevice_ctx_init().

If non-NULL, this callback will be called when the last reference to this context is unreferenced, immediately before it is freed.

@note when other objects (e.g an AVHWFramesContext) are derived from this struct, this callback will be invoked after all such child objects are fully uninitialized and their respective destructors invoked.

user_opaque: *mut c_void
Expand description

Arbitrary user data, to be used e.g. by the free() callback.

Trait Implementations

impl Clone for AVHWDeviceContext[src]

pub fn clone(&self) -> AVHWDeviceContext[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for AVHWDeviceContext[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Copy for AVHWDeviceContext[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.