From: Rémi Bernon rbernon@codeweavers.com
--- dlls/mf/tests/resource.rc | 4 ++ dlls/mf/tests/rgb32frame-bogus.bmp | Bin 0 -> 36918 bytes dlls/mf/tests/transform.c | 66 +++++++++++++++++++++++++++-- 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 dlls/mf/tests/rgb32frame-bogus.bmp
diff --git a/dlls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index d9595c68980..a8fe550b475 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -109,6 +109,10 @@ rgb32frame-flip.bmp RCDATA rgb32frame-flip.bmp /* @makedep: rgb32frame-grabber.bmp */ rgb32frame-grabber.bmp RCDATA rgb32frame-grabber.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-bogus.bmp */ +rgb32frame-bogus.bmp RCDATA rgb32frame-bogus.bmp + /* Generated from running the tests on Windows */ /* @makedep: rgb555frame.bmp */ rgb555frame.bmp RCDATA rgb555frame.bmp diff --git a/dlls/mf/tests/rgb32frame-bogus.bmp b/dlls/mf/tests/rgb32frame-bogus.bmp new file mode 100644 index 0000000000000000000000000000000000000000..d0c5c4e4d64172ada2dc20b4a06f3e359a5d9f2f GIT binary patch literal 36918 zcmeI4KW-H<5XOxn8mK7wQ&51!3332>Xd-%U07u{ih+_avPLcyqMx;kVf+A7gvLTs} z8P@SPv-aA%o+nM5@qV7Mf8XY9ltg*?YX4LC``RBrz8K@}Ron?r$Ir&s)%DBd^5c=e zoPZN>0#3jQH~}Z%1e|~qZ~{)i2{-{K-~={JV7J=^kNFI&H_7l}2$pcqxMx=WR*n|W zF4kE4wZ3j?{#G7a^=&Qux9Z#0`M2(y^XJb)t6#KE`#x#qPkpGbk2W8z{E0XDpdD#_ z@8ewlR(@K)NN?@e>bhF|tvtvF?P%>+dfnRiTX|^xBK?<P2qnYHzvP};s!cv<$K%mA zB&__A+C6JfzpVUa{l{mg!9&l$%3rdUexUimub-jku=3Bv4E0Is!f+n85L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j-m*6`0c)7yARzc^JqlXYVGv%4q3BhCOP&Xs=vp`gdt
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 468239b0fd4..3bd13384620 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -7368,9 +7368,9 @@ static void test_video_processor(void) }; 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), + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32, .required = TRUE), + ATTR_RATIO(MF_MT_FRAME_SIZE, 82, 84, .required = TRUE), {0}, }; const MFT_OUTPUT_STREAM_INFO initial_output_info = {0}; @@ -7395,6 +7395,18 @@ static void test_video_processor(void) .buffer_count = 1, .buffers = &rgb32_buffer_desc, };
+ const struct buffer_desc rgb32_cropped_buffer_desc = + { + .length = 82 * 84 * 4, + .compare = compare_rgb32, .dump = dump_rgb32, + }; + const struct sample_desc rgb32_cropped_sample_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &rgb32_cropped_buffer_desc, + }; + const struct buffer_desc rgb555_buffer_desc = { .length = actual_width * actual_height * 2, @@ -7501,6 +7513,14 @@ static void test_video_processor(void) .output_sample_desc = &rgb555_sample_desc, .result_bitmap = L"rgb555frame-flip.bmp", .delta = 4, /* Windows returns 0, Wine needs 4 */ }, + { + .input_type_desc = rgb32_no_aperture, .output_type_desc = rgb32_with_aperture, + .output_sample_desc = &rgb32_sample_desc, .result_bitmap = L"rgb32frame-bogus.bmp", + }, + { + .input_type_desc = rgb32_with_aperture, .output_type_desc = rgb32_no_aperture, + .output_sample_desc = &rgb32_cropped_sample_desc, .result_bitmap = L"rgb32frame.bmp", + }, };
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Video, MFVideoFormat_NV12}; @@ -7823,6 +7843,23 @@ static void test_video_processor(void) check_mft_set_input_type(transform, test->input_type_desc); check_mft_get_input_current_type(transform, test->input_type_desc);
+ if (i >= 15) + { + IMFMediaType *media_type; + HRESULT hr; + + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); + init_media_type(media_type, test->output_type_desc, -1); + hr = IMFTransform_SetOutputType(transform, 0, media_type, 0); + todo_wine + ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); + IMFMediaType_Release(media_type); + + winetest_pop_context(); + continue; + } + check_mft_set_output_type_required(transform, test->output_type_desc); check_mft_set_output_type(transform, test->output_type_desc, S_OK); check_mft_get_output_current_type(transform, test->output_type_desc); @@ -7837,6 +7874,11 @@ static void test_video_processor(void) output_info.cbSize = actual_width * actual_height * 2; check_mft_get_output_stream_info(transform, S_OK, &output_info); } + else if (test->output_type_desc == rgb32_no_aperture) + { + output_info.cbSize = 82 * 84 * 4; + check_mft_get_output_stream_info(transform, S_OK, &output_info); + } else { output_info.cbSize = actual_width * actual_height * 4; @@ -7867,6 +7909,18 @@ static void test_video_processor(void) ok(input_data_len == 18432, "got length %lu\n", input_data_len); input_data += length; } + else if (test->input_type_desc == rgb32_no_aperture) + { + input_info.cbSize = 82 * 84 * 4; + check_mft_get_input_stream_info(transform, S_OK, &input_info); + + load_resource(L"rgb32frame.bmp", &input_data, &input_data_len); + /* skip BMP header and RGB data from the dump */ + length = *(DWORD *)(input_data + 2 + 2 * sizeof(DWORD)); + input_data_len -= length; + ok(input_data_len == 36864, "got length %lu\n", input_data_len); + input_data += length; + } else { input_info.cbSize = actual_width * actual_height * 4; @@ -7929,6 +7983,12 @@ static void test_video_processor(void) ret = IMFSample_Release(output_sample); ok(ret == 0, "Release returned %lu\n", ret); winetest_pop_context(); + + ret = IMFTransform_Release(transform); + ok(ret == 0, "Release returned %ld\n", ret); + hr = CoCreateInstance(class_id, NULL, CLSCTX_INPROC_SERVER, + &IID_IMFTransform, (void **)&transform); + ok(hr == S_OK, "got hr %#lx\n", hr); }
ret = IMFTransform_Release(transform);