AVHWDeviceContext

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.

Members

Variables

av_class
const(AVClass)* av_class;

A class for logging. Set by av_hwdevice_ctx_alloc().

free
void function(AVHWDeviceContext* ctx) free;

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

hwctx
void* hwctx;

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

internal
AVHWDeviceInternal* internal;

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

type
AVHWDeviceType type;

This field identifies the underlying API used for hardware access.

user_opaque
void* user_opaque;

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

Meta