From deff1303fb822085b84653870194144ebce81067 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 13 Oct 2023 18:56:48 -0600 Subject: [PATCH] winegstreamer: Add AVDecVideoAcceleration_H264 attribute for h264 decoder MFT. --- dlls/mf/tests/transform.c | 3 +++ dlls/winegstreamer/h264_decoder.c | 7 +++++++ include/codecapi.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index e798601a8b5..3f5524784cc 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -45,6 +45,8 @@ #include "initguid.h" +#include "codecapi.h" + #include "d3d11_4.h" DEFINE_GUID(DMOVideoFormat_RGB24,D3DFMT_R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); @@ -3933,6 +3935,7 @@ static void test_h264_decoder(void) ATTR_UINT32(MF_SA_D3D11_AWARE, 1), ATTR_UINT32(MFT_DECODER_EXPOSE_OUTPUT_TYPES_IN_NATIVE_ORDER, 0, .todo = TRUE), /* more H264 decoder specific attributes from CODECAPI */ + ATTR_UINT32(AVDecVideoAcceleration_H264, 1), {0}, }; static const DWORD input_width = 120, input_height = 248; diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index 6d8f2a146da..5c48130eee9 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -26,6 +26,10 @@ #include "wine/debug.h" +#include "initguid.h" + +#include "codecapi.h" + WINE_DEFAULT_DEBUG_CHANNEL(mfplat); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -881,6 +885,9 @@ HRESULT h264_decoder_create(REFIID riid, void **ret) goto failed; if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_SA_D3D11_AWARE, TRUE))) goto failed; + if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &AVDecVideoAcceleration_H264, TRUE))) + goto failed; + if (FAILED(hr = MFCreateAttributes(&decoder->output_attributes, 0))) goto failed; if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) diff --git a/include/codecapi.h b/include/codecapi.h index 9719389b081..a9fe7c9de3f 100644 --- a/include/codecapi.h +++ b/include/codecapi.h @@ -61,4 +61,6 @@ enum eAVEncH264VLevel eAVEncH264VLevel5_2 = 52 }; +DEFINE_GUID(AVDecVideoAcceleration_H264, 0xf7db8a2f, 0x4f48, 0x4ee8, 0xae, 0x31, 0x8b, 0x6e, 0xbe, 0x55, 0x8a, 0xe2); + #endif /* __CODECAPI_H */