From: Brendan McGrath bmcgrath@codeweavers.com
These tests ensure that a 2D buffer can override the stride settings of the input/output media attributes of a transform.
This tests the 2D 'width' of the buffer, and if the image is stored 'bottom-up' (determined by a positive or negative stride). --- dlls/mf/tests/mf_test.h | 1 + dlls/mf/tests/nv12frame-extra-width-2d.bmp | Bin 0 -> 101430 bytes dlls/mf/tests/nv12frame-extra-width.bmp | Bin 0 -> 76086 bytes dlls/mf/tests/resource.rc | 16 ++ dlls/mf/tests/rgb32frame-extra-width-2d.bmp | Bin 0 -> 55350 bytes dlls/mf/tests/rgb32frame-extra-width.bmp | Bin 0 -> 55350 bytes dlls/mf/tests/transform.c | 177 ++++++++++++++++++-- 7 files changed, 184 insertions(+), 10 deletions(-) create mode 100644 dlls/mf/tests/nv12frame-extra-width-2d.bmp create mode 100644 dlls/mf/tests/nv12frame-extra-width.bmp create mode 100644 dlls/mf/tests/rgb32frame-extra-width-2d.bmp create mode 100644 dlls/mf/tests/rgb32frame-extra-width.bmp
diff --git a/dlls/mf/tests/mf_test.h b/dlls/mf/tests/mf_test.h index c1d826456c3..658e2a490d6 100644 --- a/dlls/mf/tests/mf_test.h +++ b/dlls/mf/tests/mf_test.h @@ -99,6 +99,7 @@ struct buffer_desc RECT compare_rect; dump_cb dump; SIZE size; + DWORD length_1d; DWORD length_2d; SIZE size_2d; LONG abs_stride; /* absolute value of stride */ diff --git a/dlls/mf/tests/nv12frame-extra-width-2d.bmp b/dlls/mf/tests/nv12frame-extra-width-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..463dc9adeeb26f12cf15f05c8095bf54483a964a GIT binary patch literal 101430 zcmeI&u})N57{zgYgLwo)b$J1arCL)^*pQgqS`td@>5L^bJ^>g)!7JR#1QQx!WkF-C zDBul_XY_`!PiWR&pEI+<|4cUF=>BGw-~OG$!R%Mt&!0VgvN)cP<DYT-H;#YD@$|{F z@#}c}|M!1R{(QZj&j*IlgAX5vZ{s*UI_nx27Z(F#bv?koVSjP&z<>1hi+}t-=AS?K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ohJC|M53j3_Z>P;MX8Ws0b^L4cOY24dCmp~KekLTO zQ~cmZ0yCM6AIZ;U_3@>7{5h4vbWE;}e@T9673lw@1NgzugoJd8AN)vQCX?|a`8laR zj+guVQyu?={P=ND;RiqXx%(j?Vd$9bwEDqXu3u>t9_*p>hfD7NLHTh<|MxdiGdm`i z$3GyyvJCWp+5!CFXKF$@#}9rKFVngBQT*&xAMcji|LXXA<X8Ay(EmvX@PnTT3F#C+ z_>sU&CgVr)vr~P%S?=>sb^IOj<HtdTAN=6w?uUScp<}Ys>IZANex+4-u!qhcF1i1k z)yIoF`oF)Cn%ObAI{qg4rB$H+lMdhqKNAwtDSq%HftgIkkL0I)TB$#i!gNfoPu#v^ zM<l7F{j~ZsDNM)Y`o!%!c0`g&+E1%LlfraNu20;)V@D*Zr2Vw|Gbv2R<od+zJ9b2p zO4?7WKa;|AOs-GdzGFuusigh1`ZFm^$K?9N?K^fvl1k>q$A^zcXZK%Hn2yQC@#o~% z7J>e^9l(#~XLeZodj0AC-RI~`OQX-OO+Py%zqSVSzwH2iG(X3)+Slio%f0{9razvM zA3u&M{Ahl*HfmpQx0ieWsZGDNL4N!=rtqWrIlroXef_@N`%i89^DFY>$1#N;&Cl*l z?d$!|<=%g4)9>DpA3u&M{Ahk|_iJB2=F7eR)TY1PCqI51Q~1&Rw0Dd8GcAoiyFPLI pj(Q@kqW!e`GcAoiyFPLIj(Q@kqW!e`GcAoiyFPLIj(Q@k;umL%C3gS-
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/nv12frame-extra-width.bmp b/dlls/mf/tests/nv12frame-extra-width.bmp new file mode 100644 index 0000000000000000000000000000000000000000..0fbb616d07919774ac0074e7d94b2caf7a82e5f3 GIT binary patch literal 76086 zcmeI2u}&L75QfPc_z@yk;RQgHgxZA*8YHCDSaM124$;MKcmf+)F8mfqAkkP95rrE> zMFDTH*$XMWSB$jx&q<f;x2Lr@?G2jy{p~-KEZ+wQzxMu&gZTL^&YyAqi1W+d*Z3L7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z+QzP^syDNS2cb{-s6INOi9tllxKuK=wmBj zufk7J`V76tsaC(d(;1SFEh+k-kF9{c3P0#$D`2mR{Oo&=BdvaUr?XE!wxsBTKDGk( zD*T|2t$@8M@{?8@|GV73KlINa{f*?4>QTQ#pSmLHJ^G}2)bG%zu1I>1KB*q{yIg%H z&g1HOzTUmaClwfdQa$Q-|C>I&neTOSv%9<I>)ie2n@w*<KDMIh)2=>?p6_*gtnDw~ zY!*H8u@yz1cJ(>z`(Eb*ZGZV@bJ!;zTT%3BSD*W>@AdGk?JwVK?ziM)D~dkt>T~w) zdtJV2`^z_*vv=~b6-A$R_4ye4UM~}EfB9zfF(w~dQS@n7pL93)-{t=Qp??PHZzP{o PkNO?@)D=nZbM^TRqP14o
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index e17694be8a4..ca4b3d9cc00 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -141,6 +141,22 @@ abgr32frame-crop.bmp RCDATA abgr32frame-crop.bmp /* @makedep: rgb32frame-grabber.bmp */ rgb32frame-grabber.bmp RCDATA rgb32frame-grabber.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-extra-width.bmp */ +rgb32frame-extra-width.bmp RCDATA rgb32frame-extra-width.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-extra-width-2d.bmp */ +rgb32frame-extra-width-2d.bmp RCDATA rgb32frame-extra-width-2d.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: nv12frame-extra-width.bmp */ +nv12frame-extra-width.bmp RCDATA nv12frame-extra-width.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: nv12frame-extra-width-2d.bmp */ +nv12frame-extra-width-2d.bmp RCDATA nv12frame-extra-width-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: rgb555frame.bmp */ rgb555frame.bmp RCDATA rgb555frame.bmp diff --git a/dlls/mf/tests/rgb32frame-extra-width-2d.bmp b/dlls/mf/tests/rgb32frame-extra-width-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..509ed6acaeb54d46fd6e2221b47124ec92dfbfcf GIT binary patch literal 55350 zcmeI)v27GV7>40>LLG!u-~x!D2YR3Y$7Ey(i4G_NiTnaG0wOw~0UvW-S1_-o+tWNJ z%}JK^*?a#!^X*xC^4s_KzqhBy{dj&e*5|Q4jCHrY9?#?P{Qdol{rT+CC-7_hh=;j# zy75OJo}X~$2ZAyIe#-P@`C*_;fS)owS$-HO6X2&zPnI7B$^`f+)05?gfieMp%JgIx z_Op$%Z?zfx_&J97Ft={}_ScD>X6G_Le)<eocE}Gu#Xmp%@H6*LtjtYz-*@^)|CGJJ z4?q04eiZ{HtAF$lKl-N_C|UiZfB2c}A99ME=j`_{%ijOuho8CT*;D-R!_NyCD4$|+ z{TiP_xbiu;<=@W_KgBOU{O~jNHpq4B1+LrrNB`&_{ZkB-tp3qI{OF%zpkx>BpSv+P ztIgo+w@=I7|6-@vxy+BBKEstA^21N@&ksNRO#S(FDsz+F_nrRHKV>iQ!w)~MU&TPl z>L2~XkNznJN>=~qAAaWg=W%>|%4#z>zxucA{V#T!oy+|A=`&o}AwT>S|NQX7kN3~T zK*{PK{lky`DF#Yb|L7ln^iMHRvie8=@S}f<fs$Rhf41%MY_%DD-2N_m|BIbw=Q2Nj z`V3cg$PYioKR^8NGxzsbnVams@AQxUDSLq*e)w_yDh5hc|L7ln^iMHRvie8=@H5vx z<L1}+7vff#!JqBjviHBr++_EC$B+Igdx0N*`0@Uy7${l&qks6(KgB@F>L2~XkNznJ zN>=~qAAa;tF;KGlNB{6M**_2C|F2nBo59>!J5Gw7>+YZ9NSHeke)yS_v#0psho9>j zD0{G+yCY=FYnSbAk6@r20|VVanPEA1N641fF5B%L!9Y0%2D*VV!*cG9kS(uWw%a>` bfpQECbOU9E<=h=1TVA_tw|4{s<rw}0eNi>b
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/rgb32frame-extra-width.bmp b/dlls/mf/tests/rgb32frame-extra-width.bmp new file mode 100644 index 0000000000000000000000000000000000000000..509ed6acaeb54d46fd6e2221b47124ec92dfbfcf GIT binary patch literal 55350 zcmeI)v27GV7>40>LLG!u-~x!D2YR3Y$7Ey(i4G_NiTnaG0wOw~0UvW-S1_-o+tWNJ z%}JK^*?a#!^X*xC^4s_KzqhBy{dj&e*5|Q4jCHrY9?#?P{Qdol{rT+CC-7_hh=;j# zy75OJo}X~$2ZAyIe#-P@`C*_;fS)owS$-HO6X2&zPnI7B$^`f+)05?gfieMp%JgIx z_Op$%Z?zfx_&J97Ft={}_ScD>X6G_Le)<eocE}Gu#Xmp%@H6*LtjtYz-*@^)|CGJJ z4?q04eiZ{HtAF$lKl-N_C|UiZfB2c}A99ME=j`_{%ijOuho8CT*;D-R!_NyCD4$|+ z{TiP_xbiu;<=@W_KgBOU{O~jNHpq4B1+LrrNB`&_{ZkB-tp3qI{OF%zpkx>BpSv+P ztIgo+w@=I7|6-@vxy+BBKEstA^21N@&ksNRO#S(FDsz+F_nrRHKV>iQ!w)~MU&TPl z>L2~XkNznJN>=~qAAaWg=W%>|%4#z>zxucA{V#T!oy+|A=`&o}AwT>S|NQX7kN3~T zK*{PK{lky`DF#Yb|L7ln^iMHRvie8=@S}f<fs$Rhf41%MY_%DD-2N_m|BIbw=Q2Nj z`V3cg$PYioKR^8NGxzsbnVams@AQxUDSLq*e)w_yDh5hc|L7ln^iMHRvie8=@H5vx z<L1}+7vff#!JqBjviHBr++_EC$B+Igdx0N*`0@Uy7${l&qks6(KgB@F>L2~XkNznJ zN>=~qAAa;tF;KGlNB{6M**_2C|F2nBo59>!J5Gw7>+YZ9NSHeke)yS_v#0psho9>j zD0{G+yCY=FYnSbAk6@r20|VVanPEA1N641fF5B%L!9Y0%2D*VV!*cG9kS(uWw%a>` bfpQECbOU9E<=h=1TVA_tw|4{s<rw}0eNi>b
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index ebad1c10ca6..c53451f46d7 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -638,7 +638,7 @@ static void check_mft_input_stream_info_(int line, MFT_INPUT_STREAM_INFO *value, { check_member_(__FILE__, line, *value, *expect, "%I64d", hnsMaxLatency); check_member_(__FILE__, line, *value, *expect, "%#lx", dwFlags); - check_member_(__FILE__, line, *value, *expect, "%#lx", cbSize); + check_member_(__FILE__, line, *value, *expect, "%ld", cbSize); check_member_(__FILE__, line, *value, *expect, "%#lx", cbMaxLookahead); check_member_(__FILE__, line, *value, *expect, "%#lx", cbAlignment); } @@ -659,7 +659,7 @@ static void check_mft_get_input_stream_info_(int line, IMFTransform *transform, static void check_mft_output_stream_info_(int line, MFT_OUTPUT_STREAM_INFO *value, const MFT_OUTPUT_STREAM_INFO *expect) { check_member_(__FILE__, line, *value, *expect, "%#lx", dwFlags); - check_member_(__FILE__, line, *value, *expect, "%#lx", cbSize); + check_member_(__FILE__, line, *value, *expect, "%ld", cbSize); check_member_(__FILE__, line, *value, *expect, "%#lx", cbAlignment); }
@@ -1332,7 +1332,7 @@ static DWORD check_mf_media_buffer_(const char *file, int line, IMFMediaBuffer * { if (*expect_data_len < length) todo_wine_if(expect->todo_length) - ok_(file, line)(0, "missing %#lx bytes\n", length - *expect_data_len); + ok_(file, line)(0, "missing %ld bytes (%ld - %ld)\n", length - *expect_data_len, length, *expect_data_len); else if (!expect->compare) diff = compare_bytes(data, &length, NULL, NULL, *expect_data); else @@ -1371,7 +1371,13 @@ struct check_mf_sample_context static void check_mf_sample_buffer(IMFMediaBuffer *buffer, const struct buffer_desc *expect, void *context) { struct check_mf_sample_context *ctx = context; - DWORD expect_length = expect->length == -1 ? *(DWORD *)ctx->data : expect->length; + DWORD expect_length; + if (expect->length_1d) + expect_length = expect->length_1d; + else if (expect->length == -1) + expect_length = *(DWORD *)ctx->data; + else + expect_length = expect->length; ctx->diff += check_mf_media_buffer_(ctx->file, ctx->line, buffer, expect, &ctx->data, &ctx->data_len, ctx->use_2d_buffer); ctx->total_length += expect_length; } @@ -1421,7 +1427,7 @@ static DWORD check_mf_sample_(const char *file, int line, IMFSample *sample, con ok_(file, line)(hr == S_OK, "GetTotalLength returned %#lx\n", hr); todo_wine_if(expect->todo_length) ok_(file, line)(total_length == ctx.total_length, - "got total length %#lx\n", total_length); + "got total length %ld, expected %ld\n", total_length, ctx.total_length); ok_(file, line)(!*expect_data || *expect_data_len >= ctx.total_length, "missing %#lx data\n", ctx.total_length - *expect_data_len);
@@ -7634,6 +7640,8 @@ static void test_video_processor(BOOL use_2d_buffer) static const MFVideoArea actual_aperture = {.Area={82,84}}; static const DWORD actual_width = 96, actual_height = 96; static const DWORD nv12_aligned_width = 128; + static const DWORD extra_width = actual_width + 0x30; + static const DWORD nv12_aligned_extra_width = 192; const struct attribute_desc rgb32_with_aperture[] = { ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), @@ -7735,6 +7743,13 @@ static void test_video_processor(BOOL use_2d_buffer) .stride = nv12_aligned_width, .length = nv12_aligned_width * actual_height * 3 / 2, }; + const struct buffer2d_desc nv12_extra_width_2d = { + .width = extra_width, + .height = actual_height, + .fourCC = MFVideoFormat_NV12.Data1, + .stride = nv12_aligned_extra_width, + .length = nv12_aligned_extra_width * actual_height * 3 / 2, + }; const struct buffer2d_desc rgb32_negative_stride_2d = { .width = actual_width, .height = actual_height, @@ -7750,6 +7765,13 @@ static void test_video_processor(BOOL use_2d_buffer) .stride = actual_width * 4, .length = actual_width * actual_height * 4, }; + const struct buffer2d_desc rgb32_extra_width_2d = { + .width = extra_width, + .height = actual_height, + .fourCC = MFVideoFormat_RGB32.Data1, + .stride = extra_width * 4, + .length = extra_width * actual_height * 4, + }; const struct buffer2d_desc rgb32_no_aperture_2d = { .width = 82, .height = 84, @@ -7813,6 +7835,22 @@ static void test_video_processor(BOOL use_2d_buffer) .buffer_count = 1, .buffers = &rgb32_crop_buffer_desc, };
+ const struct buffer_desc rgb32_extra_width_buffer_desc = + { + .length = extra_width * actual_height * 4, + .compare = compare_rgb32, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, + .dump = dump_rgb32, .size = {.cx = extra_width, .cy = actual_height}, + .length_1d = actual_width * actual_height * 4, + .length_2d = extra_width * actual_height * 4, .abs_stride = extra_width * 4, + .size_2d = {.cx = extra_width, .cy = actual_height}, + }; + const struct sample_desc rgb32_extra_width_sample_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &rgb32_extra_width_buffer_desc, + }; + const struct buffer_desc rgb555_buffer_desc = { .length = actual_width * actual_height * 2, @@ -7843,6 +7881,22 @@ static void test_video_processor(BOOL use_2d_buffer) .buffer_count = 1, .buffers = &nv12_buffer_desc, };
+ const struct buffer_desc nv12_extra_width_buffer_desc = + { + .length = extra_width * actual_height * 3 / 2, + .compare = compare_nv12, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, + .dump = dump_nv12, .size = {.cx = extra_width, .cy = actual_height}, + .length_1d = actual_width * actual_height * 3 / 2, + .length_2d = nv12_aligned_extra_width * actual_height * 3 / 2, .abs_stride = nv12_aligned_extra_width, + .size_2d = {.cx = nv12_aligned_extra_width, .cy = actual_height}, + }; + const struct sample_desc nv12_extra_width_sample_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &nv12_extra_width_buffer_desc, + }; + const struct transform_desc { const struct attribute_desc *input_type_desc; @@ -7852,12 +7906,15 @@ static void test_video_processor(BOOL use_2d_buffer) const WCHAR *output_bitmap; const WCHAR *output_2d_bitmap; ULONG delta; - BOOL broken; const struct buffer2d_desc *input_2d_desc; const struct buffer2d_desc *output_2d_desc; + BOOL broken; + BOOL test_2d_only; + BOOL is_todo_wine; } video_processor_tests[] = { + /* Test 0 */ { .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_default_stride, .output_bitmap = L"rgb32frame-flip.bmp", @@ -7865,6 +7922,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_sample_desc, .delta = 2, /* Windows returns 0, Wine needs 2 */ .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_negative_stride_2d, }, + /* Test 1 */ { .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_negative_stride, .output_bitmap = L"rgb32frame-flip.bmp", @@ -7872,6 +7930,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_sample_desc, .delta = 2, /* Windows returns 0, Wine needs 2 */ .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_negative_stride_2d, }, + /* Test 2 */ { .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_positive_stride, .output_bitmap = L"rgb32frame.bmp", @@ -7879,6 +7938,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_sample_desc, .delta = 6, .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_positive_stride_2d, }, + /* Test 3 */ { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame-flip.bmp", @@ -7886,6 +7946,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &nv12_sample_desc, .delta = 2, /* Windows returns 0, Wine needs 2 */ .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &nv12_default_stride_2d, }, + /* Test 4 */ { .input_type_desc = rgb32_negative_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame-flip.bmp", @@ -7893,6 +7954,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &nv12_sample_desc, .delta = 2, /* Windows returns 0, Wine needs 2 */ .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &nv12_default_stride_2d, }, + /* Test 5 */ { .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame.bmp", @@ -7900,6 +7962,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &nv12_sample_desc, .delta = 2, /* Windows returns 1, Wine needs 2 */ .input_2d_desc = &rgb32_positive_stride_2d, .output_2d_desc = &nv12_default_stride_2d, }, + /* Test 6 */ { .input_type_desc = rgb32_negative_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_negative_stride, .output_bitmap = L"rgb32frame.bmp", @@ -7907,6 +7970,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_sample_desc, .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb32_negative_stride_2d, }, + /* Test 7 */ { .input_type_desc = rgb32_negative_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_positive_stride, .output_bitmap = L"rgb32frame-flip.bmp", @@ -7914,6 +7978,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_sample_desc, .delta = 3, /* Windows returns 3 */ .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb32_positive_stride_2d, }, + /* Test 8 */ { .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_negative_stride, .output_bitmap = L"rgb32frame-flip.bmp", @@ -7921,6 +7986,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_sample_desc, .delta = 3, /* Windows returns 3 */ .input_2d_desc = &rgb32_positive_stride_2d, .output_2d_desc = &rgb32_negative_stride_2d, }, + /* Test 9 */ { .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_positive_stride, .output_bitmap = L"rgb32frame.bmp", @@ -7928,6 +7994,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_sample_desc, .input_2d_desc = &rgb32_positive_stride_2d, .output_2d_desc = &rgb32_positive_stride_2d, }, + /* Test 10 */ { .input_type_desc = rgb32_with_aperture, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_with_aperture, .output_bitmap = L"rgb32frame.bmp", @@ -7935,6 +8002,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_sample_desc, .broken = TRUE, /* old Windows version incorrectly rescale */ .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb32_negative_stride_2d, }, + /* Test 11 */ { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb555_default_stride, .output_bitmap = L"rgb555frame.bmp", @@ -7942,6 +8010,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb555_sample_desc, .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb555_negative_stride_2d, }, + /* Test 12 */ { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb555_negative_stride, .output_bitmap = L"rgb555frame.bmp", @@ -7949,6 +8018,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb555_sample_desc, .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb555_negative_stride_2d, }, + /* Test 13 */ { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb555_positive_stride, .output_bitmap = L"rgb555frame-flip.bmp", @@ -7956,6 +8026,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb555_sample_desc, .delta = 3, /* Windows returns 0, Wine needs 3 */ .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb555_positive_stride_2d, }, + /* Test 14 */ { .input_type_desc = rgb555_default_stride, .input_bitmap = L"rgb555frame.bmp", .output_type_desc = rgb555_positive_stride, .output_bitmap = L"rgb555frame-flip.bmp", @@ -7963,6 +8034,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb555_sample_desc, .delta = 4, /* Windows returns 0, Wine needs 4 */ .input_2d_desc = &rgb555_negative_stride_2d, .output_2d_desc = &rgb555_positive_stride_2d, }, + /* Test 15 */ { .input_type_desc = nv12_with_aperture, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_no_aperture, .output_bitmap = L"rgb32frame-crop-flip.bmp", @@ -7970,6 +8042,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_crop_sample_desc, .delta = 3, /* Windows returns 0, Wine needs 3 */ .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_no_aperture_2d, }, + /* Test 16 */ { .input_type_desc = rgb32_no_aperture, .input_bitmap = L"rgb32frame-crop-flip.bmp", .output_type_desc = rgb32_with_aperture, .output_bitmap = L"rgb32frame-flip.bmp", @@ -7977,6 +8050,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_sample_desc, .broken = TRUE, /* old Windows version incorrectly rescale */ .input_2d_desc = &rgb32_no_aperture_2d, .output_2d_desc = &rgb32_negative_stride_2d, }, + /* Test 17 */ { .input_type_desc = rgb32_with_aperture, .input_bitmap = L"rgb32frame-flip.bmp", .output_type_desc = rgb32_no_aperture, .output_bitmap = L"rgb32frame-crop-flip.bmp", @@ -7984,6 +8058,7 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_crop_sample_desc, .delta = 2, /* Windows returns 2 with 2d image */ .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb32_no_aperture_2d, }, + /* Test 18 */ { .input_type_desc = rgb32_with_aperture_positive_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_no_aperture, .output_bitmap = L"rgb32frame-crop-flip.bmp", @@ -7991,6 +8066,66 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_crop_sample_desc, .delta = 3, /* Windows returns 3 */ .input_2d_desc = &rgb32_positive_stride_2d, .output_2d_desc = &rgb32_no_aperture_2d, }, + /* Test 19 */ + { + .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", + .output_type_desc = rgb32_default_stride, .output_bitmap = L"rgb32frame.bmp", + .output_2d_bitmap = L"rgb32frame-2d.bmp", + .output_sample_desc = &rgb32_sample_desc, .delta = 3, /* Windows returns 3 */ + .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_positive_stride_2d, + .test_2d_only = TRUE, + .is_todo_wine = TRUE, + }, + /* Test 20 */ + { + .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", + .output_type_desc = rgb32_positive_stride, .output_bitmap = L"rgb32frame-flip.bmp", + .output_2d_bitmap = L"rgb32frame-flip-2d.bmp", + .output_sample_desc = &rgb32_sample_desc, + .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_negative_stride_2d, + .test_2d_only = TRUE, + .is_todo_wine = TRUE, + }, + /* Test 21 */ + { + .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", + .output_type_desc = rgb32_default_stride, .output_bitmap = L"rgb32frame-extra-width.bmp", + .output_2d_bitmap = L"rgb32frame-extra-width-2d.bmp", + .output_sample_desc = &rgb32_extra_width_sample_desc, + .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_extra_width_2d, + .test_2d_only = TRUE, + .is_todo_wine = TRUE, + }, + /* Test 22 */ + { + .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame-extra-width.bmp", + .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame.bmp", + .output_2d_bitmap = L"nv12frame-2d.bmp", + .output_sample_desc = &nv12_sample_desc, .delta = 2, /* Windows returns 2 */ + .input_2d_desc = &rgb32_extra_width_2d, .output_2d_desc = &nv12_default_stride_2d, + .test_2d_only = TRUE, + .is_todo_wine = TRUE, + }, + /* Test 23 */ + { + .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame-extra-width.bmp", + .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame-extra-width.bmp", + .output_2d_bitmap = L"nv12frame-extra-width-2d.bmp", + .output_sample_desc = &nv12_extra_width_sample_desc, + .input_2d_desc = &rgb32_extra_width_2d, .output_2d_desc = &nv12_extra_width_2d, + .test_2d_only = TRUE, + .is_todo_wine = TRUE, + }, + /* Test 24 */ + { + .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame-extra-width.bmp", + .output_type_desc = rgb32_with_aperture_positive_stride, .output_bitmap = L"rgb32frame.bmp", + .output_2d_bitmap = L"rgb32frame-2d.bmp", + .output_sample_desc = &rgb32_sample_desc, .broken = TRUE, /* old Windows version incorrectly rescale */ + .input_2d_desc = &nv12_extra_width_2d, .output_2d_desc = &rgb32_positive_stride_2d, + .test_2d_only = TRUE, + .is_todo_wine = TRUE, + }, };
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Video, MFVideoFormat_NV12}; @@ -8326,6 +8461,10 @@ static void test_video_processor(BOOL use_2d_buffer) for (i = 0; i < ARRAY_SIZE(video_processor_tests); i++) { const struct transform_desc *test = video_processor_tests + i; + ULONG expected_input_size, output_size; + + if (test->test_2d_only && !use_2d_buffer) + continue;
winetest_push_context("transform #%lu", i);
@@ -8337,7 +8476,8 @@ static void test_video_processor(BOOL use_2d_buffer) check_mft_set_output_type(transform, test->output_type_desc, S_OK); check_mft_get_output_current_type(transform, test->output_type_desc);
- if (test->output_sample_desc == &nv12_sample_desc) + if (test->output_sample_desc == &nv12_sample_desc + || test->output_sample_desc == &nv12_extra_width_sample_desc) { output_info.cbSize = actual_width * actual_height * 3 / 2; check_mft_get_output_stream_info(transform, S_OK, &output_info); @@ -8358,6 +8498,13 @@ static void test_video_processor(BOOL use_2d_buffer) check_mft_get_output_stream_info(transform, S_OK, &output_info); }
+ if (test->output_2d_desc == &rgb32_extra_width_2d) + output_size = rgb32_extra_width_2d.width * rgb32_extra_width_2d.height * 4; + else if (test->output_2d_desc == &nv12_extra_width_2d) + output_size = nv12_extra_width_2d.width * nv12_extra_width_2d.height * 3 / 2; + else + output_size = output_info.cbSize; + if (test->input_type_desc == nv12_default_stride || test->input_type_desc == nv12_with_aperture) { input_info.cbSize = actual_width * actual_height * 3 / 2; @@ -8392,7 +8539,15 @@ static void test_video_processor(BOOL use_2d_buffer) length = *(DWORD *)(input_data + 2 + 2 * sizeof(DWORD)); input_data_len -= length; } - ok(input_data_len == input_info.cbSize, "got length %lu\n", input_data_len); + + if (test->input_2d_desc == &rgb32_extra_width_2d) + expected_input_size = rgb32_extra_width_2d.width * rgb32_extra_width_2d.height * 4; + else if (test->input_2d_desc == &nv12_extra_width_2d) + expected_input_size = nv12_extra_width_2d.width * nv12_extra_width_2d.height * 3 / 2; + else + expected_input_size = input_info.cbSize; + + ok(input_data_len == expected_input_size, "got length %lu, expected %lu\n", input_data_len, expected_input_size); input_data += length;
input_sample = create_sample_type(use_2d_buffer, input_data, input_data_len, test->input_2d_desc); @@ -8412,7 +8567,7 @@ static void test_video_processor(BOOL use_2d_buffer) hr = MFCreateCollection(&output_samples); ok(hr == S_OK, "MFCreateCollection returned %#lx\n", hr);
- output_sample = create_sample_type(use_2d_buffer, NULL, output_info.cbSize, test->output_2d_desc); + output_sample = create_sample_type(use_2d_buffer, NULL, output_size, test->output_2d_desc); hr = check_mft_process_output(transform, output_sample, &output_status);
ok(hr == S_OK || broken(hr == MF_E_SHUTDOWN) /* w8 */, "ProcessOutput returned %#lx\n", hr); @@ -8430,15 +8585,17 @@ static void test_video_processor(BOOL use_2d_buffer) ok(ref == 1, "Release returned %ld\n", ref);
ret = check_mf_sample_collection(output_samples, test->output_sample_desc, test->output_bitmap); + todo_wine_if(test->is_todo_wine) ok(ret <= test->delta || broken(test->broken), "got %lu%% diff\n", ret); if (use_2d_buffer) { ret = check_2d_mf_sample_collection(output_samples, test->output_sample_desc, test->output_2d_bitmap); + todo_wine_if(test->is_todo_wine) ok(ret <= test->delta || broken(test->broken), "got %lu%% diff\n", ret); } IMFCollection_Release(output_samples);
- output_sample = create_sample_type(use_2d_buffer, NULL, output_info.cbSize, test->output_2d_desc); + output_sample = create_sample_type(use_2d_buffer, NULL, output_size, test->output_2d_desc); hr = check_mft_process_output(transform, output_sample, &output_status); ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#lx\n", hr); ok(output_status == 0, "got output[0].dwStatus %#lx\n", output_status);