FFmpeg
Data Fields
FFHWAccel Struct Reference

#include <hwaccel_internal.h>

Data Fields

AVHWAccel p
 The public AVHWAccel. More...
 
int(* alloc_frame )(AVCodecContext *avctx, AVFrame *frame)
 Allocate a custom buffer. More...
 
int(* start_frame )(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)
 Called at the beginning of each frame or field picture. More...
 
int(* decode_params )(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size)
 Callback for parameter data (SPS/PPS/VPS etc). More...
 
int(* decode_slice )(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)
 Callback for each slice. More...
 
int(* end_frame )(AVCodecContext *avctx)
 Called at the end of each frame or field picture. More...
 
int frame_priv_data_size
 Size of per-frame hardware accelerator private data. More...
 
int priv_data_size
 Size of the private data to allocate in AVCodecInternal.hwaccel_priv_data. More...
 
int caps_internal
 Internal hwaccel capabilities. More...
 
int(* init )(AVCodecContext *avctx)
 Initialize the hwaccel private data. More...
 
int(* uninit )(AVCodecContext *avctx)
 Uninitialize the hwaccel private data. More...
 
int(* frame_params )(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
 Fill the given hw_frames context with current codec parameters. More...
 
int(* update_thread_context )(AVCodecContext *dst, const AVCodecContext *src)
 Copy necessary context variables from a previous thread context to the current one. More...
 
void(* free_frame_priv )(FFRefStructOpaque hwctx, void *data)
 Callback to free the hwaccel-specific frame data. More...
 
void(* flush )(AVCodecContext *avctx)
 Callback to flush the hwaccel state. More...
 

Detailed Description

Definition at line 34 of file hwaccel_internal.h.

Field Documentation

◆ p

AVHWAccel FFHWAccel::p

The public AVHWAccel.

See avcodec.h for it.

Definition at line 38 of file hwaccel_internal.h.

◆ alloc_frame

int(* FFHWAccel::alloc_frame) (AVCodecContext *avctx, AVFrame *frame)

Allocate a custom buffer.

Definition at line 43 of file hwaccel_internal.h.

◆ start_frame

int(* FFHWAccel::start_frame) (AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)

Called at the beginning of each frame or field picture.

Meaningful frame information (codec specific) is guaranteed to be parsed at this point. This function is mandatory.

Note that buf can be NULL along with buf_size set to 0. Otherwise, this means the whole frame is available at this point.

Parameters
avctxthe codec context
bufthe frame data buffer base
buf_sizethe size of the frame in bytes
Returns
zero if successful, a negative value otherwise

Definition at line 59 of file hwaccel_internal.h.

◆ decode_params

int(* FFHWAccel::decode_params) (AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size)

Callback for parameter data (SPS/PPS/VPS etc).

Useful for hardware decoders which keep persistent state about the video parameters, and need to receive any changes to update that state.

Parameters
avctxthe codec context
typethe nal unit type
bufthe nal unit data buffer
buf_sizethe size of the nal unit in bytes
Returns
zero if successful, a negative value otherwise

Definition at line 73 of file hwaccel_internal.h.

◆ decode_slice

int(* FFHWAccel::decode_slice) (AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)

Callback for each slice.

Meaningful slice information (codec specific) is guaranteed to be parsed at this point. This function is mandatory.

Parameters
avctxthe codec context
bufthe slice data buffer base
buf_sizethe size of the slice in bytes
Returns
zero if successful, a negative value otherwise

Definition at line 86 of file hwaccel_internal.h.

◆ end_frame

int(* FFHWAccel::end_frame) (AVCodecContext *avctx)

Called at the end of each frame or field picture.

The whole picture is parsed at this point and can now be sent to the hardware accelerator. This function is mandatory.

Parameters
avctxthe codec context
Returns
zero if successful, a negative value otherwise

Definition at line 97 of file hwaccel_internal.h.

◆ frame_priv_data_size

int FFHWAccel::frame_priv_data_size

Size of per-frame hardware accelerator private data.

Private data is allocated with av_mallocz() before AVCodecContext.get_buffer() and deallocated after AVCodecContext.release_buffer().

Definition at line 106 of file hwaccel_internal.h.

◆ priv_data_size

int FFHWAccel::priv_data_size

Size of the private data to allocate in AVCodecInternal.hwaccel_priv_data.

Definition at line 112 of file hwaccel_internal.h.

Referenced by avcodec_get_hw_frames_parameters().

◆ caps_internal

int FFHWAccel::caps_internal

Internal hwaccel capabilities.

Definition at line 117 of file hwaccel_internal.h.

Referenced by ff_thread_finish_setup(), frame_worker_thread(), and hwaccel_serial().

◆ init

int(* FFHWAccel::init) (AVCodecContext *avctx)

Initialize the hwaccel private data.

This will be called from ff_get_format(), after hwaccel and hwaccel_context are set and the hwaccel private data in AVCodecInternal is allocated.

Definition at line 126 of file hwaccel_internal.h.

◆ uninit

int(* FFHWAccel::uninit) (AVCodecContext *avctx)

Uninitialize the hwaccel private data.

This will be called from get_format() or ff_codec_close(), after hwaccel and hwaccel_context are already uninitialized.

Definition at line 134 of file hwaccel_internal.h.

◆ frame_params

int(* FFHWAccel::frame_params) (AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)

Fill the given hw_frames context with current codec parameters.

Called from get_format. Refer to avcodec_get_hw_frames_parameters() for details.

This CAN be called before AVHWAccel.init is called, and you must assume that avctx->hwaccel_priv_data is invalid.

Definition at line 144 of file hwaccel_internal.h.

Referenced by avcodec_get_hw_frames_parameters().

◆ update_thread_context

int(* FFHWAccel::update_thread_context) (AVCodecContext *dst, const AVCodecContext *src)

Copy necessary context variables from a previous thread context to the current one.

For thread-safe hwaccels only.

Definition at line 150 of file hwaccel_internal.h.

◆ free_frame_priv

void(* FFHWAccel::free_frame_priv) (FFRefStructOpaque hwctx, void *data)

Callback to free the hwaccel-specific frame data.

Parameters
hwctxa pointer to an AVHWDeviceContext.
datathe per-frame hardware accelerator private data to be freed.

Definition at line 158 of file hwaccel_internal.h.

◆ flush

void(* FFHWAccel::flush) (AVCodecContext *avctx)

Callback to flush the hwaccel state.

Definition at line 163 of file hwaccel_internal.h.


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