From: Yuxuan Shui yshui@codeweavers.com
--- dlls/mf/tests/transform.c | 32 +++++++++++++++--------------- dlls/winegstreamer/video_decoder.c | 20 +++++++++++++++---- 2 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 7e8dae901b3..c680781cd91 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -7861,26 +7861,26 @@ static void test_wmv_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); + 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); + 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); + 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); + ok(hr == DMO_E_TYPE_NOT_SET, "GetInputCurrentType returned %#lx.\n", hr);
init_dmo_media_type_video(good_input_type, input_subtypes[0], width, height, 0); good_input_type->cbFormat = sizeof(VIDEOINFOHEADER); 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); + 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); + 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); + 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); + ok(hr == S_OK, "GetInputCurrentType returned %#lx.\n", hr); if (hr == S_OK) check_dmo_media_type(&type, good_input_type); MoFreeMediaType(&type);
@@ -8150,24 +8150,24 @@ static void test_wmv_decoder_dmo_output_type(void) hr = IMediaObject_SetOutputType(dmo, 0, NULL, DMO_SET_TYPEF_CLEAR); ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 1, NULL); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); + ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, NULL); - todo_wine ok(hr == E_POINTER, "GetOutputCurrentType returned %#lx.\n", hr); + ok(hr == E_POINTER, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 1, &type); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); + ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputCurrentType returned %#lx.\n", hr); + 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); hr = IMediaObject_GetOutputCurrentType(dmo, 1, NULL); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); + ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, NULL); - todo_wine ok(hr == E_POINTER, "GetOutputCurrentType returned %#lx.\n", hr); + ok(hr == E_POINTER, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 1, &type); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); + ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); - todo_wine ok(hr == S_OK, "GetOutputCurrentType returned %#lx.\n", hr); + ok(hr == S_OK, "GetOutputCurrentType returned %#lx.\n", hr); if (hr == S_OK) check_dmo_media_type(&type, good_output_type); MoFreeMediaType(&type);
diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index f2bef5ee959..a0b738b49d6 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -1334,14 +1334,26 @@ 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 video_decoder *decoder = impl_from_IMediaObject(iface); + TRACE("iface %p, index %lu, type %p stub!\n", iface, index, type); + + if (index != 0) return DMO_E_INVALIDSTREAMINDEX; + if (!type) return E_POINTER; + if (IsEqualGUID(&decoder->dmo_input_type.majortype, &GUID_NULL)) return DMO_E_TYPE_NOT_SET; + + return CopyMediaType(type, &decoder->dmo_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 video_decoder *decoder = impl_from_IMediaObject(iface); + TRACE("iface %p, index %lu, type %p stub!\n", iface, index, type); + + if (index != 0) return DMO_E_INVALIDSTREAMINDEX; + if (!type) return E_POINTER; + if (IsEqualGUID(&decoder->dmo_output_type.majortype, &GUID_NULL)) return DMO_E_TYPE_NOT_SET; + + return CopyMediaType(type, &decoder->dmo_output_type); }
static HRESULT WINAPI media_object_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size,