FFmpeg
Data Structures | Macros | Functions
d3d12va_decode.h File Reference
#include "libavutil/fifo.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_d3d12va.h"
#include "avcodec.h"
#include "internal.h"
#include "hwaccel_internal.h"

Go to the source code of this file.

Data Structures

struct  D3D12VADecodeContext
 This structure is used to provide the necessary configurations and data to the FFmpeg Direct3D 12 HWAccel implementation for video decoder. More...
 

Macros

#define D3D12VA_VIDEO_DEC_ASYNC_DEPTH   36
 
#define D3D12VA_DECODE_CONTEXT(avctx)   ((D3D12VADecodeContext *)((avctx)->internal->hwaccel_priv_data))
 
#define D3D12VA_FRAMES_CONTEXT(avctx)   ((AVHWFramesContext *)(avctx)->hw_frames_ctx->data)
 

Functions

int ff_d3d12va_get_suitable_max_bitstream_size (AVCodecContext *avctx)
 Get a suitable maximum bitstream size. More...
 
int ff_d3d12va_decode_init (AVCodecContext *avctx)
 init D3D12VADecodeContext More...
 
int ff_d3d12va_decode_uninit (AVCodecContext *avctx)
 uninit D3D12VADecodeContext More...
 
int ff_d3d12va_common_frame_params (AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
 d3d12va common frame params More...
 
int ff_d3d12va_common_end_frame (AVCodecContext *avctx, AVFrame *frame, const void *pp, unsigned pp_size, const void *qm, unsigned qm_size, int(*)(AVCodecContext *, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *, ID3D12Resource *))
 d3d12va common end frame More...
 

Macro Definition Documentation

◆ D3D12VA_VIDEO_DEC_ASYNC_DEPTH

#define D3D12VA_VIDEO_DEC_ASYNC_DEPTH   36

Definition at line 127 of file d3d12va_decode.h.

◆ D3D12VA_DECODE_CONTEXT

#define D3D12VA_DECODE_CONTEXT (   avctx)    ((D3D12VADecodeContext *)((avctx)->internal->hwaccel_priv_data))

Definition at line 128 of file d3d12va_decode.h.

◆ D3D12VA_FRAMES_CONTEXT

#define D3D12VA_FRAMES_CONTEXT (   avctx)    ((AVHWFramesContext *)(avctx)->hw_frames_ctx->data)

Definition at line 129 of file d3d12va_decode.h.

Function Documentation

◆ ff_d3d12va_get_suitable_max_bitstream_size()

int ff_d3d12va_get_suitable_max_bitstream_size ( AVCodecContext avctx)

Get a suitable maximum bitstream size.

Creating and destroying a resource on d3d12 needs sync and reallocation, so use this function to help allocate a big enough bitstream buffer to avoid recreating resources when decoding.

Returns
the suitable size

Definition at line 44 of file d3d12va_decode.c.

Referenced by d3d12va_av1_decode_init(), and ff_d3d12va_decode_init().

◆ ff_d3d12va_decode_init()

int ff_d3d12va_decode_init ( AVCodecContext avctx)

◆ ff_d3d12va_decode_uninit()

int ff_d3d12va_decode_uninit ( AVCodecContext avctx)

uninit D3D12VADecodeContext

Returns
Error code (ret < 0 if failed)

Definition at line 373 of file d3d12va_decode.c.

Referenced by d3d12va_av1_decode_uninit(), and ff_d3d12va_decode_init().

◆ ff_d3d12va_common_frame_params()

int ff_d3d12va_common_frame_params ( AVCodecContext avctx,
AVBufferRef hw_frames_ctx 
)

d3d12va common frame params

Returns
Error code (ret < 0 if failed)

Definition at line 271 of file d3d12va_decode.c.

◆ ff_d3d12va_common_end_frame()

int ff_d3d12va_common_end_frame ( AVCodecContext avctx,
AVFrame frame,
const void *  pp,
unsigned  pp_size,
const void *  qm,
unsigned  qm_size,
int(*)(AVCodecContext *, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *, ID3D12Resource *)   
)

d3d12va common end frame

Parameters
avctxcodec context
framecurrent output frame
pppicture parameters
pp_sizethe size of the picture parameters
qmquantization matrix
qm_sizethe size of the quantization matrix
callbackupdate decoder-specified input stream arguments
Returns
Error code (ret < 0 if failed)

Definition at line 434 of file d3d12va_decode.c.

Referenced by d3d12va_av1_end_frame(), d3d12va_h264_end_frame(), d3d12va_hevc_end_frame(), d3d12va_mpeg2_end_frame(), d3d12va_vc1_end_frame(), and d3d12va_vp9_end_frame().