Module: wine Branch: master Commit: 08fa6367b05dc1ff7ef4310e91c3e5cc29ec035f URL: https://gitlab.winehq.org/wine/wine/-/commit/08fa6367b05dc1ff7ef4310e91c3e5c...
Author: Ziqing Hui zhui@codeweavers.com Date: Wed Apr 24 10:31:51 2024 +0800
winegstreamer/video_decoder: Change decoder attributes.
---
dlls/mf/tests/transform.c | 4 ++-- dlls/winegstreamer/video_decoder.c | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index d1d52d62458..2a90c49f96e 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -3932,9 +3932,9 @@ static void test_h264_decoder(void) static const struct attribute_desc expect_transform_attributes[] = { ATTR_UINT32(MF_LOW_LATENCY, 0), - ATTR_UINT32(MF_SA_D3D_AWARE, 1, .todo = TRUE), + ATTR_UINT32(MF_SA_D3D_AWARE, 1), ATTR_UINT32(MF_SA_D3D11_AWARE, 1), - ATTR_UINT32(MFT_DECODER_EXPOSE_OUTPUT_TYPES_IN_NATIVE_ORDER, 0, .todo = TRUE), + ATTR_UINT32(MFT_DECODER_EXPOSE_OUTPUT_TYPES_IN_NATIVE_ORDER, 0), /* more H264 decoder specific attributes from CODECAPI */ ATTR_UINT32(AVDecVideoAcceleration_H264, 1), {0}, diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 61ae579686e..2aedbdf1402 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -835,11 +835,11 @@ static HRESULT video_decoder_create_with_types(const GUID *const *input_types, U goto failed; if (FAILED(hr = MFCreateAttributes(&decoder->attributes, 16))) goto failed; - if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_LOW_LATENCY, 0))) - 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))) + if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_LOW_LATENCY, FALSE)) + || FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_SA_D3D_AWARE, TRUE)) + || FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_SA_D3D11_AWARE, TRUE)) + || FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, + &MFT_DECODER_EXPOSE_OUTPUT_TYPES_IN_NATIVE_ORDER, FALSE))) goto failed;
if (FAILED(hr = MFCreateAttributes(&decoder->output_attributes, 0))) @@ -909,6 +909,12 @@ HRESULT h264_decoder_create(REFIID riid, void **out) return hr; decoder = impl_from_IMFTransform(iface);
+ if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &AVDecVideoAcceleration_H264, TRUE))) + { + IMFTransform_Release(iface); + return hr; + } + decoder->input_info.dwFlags = MFT_INPUT_STREAM_WHOLE_SAMPLES | MFT_INPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER | MFT_INPUT_STREAM_FIXED_SAMPLE_SIZE; decoder->input_info.cbSize = 0x1000;