winegstreamer: Implement WMA DMO Get(Input|Output)CurrentType.

This commit is contained in:
Rémi Bernon 2024-05-24 12:01:08 +02:00 committed by Alexandre Julliard
parent d05cd460e4
commit 52ae7e7b64
2 changed files with 27 additions and 32 deletions

View file

@ -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);

View file

@ -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,