Module: wine Branch: master Commit: 52ae7e7b642195777b62986110f878b437b7d194 URL: https://gitlab.winehq.org/wine/wine/-/commit/52ae7e7b642195777b62986110f878b...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri May 24 12:01:08 2024 +0200
winegstreamer: Implement WMA DMO Get(Input|Output)CurrentType.
---
dlls/mf/tests/transform.c | 33 +++++---------------------------- dlls/winegstreamer/wma_decoder.c | 26 ++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 32 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index e7d8f924b70..0291fe16e18 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -3519,37 +3519,26 @@ static void test_wma_decoder_dmo_input_type(void) hr = IMediaObject_SetInputType(dmo, 0, NULL, DMO_SET_TYPEF_CLEAR); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 1, NULL); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, NULL); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 1, &type); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, &type); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "GetInputCurrentType returned %#lx.\n", hr);
hr = IMediaObject_SetInputType(dmo, 0, good_input_type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 1, NULL); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, NULL); - todo_wine ok(hr == E_POINTER, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 1, &type); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, &type); - todo_wine ok(hr == S_OK, "GetInputCurrentType returned %#lx.\n", hr); - if (hr == S_OK) - { - check_dmo_media_type(&type, good_input_type); - MoFreeMediaType(&type); - } + check_dmo_media_type(&type, good_input_type); + MoFreeMediaType(&type);
/* Cleanup. */ ret = IMediaObject_Release(dmo); @@ -3721,8 +3710,6 @@ static void test_wma_decoder_dmo_output_type(void) /* Test GetOutputCurrentType. */ hr = IMediaObject_SetOutputType(dmo, 0, NULL, DMO_SET_TYPEF_CLEAR); ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); - todo_wine - { hr = IMediaObject_GetOutputCurrentType(dmo, 1, NULL); ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, NULL); @@ -3731,12 +3718,9 @@ static void test_wma_decoder_dmo_output_type(void) ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputCurrentType returned %#lx.\n", hr); - }
hr = IMediaObject_SetOutputType(dmo, 0, good_output_type, 0); ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); - todo_wine - { hr = IMediaObject_GetOutputCurrentType(dmo, 1, NULL); ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, NULL); @@ -3745,12 +3729,8 @@ static void test_wma_decoder_dmo_output_type(void) ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); ok(hr == S_OK, "GetOutputCurrentType returned %#lx.\n", hr); - } - if (hr == S_OK) - { - check_dmo_media_type(&type, good_output_type); - MoFreeMediaType(&type); - } + check_dmo_media_type(&type, good_output_type); + MoFreeMediaType(&type);
/* Test GetOutputSizeInfo. */ hr = IMediaObject_GetOutputSizeInfo(dmo, 1, NULL, NULL); @@ -3767,20 +3747,17 @@ static void test_wma_decoder_dmo_output_type(void) ok(alignment == 1, "Unexpected alignment %lu.\n", alignment);
hr = IMediaObject_GetInputCurrentType(dmo, 0, input_type); - todo_wine ok(hr == S_OK, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_SetInputType(dmo, 0, input_type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); - todo_wine ok(hr == S_OK, "GetOutputCurrentType returned %#lx.\n", hr);
init_dmo_media_type_audio(input_type, input_subtype, channel_count, rate * 2, 32); hr = IMediaObject_SetInputType(dmo, 0, input_type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); - todo_wine - ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputCurrentType returned %#lx.\n", hr); + todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputCurrentType returned %#lx.\n", hr);
/* Cleanup. */ ret = IMediaObject_Release(dmo); diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index bc11383fc64..8aa55b9b137 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -813,14 +813,32 @@ static HRESULT WINAPI media_object_SetOutputType(IMediaObject *iface, DWORD inde
static HRESULT WINAPI media_object_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) { - FIXME("iface %p, index %lu, type %p stub!\n", iface, index, type); - return E_NOTIMPL; + struct wma_decoder *decoder = impl_from_IMediaObject(iface); + + TRACE("iface %p, index %lu, type %p\n", iface, index, type); + + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (IsEqualGUID(&decoder->input_type.majortype, &GUID_NULL)) + return DMO_E_TYPE_NOT_SET; + if (!type) + return E_POINTER; + return MoCopyMediaType(type, &decoder->input_type); }
static HRESULT WINAPI media_object_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) { - FIXME("iface %p, index %lu, type %p stub!\n", iface, index, type); - return E_NOTIMPL; + struct wma_decoder *decoder = impl_from_IMediaObject(iface); + + TRACE("iface %p, index %lu, type %p\n", iface, index, type); + + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (IsEqualGUID(&decoder->output_type.majortype, &GUID_NULL)) + return DMO_E_TYPE_NOT_SET; + if (!type) + return E_POINTER; + return MoCopyMediaType(type, &decoder->output_type); }
static HRESULT WINAPI media_object_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size,