From: Rémi Bernon rbernon@codeweavers.com
--- dlls/mf/tests/transform.c | 85 ++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 38 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 06e638bea16..a115b6be490 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -709,8 +709,8 @@ static void check_mft_set_input_type(IMFTransform *transform, const struct attri IMFMediaType_Release(media_type); }
-#define check_mft_get_input_current_type(a, b) check_mft_get_input_current_type_(a, b, FALSE, FALSE) -static void check_mft_get_input_current_type_(IMFTransform *transform, const struct attribute_desc *attributes, +#define check_mft_get_input_current_type(a, b) check_mft_get_input_current_type_(__LINE__, a, b, FALSE, FALSE) +static void check_mft_get_input_current_type_(int line, IMFTransform *transform, const struct attribute_desc *attributes, BOOL todo_current, BOOL todo_compare) { HRESULT hr, expect_hr = attributes ? S_OK : MF_E_TRANSFORM_TYPE_NOT_SET; @@ -719,19 +719,21 @@ static void check_mft_get_input_current_type_(IMFTransform *transform, const str
hr = IMFTransform_GetInputCurrentType(transform, 0, ¤t_type); todo_wine_if(todo_current) - ok(hr == expect_hr, "GetInputCurrentType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == expect_hr, "GetInputCurrentType returned hr %#lx.\n", hr); if (FAILED(hr)) return;
hr = MFCreateMediaType(&media_type); - ok(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); init_media_type(media_type, attributes, -1);
hr = IMFMediaType_Compare(current_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_ALL_ITEMS, &result); - ok(hr == S_OK, "Compare returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "Compare returned hr %#lx.\n", hr); todo_wine_if(todo_compare) - ok(result, "got result %u.\n", !!result); + ok_(__FILE__, line)(result, "got result %u.\n", !!result); + + check_attributes_(__FILE__, line, (IMFAttributes *)current_type, attributes, -1);
IMFMediaType_Release(media_type); IMFMediaType_Release(current_type); @@ -785,24 +787,31 @@ static void check_mft_set_output_type(IMFTransform *transform, const struct attr IMFMediaType_Release(media_type); }
-#define check_mft_get_output_current_type(a, b) check_mft_get_output_current_type_(a, b, FALSE) -static void check_mft_get_output_current_type_(IMFTransform *transform, const struct attribute_desc *attributes, - BOOL todo_current) +#define check_mft_get_output_current_type(a, b) check_mft_get_output_current_type_(__LINE__, a, b, FALSE, FALSE) +static void check_mft_get_output_current_type_(int line, IMFTransform *transform, const struct attribute_desc *attributes, + BOOL todo_current, BOOL todo_compare) { HRESULT hr, expect_hr = attributes ? S_OK : MF_E_TRANSFORM_TYPE_NOT_SET; IMFMediaType *media_type, *current_type; + BOOL result;
hr = IMFTransform_GetOutputCurrentType(transform, 0, ¤t_type); todo_wine_if(todo_current) - ok(hr == expect_hr, "GetOutputCurrentType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == expect_hr, "GetOutputCurrentType returned hr %#lx.\n", hr); if (FAILED(hr)) return;
hr = MFCreateMediaType(&media_type); - ok(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); init_media_type(media_type, attributes, -1);
- check_attributes((IMFAttributes *)current_type, attributes, -1); + hr = IMFMediaType_Compare(current_type, (IMFAttributes *)media_type, + MF_ATTRIBUTES_MATCH_ALL_ITEMS, &result); + ok_(__FILE__, line)(hr == S_OK, "Compare returned hr %#lx.\n", hr); + todo_wine_if(todo_compare) + ok_(__FILE__, line)(result, "got result %u.\n", !!result); + + check_attributes_(__FILE__, line, (IMFAttributes *)current_type, attributes, -1);
IMFMediaType_Release(media_type); IMFMediaType_Release(current_type); @@ -3191,11 +3200,11 @@ static void test_wma_decoder(void)
/* setting output media type first doesn't work */ check_mft_set_output_type(transform, output_type_desc, MF_E_TRANSFORM_TYPE_NOT_SET); - check_mft_get_output_current_type_(transform, NULL, TRUE); + check_mft_get_output_current_type_(__LINE__, transform, NULL, TRUE, FALSE);
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_(__LINE__, transform, expect_input_type_desc, TRUE, FALSE);
check_mft_get_input_stream_info(transform, MF_E_TRANSFORM_TYPE_NOT_SET, NULL); check_mft_get_output_stream_info(transform, MF_E_TRANSFORM_TYPE_NOT_SET, NULL); @@ -3217,7 +3226,7 @@ static void test_wma_decoder(void)
check_mft_set_output_type_required(transform, output_type_desc); check_mft_set_output_type(transform, output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, expect_output_type_desc, TRUE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_type_desc, TRUE, FALSE);
check_mft_get_input_stream_info(transform, S_OK, &input_info); check_mft_get_output_stream_info(transform, S_OK, &output_info); @@ -4019,11 +4028,11 @@ static void test_h264_decoder(void) ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_H264), ATTR_RATIO(MF_MT_FRAME_SIZE, input_width, input_height), - ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 0), - ATTR_UINT32(MF_MT_DEFAULT_STRIDE, 0), - ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 0), - ATTR_UINT32(MF_MT_AVG_BIT_ERROR_RATE, 0), - ATTR_UINT32(MF_MT_COMPRESSED, 1), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_DEFAULT_STRIDE, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_AVG_BIT_ERROR_RATE, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_COMPRESSED, 1, .todo = TRUE), {0}, }; const struct attribute_desc expect_output_type_desc[] = @@ -4262,7 +4271,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, FALSE, TRUE); + check_mft_get_input_current_type_(__LINE__, 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); @@ -4284,7 +4293,7 @@ static void test_h264_decoder(void)
check_mft_set_output_type_required(transform, output_type_desc); check_mft_set_output_type(transform, output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_type_desc, FALSE, TRUE);
/* check that the output media type we've selected don't change the enumeration */
@@ -4382,7 +4391,7 @@ static void test_h264_decoder(void) ok(i == 5, "%lu output media types\n", i);
/* current output type is still the one we selected */ - check_mft_get_output_current_type_(transform, expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_type_desc, FALSE, TRUE);
hr = MFCreateCollection(&output_samples); ok(hr == S_OK, "MFCreateCollection returned %#lx\n", hr); @@ -4412,7 +4421,7 @@ static void test_h264_decoder(void) ret = IMFMediaType_Release(media_type); ok(ret == 1, "Release returned %lu\n", ret);
- check_mft_get_output_current_type_(transform, expect_new_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_new_output_type_desc, FALSE, TRUE);
output_sample = create_sample(NULL, actual_width * actual_height * 2); hr = check_mft_process_output(transform, output_sample, &output_status); @@ -4810,8 +4819,8 @@ static void test_audio_convert(void) ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050), ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 8), ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 22050 * 8), - ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1), - ATTR_UINT32(MF_MT_AUDIO_CHANNEL_MASK, 3), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1, .todo = TRUE), + ATTR_UINT32(MF_MT_AUDIO_CHANNEL_MASK, 3, .todo = TRUE), {0}, }; const struct attribute_desc expect_output_type_desc[] = @@ -4939,7 +4948,7 @@ static void test_audio_convert(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, FALSE, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, FALSE, TRUE);
check_mft_get_input_stream_info(transform, MF_E_TRANSFORM_TYPE_NOT_SET, NULL); check_mft_get_output_stream_info(transform, MF_E_TRANSFORM_TYPE_NOT_SET, NULL); @@ -4961,7 +4970,7 @@ static void test_audio_convert(void)
check_mft_set_output_type_required(transform, output_type_desc); check_mft_set_output_type(transform, output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_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); @@ -5414,11 +5423,11 @@ static void test_wmv_encoder(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, FALSE, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, FALSE, TRUE);
check_mft_set_output_type_required(transform, output_type_desc); check_mft_set_output_type(transform, output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_type_desc, FALSE, FALSE);
check_mft_get_input_stream_info(transform, S_OK, &expect_input_info); check_mft_get_output_stream_info(transform, S_OK, &expect_output_info); @@ -5975,7 +5984,7 @@ static void test_wmv_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, FALSE, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, FALSE, TRUE);
i = -1; while (SUCCEEDED(hr = IMFTransform_GetOutputAvailableType(transform, 0, ++i, &media_type))) @@ -5998,7 +6007,7 @@ static void test_wmv_decoder(void)
check_mft_set_output_type_required(transform, transform_tests[j].output_type_desc); check_mft_set_output_type(transform, transform_tests[j].output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, transform_tests[j].expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, transform_tests[j].expect_output_type_desc, FALSE, FALSE);
check_mft_get_input_stream_info(transform, S_OK, transform_tests[j].expect_input_info); check_mft_get_output_stream_info(transform, S_OK, transform_tests[j].expect_output_info); @@ -6914,10 +6923,10 @@ static void test_color_convert(void) ATTR_BLOB(MF_MT_MINIMUM_DISPLAY_APERTURE, &actual_aperture, 16), ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, actual_height), ATTR_UINT32(MF_MT_DEFAULT_STRIDE, actual_width), - ATTR_UINT32(MF_MT_SAMPLE_SIZE, actual_width * actual_height * 3 / 2), - ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1), - ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 1), - ATTR_RATIO(MF_MT_PIXEL_ASPECT_RATIO, 1, 1), + ATTR_UINT32(MF_MT_SAMPLE_SIZE, actual_width * actual_height * 3 / 2, .todo = TRUE), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1, .todo = TRUE), + ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 1, .todo = TRUE), + ATTR_RATIO(MF_MT_PIXEL_ASPECT_RATIO, 1, 1, .todo = TRUE), {0}, }; const struct attribute_desc expect_output_type_desc[] = @@ -7077,14 +7086,14 @@ static void test_color_convert(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, FALSE, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, FALSE, TRUE);
for (i = 0; i < ARRAY_SIZE(color_conversion_tests); i++) { winetest_push_context("color conversion #%lu", i); check_mft_set_output_type_required(transform, color_conversion_tests[i].output_type_desc); check_mft_set_output_type(transform, color_conversion_tests[i].output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, color_conversion_tests[i].expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, color_conversion_tests[i].expect_output_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);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/mf/tests/transform.c | 55 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index a115b6be490..a0c349cfcd5 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -692,19 +692,21 @@ static void check_mft_set_input_type_required_(int line, IMFTransform *transform ok_(__FILE__, line)(!ref, "Release returned %lu\n", ref); }
-static void check_mft_set_input_type(IMFTransform *transform, const struct attribute_desc *attributes) +#define check_mft_set_input_type(a, b) check_mft_set_input_type_(__LINE__, a, b, FALSE) +static void check_mft_set_input_type_(int line, IMFTransform *transform, const struct attribute_desc *attributes, BOOL todo) { IMFMediaType *media_type; HRESULT hr;
hr = MFCreateMediaType(&media_type); - ok(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); init_media_type(media_type, attributes, -1);
hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); - ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMFTransform_SetInputType(transform, 0, media_type, 0); - ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); + todo_wine_if(todo) + ok_(__FILE__, line)(hr == S_OK, "SetInputType returned %#lx.\n", hr);
IMFMediaType_Release(media_type); } @@ -7348,6 +7350,28 @@ static void test_video_processor(void) ATTR_UINT32(MF_MT_DEFAULT_STRIDE, actual_width * 2), {0}, }; + const struct attribute_desc nv12_no_aperture[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12), + ATTR_RATIO(MF_MT_FRAME_SIZE, 82, 84), + {0}, + }; + const struct attribute_desc nv12_with_aperture[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12), + ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, actual_height), + ATTR_BLOB(MF_MT_MINIMUM_DISPLAY_APERTURE, &actual_aperture, 16), + {0}, + }; + const struct attribute_desc rgb32_no_aperture[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32), + ATTR_RATIO(MF_MT_FRAME_SIZE, 82, 84), + {0}, + }; const MFT_OUTPUT_STREAM_INFO initial_output_info = {0}; const MFT_INPUT_STREAM_INFO initial_input_info = {0}; MFT_OUTPUT_STREAM_INFO output_info = {0}; @@ -7909,6 +7933,29 @@ static void test_video_processor(void) ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %ld\n", ret);
+ + /* check that it is possible to change input media type frame size using geometric aperture */ + + hr = CoCreateInstance(class_id, NULL, CLSCTX_INPROC_SERVER, + &IID_IMFTransform, (void **)&transform); + ok(hr == S_OK, "got hr %#lx\n", hr); + + check_mft_set_input_type(transform, nv12_no_aperture); + check_mft_get_input_current_type(transform, nv12_no_aperture); + + check_mft_set_output_type(transform, rgb32_no_aperture, S_OK); + check_mft_get_output_current_type(transform, rgb32_no_aperture); + + check_mft_set_input_type_(__LINE__, transform, nv12_with_aperture, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, nv12_with_aperture, TRUE, FALSE); + + /* output type is the same as before */ + check_mft_get_output_current_type(transform, rgb32_no_aperture); + + ret = IMFTransform_Release(transform); + ok(ret == 0, "Release returned %ld\n", ret); + + failed: winetest_pop_context(); CoUninitialize();
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=142827
Your paranoid android.
=== w8 (32 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w8adm (32 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w864 (32 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w1064v1507 (32 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w1064v1809 (32 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w1064_tsign (32 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w10pro64 (32 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w10pro64_en_AE_u8 (32 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w11pro64 (32 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w864 (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w1064v1507 (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w1064v1809 (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w1064_2qxl (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w1064_adm (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w1064_tsign (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w10pro64 (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w10pro64_ar (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w10pro64_ja (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w10pro64_zh_CN (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.
=== w11pro64_amd (64 bit report) ===
mf: transform.c:3885: Test failed: h264enc: got result 0.