27 return picture->
f.
data[3];
46 DXVA2_DecodeBufferDesc *dsc,
47 unsigned type,
const void *
data,
unsigned size,
54 if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->
decoder, type,
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 };
92 if (FAILED(IDirectXVideoDecoder_BeginFrame(ctx->
decoder,
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))) {
LPDIRECT3DSURFACE9 * surface
The array of Direct3D surfaces used to create the decoder.
unsigned surface_count
The number of surface in the surface array.
void * hwaccel_context
Hardware accelerator context.
void * ff_dxva2_get_surface(const Picture *picture)
void av_log(void *avcl, int level, const char *fmt,...)
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)
main external API structure.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
IDirectXVideoDecoder * decoder
DXVA2 decoder object.
This structure is used to provides the necessary configurations and data to the DXVA2 Libav HWAccel i...