27 return picture->
f.
data[3];
46 DXVA2_DecodeBufferDesc *dsc,
55 &dxva_data, &dxva_size))) {
59 if (size <= dxva_size) {
60 memcpy(dxva_data, data, size);
62 memset(dsc, 0,
sizeof(*dsc));
63 dsc->CompressedBufferType =
type;
65 dsc->NumMBsInBuffer = mb_count;
72 if (
FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->
decoder, type))) {
80 const void *pp,
unsigned pp_size,
81 const void *qm,
unsigned qm_size,
83 DXVA2_DecodeBufferDesc *bs,
84 DXVA2_DecodeBufferDesc *slice))
87 unsigned buffer_count = 0;
88 DXVA2_DecodeBufferDesc
buffer[4];
89 DXVA2_DecodeExecuteParams exec = { 0 };
100 DXVA2_PictureParametersBufferType,
104 "Failed to add picture parameter buffer\n");
111 DXVA2_InverseQuantizationMatrixBufferType,
115 "Failed to add inverse quantization matrix buffer\n");
121 result = commit_bs_si(avctx,
122 &buffer[buffer_count + 0],
123 &buffer[buffer_count + 1]);
126 "Failed to add bitstream or slice control buffer\n");
133 assert(buffer_count == 1 + (qm_size > 0) + 2);
135 exec.NumCompBuffers = buffer_count;
136 exec.pCompressedBuffers =
buffer;
137 exec.pExtensionData = NULL;
138 if (
FAILED(IDirectXVideoDecoder_Execute(ctx->
decoder, &exec))) {
144 if (
FAILED(IDirectXVideoDecoder_EndFrame(ctx->
decoder, NULL))) {
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
unsigned surface_count
The number of surface in the surface array.
static av_cold int end(AVCodecContext *avctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * ff_dxva2_get_surface(const Picture *picture)
int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic, const void *pp, unsigned pp_size, const void *qm, unsigned qm_size, int(*commit_bs_si)(AVCodecContext *, DXVA2_DecodeBufferDesc *bs, DXVA2_DecodeBufferDesc *slice))
int ff_dxva2_commit_buffer(AVCodecContext *avctx, struct dxva_context *ctx, DXVA2_DecodeBufferDesc *dsc, unsigned type, const void *data, unsigned size, unsigned mb_count)
unsigned ff_dxva2_get_surface_index(const struct dxva_context *ctx, const Picture *picture)
void * hwaccel_context
Hardware accelerator context.
main external API structure.
LPDIRECT3DSURFACE9 * surface
The array of Direct3D surfaces used to create the decoder.
IDirectXVideoDecoder * decoder
DXVA2 decoder object.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
This structure is used to provides the necessary configurations and data to the DXVA2 FFmpeg HWAccel ...