35 return frame->
data[3];
54 DXVA2_DecodeBufferDesc *dsc,
63 hr = IDirectXVideoDecoder_GetBuffer(ctx->
decoder, type,
64 &dxva_data, &dxva_size);
70 if (size <= dxva_size) {
71 memcpy(dxva_data, data, size);
73 memset(dsc, 0,
sizeof(*dsc));
74 dsc->CompressedBufferType =
type;
76 dsc->NumMBsInBuffer = mb_count;
84 hr = IDirectXVideoDecoder_ReleaseBuffer(ctx->
decoder, type);
87 "Failed to release buffer type %u: 0x%lx\n",
95 const void *pp,
unsigned pp_size,
96 const void *qm,
unsigned qm_size,
98 DXVA2_DecodeBufferDesc *bs,
99 DXVA2_DecodeBufferDesc *slice))
102 unsigned buffer_count = 0;
103 DXVA2_DecodeBufferDesc
buffer[4];
104 DXVA2_DecodeExecuteParams exec = { 0 };
105 int result, runs = 0;
109 hr = IDirectXVideoDecoder_BeginFrame(ctx->
decoder,
114 }
while (hr == E_PENDING && ++runs < 50);
122 DXVA2_PictureParametersBufferType,
126 "Failed to add picture parameter buffer\n");
133 DXVA2_InverseQuantizationMatrixBufferType,
137 "Failed to add inverse quantization matrix buffer\n");
143 result = commit_bs_si(avctx,
144 &buffer[buffer_count + 0],
145 &buffer[buffer_count + 1]);
148 "Failed to add bitstream or slice control buffer\n");
155 assert(buffer_count == 1 + (qm_size > 0) + 2);
157 exec.NumCompBuffers = buffer_count;
158 exec.pCompressedBuffers =
buffer;
159 exec.pExtensionData =
NULL;
160 hr = IDirectXVideoDecoder_Execute(ctx->
decoder, &exec);
167 hr = IDirectXVideoDecoder_EndFrame(ctx->
decoder,
NULL);