FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
AVHWDeviceContext Struct Reference

This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e. More...

#include <hwcontext.h>

Data Fields

const AVClassav_class
 A class for logging. More...
 
AVHWDeviceInternalinternal
 Private data used internally by libavutil. More...
 
enum AVHWDeviceType type
 This field identifies the underlying API used for hardware access. More...
 
voidhwctx
 The format-specific data, allocated and freed by libavutil along with this context. More...
 
void(* free )(struct AVHWDeviceContext *ctx)
 This field may be set by the caller before calling av_hwdevice_ctx_init(). More...
 
voiduser_opaque
 Arbitrary user data, to be used e.g. More...
 

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

Definition at line 54 of file hwcontext.h.

Field Documentation

const AVClass* AVHWDeviceContext::av_class

A class for logging.

Set by av_hwdevice_ctx_alloc().

Definition at line 58 of file hwcontext.h.

Referenced by av_hwdevice_ctx_alloc().

AVHWDeviceInternal* AVHWDeviceContext::internal
enum AVHWDeviceType AVHWDeviceContext::type

This field identifies the underlying API used for hardware access.

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

Definition at line 72 of file hwcontext.h.

Referenced by av_hwdevice_ctx_alloc(), and qsv_init_child_ctx().

void* AVHWDeviceContext::hwctx
void(* AVHWDeviceContext::free)(struct AVHWDeviceContext *ctx)

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.

Definition at line 97 of file hwcontext.h.

Referenced by cuda_device_create(), cudaupload_init(), dxva2_device_create(), hwdevice_ctx_free(), qsv_device_create(), and vaapi_device_create().

void* AVHWDeviceContext::user_opaque

Arbitrary user data, to be used e.g.

by the free() callback.

Definition at line 102 of file hwcontext.h.

Referenced by dxva2_device_create(), dxva2_device_free(), qsv_device_create(), qsv_device_free(), vaapi_device_create(), and vaapi_device_free().


The documentation for this struct was generated from the following file: