Unwrap resource list passed to ID3D11VideoContext2::DecoderExtension

This commit is contained in:
baldurk
2019-03-26 18:54:48 +00:00
parent d4c71e5b62
commit 6f07cc3ac4
+15 -1
View File
@@ -549,7 +549,21 @@ APP_DEPRECATED_HRESULT STDMETHODCALLTYPE WrappedID3D11VideoContext2::DecoderExte
/* [annotation] */ _In_ ID3D11VideoDecoder *pDecoder,
/* [annotation] */ _In_ const D3D11_VIDEO_DECODER_EXTENSION *pExtensionData)
{
return m_pReal->DecoderExtension(VIDEO_UNWRAP(WrappedID3D11VideoDecoder, pDecoder), pExtensionData);
if(pExtensionData == NULL)
return m_pReal->DecoderExtension(VIDEO_UNWRAP(WrappedID3D11VideoDecoder, pDecoder),
pExtensionData);
D3D11_VIDEO_DECODER_EXTENSION unwrappedExt = *pExtensionData;
std::vector<ID3D11Resource *> unwrappedRes;
unwrappedRes.resize(unwrappedExt.ResourceCount);
for(UINT i = 0; i < unwrappedExt.ResourceCount; i++)
unwrappedRes[i] = UnwrapD3D11Resource(unwrappedExt.ppResourceList[i]);
unwrappedExt.ppResourceList = unwrappedRes.data();
return m_pReal->DecoderExtension(VIDEO_UNWRAP(WrappedID3D11VideoDecoder, pDecoder), &unwrappedExt);
}
void STDMETHODCALLTYPE WrappedID3D11VideoContext2::VideoProcessorSetOutputTargetRect(