From: Yuxuan Shui yshui@codeweavers.com
--- dlls/mf/tests/transform.c | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index e5c65ace228..7e8dae901b3 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -7857,6 +7857,33 @@ static void test_wmv_decoder_dmo_input_type(void) winetest_pop_context(); }
+ /* Test GetInputCurrentType. */ + 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 == 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 == 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); + 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); + init_dmo_media_type_video(good_input_type, input_subtype, width, height, 0); header->dwBitRate = 0xdeadbeef; header->dwBitErrorRate = 0xdeadbeef; @@ -8119,8 +8146,31 @@ static void test_wmv_decoder_dmo_output_type(void) hr = IMediaObject_SetOutputType(dmo, 0, bad_output_type, 0x4); ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "SetOutputType returned %#lx.\n", hr);
+ /* Test GetOutputCurrentType. */ + 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); + hr = IMediaObject_GetOutputCurrentType(dmo, 0, NULL); + todo_wine 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); + hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); + todo_wine 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); + hr = IMediaObject_GetOutputCurrentType(dmo, 0, NULL); + todo_wine 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); + hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); + todo_wine ok(hr == S_OK, "GetOutputCurrentType returned %#lx.\n", hr); + if (hr == S_OK) check_dmo_media_type(&type, good_output_type); + MoFreeMediaType(&type); + hr = IMediaObject_SetOutputType(dmo, 0, good_output_type, DMO_SET_TYPEF_CLEAR); ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); hr = IMediaObject_SetOutputType(dmo, 0, good_output_type, DMO_SET_TYPEF_TEST_ONLY);