Module: wine Branch: master Commit: 6aca31f1a1662ec9a2ab720c31ea981f31af4d7f URL: https://gitlab.winehq.org/wine/wine/-/commit/6aca31f1a1662ec9a2ab720c31ea981...
Author: Rémi Bernon rbernon@codeweavers.com Date: Wed Jan 24 14:47:55 2024 +0100
winegstreamer: Implement H264 decoder GetInputCurrentType.
---
dlls/mf/tests/mf.c | 4 ---- dlls/mf/tests/transform.c | 2 +- dlls/winegstreamer/h264_decoder.c | 16 +++++++++++++--- 3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index ea801bf3af5..902d0ffa8c0 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -3622,15 +3622,11 @@ todo_wine { IUnknown_Release(node_object);
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); - todo_wine ok(hr == S_OK, "Failed to get transform input type, hr %#lx.\n", hr); - if (hr == S_OK) - { hr = IMFMediaType_Compare(input_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &ret); ok(hr == S_OK, "Failed to compare media types, hr %#lx.\n", hr); ok(ret, "Input type of first transform doesn't match source node type.\n"); IMFMediaType_Release(media_type); - }
hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); ok(hr == S_OK, "Failed to get transform input type, hr %#lx.\n", hr); diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index f9e6b3b45cd..06e638bea16 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -4262,7 +4262,7 @@ static void test_h264_decoder(void)
check_mft_set_input_type_required(transform, input_type_desc); check_mft_set_input_type(transform, input_type_desc); - check_mft_get_input_current_type_(transform, expect_input_type_desc, TRUE, FALSE); + check_mft_get_input_current_type_(transform, expect_input_type_desc, FALSE, TRUE);
check_mft_get_input_stream_info(transform, S_OK, &input_info); check_mft_get_output_stream_info(transform, S_OK, &output_info); diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index 5c48130eee9..a187c744549 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -574,8 +574,18 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) { - FIXME("iface %p, id %#lx, type %p stub!\n", iface, id, type); - return E_NOTIMPL; + struct h264_decoder *decoder = impl_from_IMFTransform(iface); + HRESULT hr; + + TRACE("iface %p, id %#lx, type %p\n", iface, id, type); + + if (!decoder->input_type) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + if (FAILED(hr = MFCreateMediaType(type))) + return hr; + + return IMFMediaType_CopyAllItems(decoder->input_type, (IMFAttributes *)*type); }
static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) @@ -583,7 +593,7 @@ static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD struct h264_decoder *decoder = impl_from_IMFTransform(iface); HRESULT hr;
- FIXME("iface %p, id %#lx, type %p stub!\n", iface, id, type); + TRACE("iface %p, id %#lx, type %p\n", iface, id, type);
if (!decoder->output_type) return MF_E_TRANSFORM_TYPE_NOT_SET;