The existing video_processor tests were modified to also test 2D buffers (in addition to the existing 1D buffer tests).
Because 2D buffers offer both a 1D view and 2D view of the buffer data, additional checks were also added to test the 2D view of the data.
2D buffers can also include their own stride value. So additional tests were added to ensure that a 2D buffer can override the stride settings of the input/output media attributes of a transform.
And finally, tests for transforming from a buffer with a smaller input height to a greater output height were also added.
From: Brendan McGrath bmcgrath@codeweavers.com
--- dlls/mf/tests/transform.c | 142 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 135 insertions(+), 7 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index b02c69b357e..f246919f125 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -74,6 +74,16 @@ struct media_buffer BYTE data[]; };
+struct buffer2d_desc +{ + DWORD width; + DWORD height; + DWORD fourCC; + BOOL flip; + LONG stride; + DWORD length; +}; + static inline struct media_buffer *impl_from_IMediaBuffer(IMediaBuffer *iface) { return CONTAINING_RECORD(iface, struct media_buffer, IMediaBuffer_iface); @@ -2047,6 +2057,56 @@ static IMFSample *create_sample(const BYTE *data, ULONG size) return sample; }
+static IMFSample *create_2d_sample(const BYTE *data, ULONG size, const struct buffer2d_desc *buffer2d_desc) +{ + IMFMediaBuffer *media_buffer; + IMF2DBuffer2 *buffer2d2; + BYTE *buffer, *scanline; + IMFSample *sample; + DWORD length; + LONG stride; + HRESULT hr; + ULONG ret; + + hr = MFCreateSample(&sample); + ok(hr == S_OK, "MFCreateSample returned %#lx\n", hr); + hr = MFCreate2DMediaBuffer(buffer2d_desc->width, buffer2d_desc->height, buffer2d_desc->fourCC, buffer2d_desc->flip, &media_buffer); + ok(hr == S_OK, "MFCreateMemoryBuffer returned %#lx\n", hr); + hr = IMFMediaBuffer_Lock(media_buffer, &buffer, NULL, &length); + ok(length == size, "got 1d length %lu, expected %lu\n", length, size); + ok(hr == S_OK, "Lock returned %#lx\n", hr); + if (data) memcpy(buffer, data, size); + hr = IMFMediaBuffer_Unlock(media_buffer); + ok(hr == S_OK, "Unlock returned %#lx\n", hr); + hr = IMFMediaBuffer_QueryInterface(media_buffer, &IID_IMF2DBuffer2, (void**)&buffer2d2); + ok(hr == S_OK, "QueryInterface IMF2DBuffer2 returned %#lx\n", hr); + hr = IMF2DBuffer2_Lock2DSize(buffer2d2, MF2DBuffer_LockFlags_Write, &scanline, &stride, &buffer, &length); + ok(hr == S_OK, "Lock2D returned %#lx\n", hr); + ok(stride == buffer2d_desc->stride, "got stride %lu, expected %lu\n", stride, buffer2d_desc->stride); + ok(length == buffer2d_desc->length, "got 2d length %lu, expected %lu\n", length, buffer2d_desc->length); + if (!data) memset(buffer, 0xcd, length); + hr = IMF2DBuffer2_Unlock2D(buffer2d2); + ok(hr == S_OK, "Unlock2D returned %#lx\n", hr); + hr = IMFMediaBuffer_SetCurrentLength(media_buffer, data ? size : 0); + ok(hr == S_OK, "SetCurrentLength returned %#lx\n", hr); + hr = IMFSample_AddBuffer(sample, media_buffer); + ok(hr == S_OK, "AddBuffer returned %#lx\n", hr); + ret = IMF2DBuffer2_Release(buffer2d2); + ok(ret == 2, "IMF2DBuffer2 Release returned %lu\n", ret); + ret = IMFMediaBuffer_Release(media_buffer); + ok(ret == 1, "Release returned %lu\n", ret); + + return sample; +} + +static IMFSample *create_sample_type(BOOL use_2d_buffer, const BYTE *data, ULONG size, const struct buffer2d_desc *buffer2d_desc) +{ + if (use_2d_buffer) + return create_2d_sample(data, size, buffer2d_desc); + + return create_sample(data, size); +} + static void test_aac_encoder(void) { const GUID *const class_id = &CLSID_AACMFTEncoder; @@ -7379,7 +7439,7 @@ failed: CoUninitialize(); }
-static void test_video_processor(void) +static void test_video_processor(BOOL use_2d_buffer) { const GUID *const class_id = &CLSID_VideoProcessorMFT; const struct transform_info expect_mft_info = @@ -7512,6 +7572,7 @@ static void test_video_processor(void)
static const MFVideoArea actual_aperture = {.Area={82,84}}; static const DWORD actual_width = 96, actual_height = 96; + static const DWORD nv12_aligned_width = 128; const struct attribute_desc rgb32_with_aperture[] = { ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), @@ -7606,6 +7667,51 @@ static void test_video_processor(void) ATTR_RATIO(MF_MT_FRAME_SIZE, 82, 84, .required = TRUE), {0}, }; + const struct buffer2d_desc nv12_default_stride_2d = { + .width = actual_width, + .height = actual_height, + .fourCC = MFVideoFormat_NV12.Data1, + .stride = nv12_aligned_width, + .length = nv12_aligned_width * actual_height * 3 / 2, + }; + const struct buffer2d_desc rgb32_negative_stride_2d = { + .width = actual_width, + .height = actual_height, + .fourCC = MFVideoFormat_RGB32.Data1, + .flip = TRUE, + .stride = -actual_width * 4, + .length = actual_width * actual_height * 4, + }; + const struct buffer2d_desc rgb32_positive_stride_2d = { + .width = actual_width, + .height = actual_height, + .fourCC = MFVideoFormat_RGB32.Data1, + .stride = actual_width * 4, + .length = actual_width * actual_height * 4, + }; + const struct buffer2d_desc rgb32_no_aperture_2d = { + .width = 82, + .height = 84, + .fourCC = MFVideoFormat_RGB32.Data1, + .flip = TRUE, + .stride = -actual_width * 4, + .length = actual_width * 84 * 4, + }; + const struct buffer2d_desc rgb555_negative_stride_2d = { + .width = actual_width, + .height = actual_height, + .fourCC = MFVideoFormat_RGB555.Data1, + .flip = TRUE, + .stride = -actual_width * 2, + .length = actual_width * actual_height * 2, + }; + const struct buffer2d_desc rgb555_positive_stride_2d = { + .width = actual_width, + .height = actual_height, + .fourCC = MFVideoFormat_RGB555.Data1, + .stride = actual_width * 2, + .length = actual_width * actual_height * 2, + }; 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}; @@ -7677,6 +7783,8 @@ static void test_video_processor(void) const WCHAR *output_bitmap; ULONG delta; BOOL broken; + const struct buffer2d_desc *input_2d_desc; + const struct buffer2d_desc *output_2d_desc; } video_processor_tests[] = { @@ -7684,96 +7792,115 @@ static void test_video_processor(void) .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_default_stride, .output_bitmap = L"rgb32frame-flip.bmp", .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, }, { .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_negative_stride, .output_bitmap = L"rgb32frame-flip.bmp", .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, }, { .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_positive_stride, .output_bitmap = L"rgb32frame.bmp", .output_sample_desc = &rgb32_sample_desc, .delta = 6, + .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_positive_stride_2d, }, { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame-flip.bmp", .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, }, { .input_type_desc = rgb32_negative_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame-flip.bmp", .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, }, { .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame.bmp", .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, }, { .input_type_desc = rgb32_negative_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_negative_stride, .output_bitmap = L"rgb32frame.bmp", .output_sample_desc = &rgb32_sample_desc, + .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb32_negative_stride_2d, }, { .input_type_desc = rgb32_negative_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_positive_stride, .output_bitmap = L"rgb32frame-flip.bmp", .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, }, { .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_negative_stride, .output_bitmap = L"rgb32frame-flip.bmp", .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, }, { .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_positive_stride, .output_bitmap = L"rgb32frame.bmp", .output_sample_desc = &rgb32_sample_desc, + .input_2d_desc = &rgb32_positive_stride_2d, .output_2d_desc = &rgb32_positive_stride_2d, }, { .input_type_desc = rgb32_with_aperture, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_with_aperture, .output_bitmap = L"rgb32frame.bmp", - .output_sample_desc = &rgb32_sample_desc, .broken = TRUE /* old Windows version incorrectly rescale */ + .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, }, { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb555_default_stride, .output_bitmap = L"rgb555frame.bmp", .output_sample_desc = &rgb555_sample_desc, + .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb555_negative_stride_2d, }, { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb555_negative_stride, .output_bitmap = L"rgb555frame.bmp", .output_sample_desc = &rgb555_sample_desc, + .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb555_negative_stride_2d, }, { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb555_positive_stride, .output_bitmap = L"rgb555frame-flip.bmp", .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, }, { .input_type_desc = rgb555_default_stride, .input_bitmap = L"rgb555frame.bmp", .output_type_desc = rgb555_positive_stride, .output_bitmap = L"rgb555frame-flip.bmp", .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, }, { .input_type_desc = nv12_with_aperture, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_no_aperture, .output_bitmap = L"rgb32frame-crop-flip.bmp", .output_sample_desc = &rgb32_crop_sample_desc, .delta = 2, /* Windows returns 0, Wine needs 2 */ + .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_no_aperture_2d, }, { .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", - .output_sample_desc = &rgb32_sample_desc, .broken = TRUE /* old Windows version incorrectly rescale */ + .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, }, { .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", .output_sample_desc = &rgb32_crop_sample_desc, + .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb32_no_aperture_2d, }, { .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", .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, }, };
@@ -8176,7 +8303,7 @@ static void test_video_processor(void) ok(input_data_len == input_info.cbSize, "got length %lu\n", input_data_len); input_data += length;
- input_sample = create_sample(input_data, input_data_len); + input_sample = create_sample_type(use_2d_buffer, input_data, input_data_len, test->input_2d_desc); hr = IMFSample_SetSampleTime(input_sample, 0); ok(hr == S_OK, "SetSampleTime returned %#lx\n", hr); hr = IMFSample_SetSampleDuration(input_sample, 10000000); @@ -8193,7 +8320,7 @@ static void test_video_processor(void) hr = MFCreateCollection(&output_samples); ok(hr == S_OK, "MFCreateCollection returned %#lx\n", hr);
- output_sample = create_sample(NULL, output_info.cbSize); + output_sample = create_sample_type(use_2d_buffer, NULL, output_info.cbSize, 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); @@ -8214,7 +8341,7 @@ static void test_video_processor(void) ok(ret <= test->delta || broken(test->broken), "got %lu%% diff\n", ret); IMFCollection_Release(output_samples);
- output_sample = create_sample(NULL, output_info.cbSize); + output_sample = create_sample_type(use_2d_buffer, NULL, output_info.cbSize, 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); @@ -9747,7 +9874,8 @@ START_TEST(transform) test_wmv_decoder_media_object(); test_audio_convert(); test_color_convert(); - test_video_processor(); + test_video_processor(FALSE); + test_video_processor(TRUE); test_mp3_decoder(); test_iv50_encoder(); test_iv50_decoder();
From: Brendan McGrath bmcgrath@codeweavers.com
--- dlls/mf/tests/mf_test.h | 7 +- dlls/mf/tests/nv12frame-2d.bmp | Bin 0 -> 67638 bytes dlls/mf/tests/nv12frame-flip-2d.bmp | Bin 0 -> 67638 bytes dlls/mf/tests/resource.rc | 28 ++++ dlls/mf/tests/rgb32frame-2d.bmp | Bin 0 -> 36918 bytes dlls/mf/tests/rgb32frame-crop-flip-2d.bmp | Bin 0 -> 32310 bytes dlls/mf/tests/rgb32frame-flip-2d.bmp | Bin 0 -> 36918 bytes dlls/mf/tests/rgb555frame-2d.bmp | Bin 0 -> 18486 bytes dlls/mf/tests/rgb555frame-flip-2d.bmp | Bin 0 -> 18486 bytes dlls/mf/tests/transform.c | 159 +++++++++++++++++----- 10 files changed, 161 insertions(+), 33 deletions(-) create mode 100644 dlls/mf/tests/nv12frame-2d.bmp create mode 100644 dlls/mf/tests/nv12frame-flip-2d.bmp create mode 100644 dlls/mf/tests/rgb32frame-2d.bmp create mode 100644 dlls/mf/tests/rgb32frame-crop-flip-2d.bmp create mode 100644 dlls/mf/tests/rgb32frame-flip-2d.bmp create mode 100644 dlls/mf/tests/rgb555frame-2d.bmp create mode 100644 dlls/mf/tests/rgb555frame-flip-2d.bmp
diff --git a/dlls/mf/tests/mf_test.h b/dlls/mf/tests/mf_test.h index 9fa5d4fef41..c1d826456c3 100644 --- a/dlls/mf/tests/mf_test.h +++ b/dlls/mf/tests/mf_test.h @@ -99,6 +99,9 @@ struct buffer_desc RECT compare_rect; dump_cb dump; SIZE size; + DWORD length_2d; + SIZE size_2d; + LONG abs_stride; /* absolute value of stride */ };
struct sample_desc @@ -114,6 +117,6 @@ struct sample_desc BOOL todo_time; };
-#define check_mf_sample_collection(a, b, c) check_mf_sample_collection_(__FILE__, __LINE__, a, b, c) +#define check_mf_sample_collection(a, b, c) check_mf_sample_collection_(__FILE__, __LINE__, a, b, c, FALSE) extern DWORD check_mf_sample_collection_(const char *file, int line, IMFCollection *samples, - const struct sample_desc *expect_samples, const WCHAR *expect_data_filename); + const struct sample_desc *expect_samples, const WCHAR *expect_data_filename, BOOL use_2d_buffer); diff --git a/dlls/mf/tests/nv12frame-2d.bmp b/dlls/mf/tests/nv12frame-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..1071645273671208046c480df42e9a49cd289ceb GIT binary patch literal 67638 zcmeI0F>6#o6ovI4B%P(EG7v!o7i{e<7QrHwT`)x&!PZw;iGd{e11wBrO|f>icCy7I zkUk*Vgf#mT#u=;onm5e72j<=J+~F=PI(y!n@627-r_W|TZvCrSe7zsLi~Tb8?OS)_ zYpfstUI#BXT^HDP56(}QLDPNThnh|HcJ|3b4g0jGCi|pK{^ZXL*fYTUZ}-r14#}VV zH5uUde;c{cuupr)pZsfP!1H(Rl%AdUzm0pW&6HREfA-!5w%r4-{I4T_w%r4-{4aM7 z1KaKa`P)78oI|(#H;=<5+w1}P|KB+xfAZI4pyvPmByG-qOl~#o(;o82_+LB6<lhEI zZH~yF{52Wi{BI*S8un>VZT_n#Zvxxyfmi+)kw4q+fmi-tyN7{o_kjHE9(vB9SN@B$ zjli~hK>l_QJ?D`8$zPL!+Q0ui-?=G0yM}$*L;h{d4f1b;qjsi{Kly7i!1>=sZZz!E zp4$9Bf4CFab`QMr{}TDL?H+jLe=@%p*me)R^8Xn5v+W*u<$pBW3T(Rv<Zt)Ta}LR$ z{52V<{rk`Jotx6LYuKkf<ln~JApbTvYG(@hlfNbdod0d)M#DbsA%F6(nE~zh9rq1$ z>-GNcudV{y?g9DRJ@lMI@+W^y25NryCvDGnZc5LtVW0Mpe;ady{M+EDohjr`{+bMM z{<o1E4g0i*{K>y&2DIOI+&9dv*ZaS>{1w=C54`e!75TI69(d*d{PlHU+dc5g|3&1_ zwtL`}|9p2H*me)d-|nI39FjlzYcf#tw|~<1eCMY0>>BoI5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z|JBZsSN?Z9p99<Ofmi;wkw4q+fmi<bT^HDP56Iu{q30ZuKly7iQ2YDO^PTI{yKC5| zJ>=iU+#vrpIBI7K`IEmU1DyYD<VM3j?IC~iubBbu?;ZEe=ho}}KVNdiY%i=O%bzb4 zkAI~8avh-miyc_5`{&I6V*95T@R}!@k)Qs8SDF4Zc$MkDgjbpVCcLOG9mwS$ZvUoK z&(A;VqaE<&{|k7Poqr2nW%@&SQC~Wcn}2Zohf+O1|EQ04fc{Gd`kw!H@RFy`-@mu; zD%1Y}uQL4|c$Mkz!i)OSf!zIv+rKN-^Y@SXXb0%ObfE9~KZKV&eg6Kz<qxSZ9mwU6 z{-Yg`?lb>=&)+wAmGM7@SDF4#c$Mk@fLEFR2wv2e4&?4X-2RbN&(B}#qaE<&{~5f> z&JUMAE7QM%SDF3<US;~%@S?tSAUFTv_Fqf&{QRdr+5!469q4=h@8Bg*pTB>%@G8^4 zhZpsw1G)Ue?Z21m`TS8I?Ew9k4)i_$C*$R=-1(QQeln*1Vh3vb|9ymB^Cwz-`sws< zhhAm+vpw{pzH}hRAMO5ZPpaqV&+jkjRi^*x3cbqow`b@@ed$0h|7iEOXHq?%|BrX* zRi;1wgI;C&lN<D+zH}g$f3*9P8>ybpe{KE226~m9AFV#vpuTh<m;c)S51*iyJbnKD zeSL&pW%{RU=tX_$Kra7i_fOZPdOm;MbMz|Hf3=TZW%}z!=tX_$Kra7i_t%f4dOrVK f2k2F%zw;Tr%Je&UQC~Wc%Rk)yPO9hgUt9klBV><5
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index 6c9a6601c24..e17694be8a4 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -85,6 +85,10 @@ h264data-2.bin RCDATA h264data-2.bin /* @makedep: nv12frame.bmp */ nv12frame.bmp RCDATA nv12frame.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: nv12frame-2d.bmp */ +nv12frame-2d.bmp RCDATA nv12frame-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: nv12frame-grabber.bmp */ nv12frame-grabber.bmp RCDATA nv12frame-grabber.bmp @@ -93,6 +97,10 @@ nv12frame-grabber.bmp RCDATA nv12frame-grabber.bmp /* @makedep: nv12frame-flip.bmp */ nv12frame-flip.bmp RCDATA nv12frame-flip.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: nv12frame-flip-2d.bmp */ +nv12frame-flip-2d.bmp RCDATA nv12frame-flip-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: i420frame.bmp */ i420frame.bmp RCDATA i420frame.bmp @@ -101,10 +109,18 @@ i420frame.bmp RCDATA i420frame.bmp /* @makedep: rgb32frame.bmp */ rgb32frame.bmp RCDATA rgb32frame.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-2d.bmp */ +rgb32frame-2d.bmp RCDATA rgb32frame-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: rgb32frame-flip.bmp */ rgb32frame-flip.bmp RCDATA rgb32frame-flip.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-flip-2d.bmp */ +rgb32frame-flip-2d.bmp RCDATA rgb32frame-flip-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: rgb32frame-crop.bmp */ rgb32frame-crop.bmp RCDATA rgb32frame-crop.bmp @@ -113,6 +129,10 @@ rgb32frame-crop.bmp RCDATA rgb32frame-crop.bmp /* @makedep: rgb32frame-crop-flip.bmp */ rgb32frame-crop-flip.bmp RCDATA rgb32frame-crop-flip.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-crop-flip-2d.bmp */ +rgb32frame-crop-flip-2d.bmp RCDATA rgb32frame-crop-flip-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: abgr32frame-crop.bmp */ abgr32frame-crop.bmp RCDATA abgr32frame-crop.bmp @@ -125,10 +145,18 @@ rgb32frame-grabber.bmp RCDATA rgb32frame-grabber.bmp /* @makedep: rgb555frame.bmp */ rgb555frame.bmp RCDATA rgb555frame.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: rgb555frame-2d.bmp */ +rgb555frame-2d.bmp RCDATA rgb555frame-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: rgb555frame-flip.bmp */ rgb555frame-flip.bmp RCDATA rgb555frame-flip.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: rgb555frame-flip-2d.bmp */ +rgb555frame-flip-2d.bmp RCDATA rgb555frame-flip-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: iv50frame.bin */ iv50frame.bin RCDATA iv50frame.bin diff --git a/dlls/mf/tests/rgb32frame-2d.bmp b/dlls/mf/tests/rgb32frame-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..9f2ea1e5d1b2b808f3671b09c19ed6fcd090de85 GIT binary patch literal 36918 zcmeI*u}Yg^9EI^Cp-Y{_DXoJ;g<gTswR>Gccke(i!PP-=^b)K~Zl@ik*$ag_DEVIB zs5js_AC!Oc1db^3!j~V9MuH??za3ub`F7Ype(pPd-In(IXZ`m2{g*FZJ`TemmK(IQ zCTG~^_A5ijesu<a{MVrY`X8rbw*~z1ciUNqbM#OD>(H@#ALzek|36w2%MINA@47$B z4P5_^j}KzGf$Kl}_g5@8aQ)SmVz~kSxna^F{`e>TR6k4q^k2Q<<ofBK{*!*HpLP2` zZF8~Q!1X_93$fh5_5bxa70V4=|I0r|V!46q-=BUK8^OT*|2OPMuwONd|Ns3t#vlJp zek`GX`ltW5KMrrQ*_ij;{QYy=w#9M-_wUc&Z6cN%xc+<nX>*nvxc=YoC6*hw{_2lG zEH}VEH%vOjAOEDE>SyVn{;M~fTtEHOf6`C&v-D5@)f-N(-|c^?K`b}GKQ~M|#2^2p zpXz7npZ=>ioLoQs(|^)W^|SO(|J55#uHWtd=6w^(4P5`bNq_Ad78|(!AM_xW8@T>6 z_1C^(v4QKa{_H2q4e-wmlMeC6Kk29XS^B5{>J2B?Pyh6v^i%z;+yBYVTr4+m{Xe~1 zh~);Z|4&WDas$`@LPuh`f$KkPNh~+OKQ~M|#2^2ppXz7npZ=>ioLoQs(|^)W^|NmO z3w;sG4P5_w?TY0Fu75l4?_17tgEQ~_-`jOR$8rPLpL1`2%|gsDqX8PA0UDqI8lV9h MpaB}7fpQHz0TpqG-v9sr
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/rgb32frame-crop-flip-2d.bmp b/dlls/mf/tests/rgb32frame-crop-flip-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a1b600c1deaa613ba47afe3c373b1d38c5086192 GIT binary patch literal 32310 zcmeI4JxT*n6h^-gY_t+9e+ml)R}iqZ*GBE#fv&(E=sMIUD@m_qFufp{LdiTIjvJW! z4TQ^_fin=o4KIiDrg(&$oloxdcTMX3q;gZas*H44@AdkBzkSi(m)a5d4rak?p;LkH zAgF)Vj3n?K;NN%XbclcaJN;yzrGNU*-mtTN`lo-VpX{^I{vUK9@Et_`ziL<DJBa!} z+E@sD2T}jG+f#w>AnIRQ)q_xQ9pHbx4dEaE?jFuOPyh6vxnFnf^iTh8Lz(BJ{a@-+ z;5&%=-_y6icM$bI9~Xh|AnN~Vvj}_#QU5D7_4Ef^2l!uaL-@zPyN5H+(?9)Z?$=#A z{nNkOQ0961r~l0Tx@(X2uTp>h0Ja1CueT%o<A2D{G5V)}`tQCAhU~1*@7~>fJJIJF zhWuIh=lM_n-FLzDQUc#Wck}JULH*et_zt4}-^*CwJBa#!DO&>HLDYY#XP@9Zz`yU% z=@9?;clyabOaJtry<unl^iTgzKiOxa{Xc$O2z&=o|8GCL0^dQ@|8ZFed<RkgcV#N@ z9Yp=B)B|X+9pHbx9pNAULw=6YKmF5x_gye#XMKM6?&jNxKG!hh&x-oL{Hp(b1Ga;x z|NWnDf$t#de_juM!FLe#|6Kip?;z^GX&Qm=0RO&2r$hYX-{~j&EdA4e_J*DH(?9(? R{bZk|fBMhfu(SSX|G$y_inRa$
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/rgb32frame-flip-2d.bmp b/dlls/mf/tests/rgb32frame-flip-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..cd9fb4fdd5c2ea8d4a359bd130767527de0a2241 GIT binary patch literal 36918 zcmeI&(M`iJ6o%1s6CRnM1MtocjKpHB)Zma#@Y~XDE+>*J5W2Yja#U4SKR)l@+uwB` zkMCoBJ=bk}8$XTf`S<ge^YO=}fC36Apnw7jD4>7>3Mim}0tzV5y1>3|yEWe+MWX$D z`=g=$YdWSL_18bO(_xN({yR8M&%i(bshtjU{PW+zae4;+ujzl=9^;l<d4u!gv($gS zuX}d3)4$e`{`&vt*CPJ;=imFEDg$1By#7?#dxd@Z=l>NPRy~I~|Bvypl{McWegC8V zeEXxJ{%bm>9`)BhwbNmafBri-PS3zU|EZl0bNut)!Et&9{;%o(wr{&N-yrp`{e1hQ zq5f++rXKazKef|gj(`3;I8M*NKmVzn4s-nT-@$Qu2L7+<e|&prx8@t9{<WWPe>Bv8 zO~=%u{`#kOI?VCUe+S3u8TjWvwbNmafBri-PS3#qHT~B<>r~t8&87bJUvn?@U(+%5 zsK5THoep#S^WVX7dItXaPwjM=<DdTyj?**ne@*}6%RjCK1ycVDw)QVZ0sU(k=&yfm gf!f{q*T1$v?e6^RUt6GdcmDOSEl|5V|JUsQ3leSRC;$Ke
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/rgb555frame-2d.bmp b/dlls/mf/tests/rgb555frame-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..8e3102e19fe161ad83f5a0d73192a766691e371c GIT binary patch literal 18486 zcmeI2v1-CV9EVe`P$>m<t~85KU%;$_lZ#uStB+9VQs|L;CSM~@5zx6?CWRQ()!*{x zdcVjo9|_8F=Ht7QAh=u?tL%If-F4QTo9p?Ijk;IeaUH+Bxm?@8PhQ@J-@XmE?ekLp z@e8Pb{Kn`G>W}KgA5;JMjnN%Y|0eK*{EvYj<i892Aph!@ALL&Le&nBajnrTLEd{iH zEcNVjQUAYBevtqEn;+zV81jSsx9|KQ|JLy%|FmnQ{_1Zjp#5X1XP=AuH&6T^|D)pv z`R^P*$iH&@AphF&BmcB(r2gt}DWLshsb`<7{`Q8JPeA>1-vhw^e|li=)j#nnY5%1C zmaD(|TMFFq{+WAz(DQ5J`9c29^Mm}KfA~TEnde9TY1c^o)!$M;`^QqxJ{R?0fAE9+ zAHVoP{;x0mAph}{ALO5BJpldwl7IXH>L0%`x`X<oI`PNuxc{UF2YP<J4fsL+i;^GY WA4-0Zzs6KR1yn!<R6qs(zrYDi>aF(x
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/rgb555frame-flip-2d.bmp b/dlls/mf/tests/rgb555frame-flip-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e3a641a9a04d3e09b8ad12c3f437cece1dab2f30 GIT binary patch literal 18486 zcmeH_u}Z^G7)B#kP()B?i&+GH0lNxLF5LuIA3<;t4CyoZ8il??q0Vkj3L0$ZZ}|xK z6VE*)w1hu7oO^F()7$2EO^5sCa6N3Vo#uG>HLUIP&7aM^?ekfRm2cnnLVt<>_yy=c zeq;3o`l~wQKcoNnjnx-a|9PK}^1tr$QT}K9`6&O%A6Ux2ZSujt?jF&f{!RhTk5kW| zRsB!S^HKh%hxsV~-N$^C|LiUw<==Gq;9qx-=udyA0O!Z4=g+GC2haH^|I+27{3l&L z%Kxg%NBOs1KKR$&Bl^?dDZu%0>iM(u_ZvEIQ2kdWAN=d?5&h}!6yW?g_54}-`wg8p zsQ!zRkMduae3buJ$w&Er?B%2Uze_&&*WDxf)88q;`Ely`v#S5=MLx>^^C%zX|MrxR z@_)b2NBOVj`QTr7kLXW-rvT^2sprqC{)?A<l>d63kMidk1t>rP3Q&Lo6!>oiegF~` BPFnx~
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index f246919f125..ebad1c10ca6 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -1206,46 +1206,80 @@ static void enum_mf_samples(IMFCollection *samples, const struct sample_desc *co ok(hr == E_INVALIDARG, "GetElement returned %#lx\n", hr); }
-static void dump_mf_media_buffer(IMFMediaBuffer *buffer, const struct buffer_desc *buffer_desc, HANDLE output) +struct dump_mf_sample_context { + HANDLE output; + BOOL use_2d_buffer; +}; + +static void dump_mf_media_buffer(IMFMediaBuffer *buffer, const struct buffer_desc *buffer_desc, void *context) +{ + struct dump_mf_sample_context *ctx = context; + IMF2DBuffer2 *buffer2d2; + SIZE size; DWORD length, written; HRESULT hr; BYTE *data; BOOL ret;
- hr = IMFMediaBuffer_Lock(buffer, &data, NULL, &length); - ok(hr == S_OK, "Lock returned %#lx\n", hr); + if (ctx->use_2d_buffer) + { + LONG stride; + BYTE *scanline; + + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer2, (void**)&buffer2d2); + ok(hr == S_OK, "QueryInterface IMF2DBuffer2 returned %#lx\n", hr); + hr = IMF2DBuffer2_Lock2DSize(buffer2d2, MF2DBuffer_LockFlags_Read, &scanline, &stride, &data, &length); + ok(hr == S_OK, "Lock2DSize returned %#lx\n", hr); + size = buffer_desc->size_2d; + } + else + { + hr = IMFMediaBuffer_Lock(buffer, &data, NULL, &length); + ok(hr == S_OK, "Lock returned %#lx\n", hr); + size = buffer_desc->size; + }
if (buffer_desc->dump) - buffer_desc->dump(data, length, &buffer_desc->size, output); + buffer_desc->dump(data, length, &size, ctx->output); else { if (buffer_desc->length == -1) { - ret = WriteFile(output, &length, sizeof(length), &written, NULL); + ret = WriteFile(ctx->output, &length, sizeof(length), &written, NULL); ok(ret, "WriteFile failed, error %lu\n", GetLastError()); ok(written == sizeof(length), "written %lu bytes\n", written); }
- ret = WriteFile(output, data, length, &written, NULL); + ret = WriteFile(ctx->output, data, length, &written, NULL); ok(ret, "WriteFile failed, error %lu\n", GetLastError()); ok(written == length, "written %lu bytes\n", written); }
- hr = IMFMediaBuffer_Unlock(buffer); - ok(hr == S_OK, "Unlock returned %#lx\n", hr); + if (ctx->use_2d_buffer) + { + hr = IMF2DBuffer2_Unlock2D(buffer2d2); + ok(hr == S_OK, "Unlock2D returned %#lx\n", hr); + IMF2DBuffer2_Release(buffer2d2); + } + else + { + hr = IMFMediaBuffer_Unlock(buffer); + ok(hr == S_OK, "Unlock returned %#lx\n", hr); + } }
-static void dump_mf_sample(IMFSample *sample, const struct sample_desc *sample_desc, HANDLE output) +static void dump_mf_sample(IMFSample *sample, const struct sample_desc *sample_desc, void *context) { - enum_mf_media_buffers(sample, sample_desc, dump_mf_media_buffer, output); + enum_mf_media_buffers(sample, sample_desc, dump_mf_media_buffer, context); }
static void dump_mf_sample_collection(IMFCollection *samples, const struct sample_desc *collection_desc, - const WCHAR *output_filename) + const WCHAR *output_filename, BOOL use_2d_buffer) { WCHAR path[MAX_PATH]; HANDLE output; + struct dump_mf_sample_context context = { .use_2d_buffer = use_2d_buffer };
GetTempPathW(ARRAY_SIZE(path), path); lstrcatW(path, output_filename); @@ -1253,17 +1287,19 @@ static void dump_mf_sample_collection(IMFCollection *samples, const struct sampl output = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); ok(output != INVALID_HANDLE_VALUE, "CreateFileW failed, error %lu\n", GetLastError());
- enum_mf_samples(samples, collection_desc, dump_mf_sample, output); + context.output = output; + enum_mf_samples(samples, collection_desc, dump_mf_sample, &context);
trace("created %s\n", debugstr_w(path)); CloseHandle(output); }
-#define check_mf_media_buffer(a, b, c) check_mf_media_buffer_(__FILE__, __LINE__, a, b, c) +#define check_mf_media_buffer(a, b, c) check_mf_media_buffer_(__FILE__, __LINE__, a, b, c, FALSE) static DWORD check_mf_media_buffer_(const char *file, int line, IMFMediaBuffer *buffer, const struct buffer_desc *expect, - const BYTE **expect_data, DWORD *expect_data_len) + const BYTE **expect_data, DWORD *expect_data_len, BOOL use_2d_buffer) { - DWORD length, diff = 0, expect_length = expect->length; + IMF2DBuffer2 *buffer2d2; + DWORD length, diff = 0, expect_length = use_2d_buffer ? expect->length_2d : expect->length; HRESULT hr; BYTE *data;
@@ -1274,10 +1310,23 @@ static DWORD check_mf_media_buffer_(const char *file, int line, IMFMediaBuffer * *expect_data_len = *expect_data_len - sizeof(DWORD); }
- hr = IMFMediaBuffer_Lock(buffer, &data, NULL, &length); - ok_(file, line)(hr == S_OK, "Lock returned %#lx\n", hr); + if (use_2d_buffer) + { + BYTE *scanline; + LONG stride; + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer2, (void**)&buffer2d2); + ok_(file, line)(hr == S_OK, "QueryInterface IMF2DBuffer2 returned %#lx\n", hr); + hr = IMF2DBuffer2_Lock2DSize(buffer2d2, MF2DBuffer_LockFlags_Read, &scanline, &stride, &data, &length); + ok_(file, line)(hr == S_OK, "Lock2DSize returned %#lx\n", hr); + ok(abs(stride) == expect->abs_stride, "got abs stride of %d, expected %ld\n", abs(stride), expect->abs_stride); + } + else + { + hr = IMFMediaBuffer_Lock(buffer, &data, NULL, &length); + ok_(file, line)(hr == S_OK, "Lock returned %#lx\n", hr); + } todo_wine_if(expect->todo_length) - ok_(file, line)(length == expect_length, "got length %#lx\n", length); + ok_(file, line)(length == expect_length, "got length %ld, expected %ld\n", length, expect_length);
if (*expect_data) { @@ -1290,8 +1339,17 @@ static DWORD check_mf_media_buffer_(const char *file, int line, IMFMediaBuffer * diff = expect->compare(data, &length, &expect->size, &expect->compare_rect, *expect_data); }
- hr = IMFMediaBuffer_Unlock(buffer); - ok_(file, line)(hr == S_OK, "Unlock returned %#lx\n", hr); + if (use_2d_buffer) + { + hr = IMF2DBuffer2_Unlock2D(buffer2d2); + ok_(file, line)(hr == S_OK, "Unlock2D returned %#lx\n", hr); + IMF2DBuffer2_Release(buffer2d2); + } + else + { + hr = IMFMediaBuffer_Unlock(buffer); + ok_(file, line)(hr == S_OK, "Unlock returned %#lx\n", hr); + }
*expect_data = *expect_data + min(length, *expect_data_len); *expect_data_len = *expect_data_len - min(length, *expect_data_len); @@ -1305,6 +1363,7 @@ struct check_mf_sample_context const BYTE *data; DWORD data_len; DWORD diff; + BOOL use_2d_buffer; const char *file; int line; }; @@ -1313,15 +1372,15 @@ static void check_mf_sample_buffer(IMFMediaBuffer *buffer, const struct buffer_d { struct check_mf_sample_context *ctx = context; DWORD expect_length = expect->length == -1 ? *(DWORD *)ctx->data : expect->length; - ctx->diff += check_mf_media_buffer_(ctx->file, ctx->line, buffer, expect, &ctx->data, &ctx->data_len); + 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; }
-#define check_mf_sample(a, b, c, d) check_mf_sample_(__FILE__, __LINE__, a, b, c, d) +#define check_mf_sample(a, b, c, d) check_mf_sample_(__FILE__, __LINE__, a, b, c, d, FALSE) static DWORD check_mf_sample_(const char *file, int line, IMFSample *sample, const struct sample_desc *expect, - const BYTE **expect_data, DWORD *expect_data_len) + const BYTE **expect_data, DWORD *expect_data_len, BOOL use_2d_buffer) { - struct check_mf_sample_context ctx = {.data = *expect_data, .data_len = *expect_data_len, .file = file, .line = line}; + struct check_mf_sample_context ctx = {.data = *expect_data, .data_len = *expect_data_len, .use_2d_buffer = use_2d_buffer, .file = file, .line = line}; DWORD buffer_count, total_length, sample_flags; LONGLONG timestamp; HRESULT hr; @@ -1375,20 +1434,22 @@ static DWORD check_mf_sample_(const char *file, int line, IMFSample *sample, con static void check_mf_sample_collection_enum(IMFSample *sample, const struct sample_desc *expect, void *context) { struct check_mf_sample_context *ctx = context; - ctx->diff += check_mf_sample_(ctx->file, ctx->line, sample, expect, &ctx->data, &ctx->data_len); + ctx->diff += check_mf_sample_(ctx->file, ctx->line, sample, expect, &ctx->data, &ctx->data_len, ctx->use_2d_buffer); }
+#define check_2d_mf_sample_collection(a, b, c) check_mf_sample_collection_(__FILE__, __LINE__, a, b, c, TRUE) + DWORD check_mf_sample_collection_(const char *file, int line, IMFCollection *samples, - const struct sample_desc *expect_samples, const WCHAR *expect_data_filename) + const struct sample_desc *expect_samples, const WCHAR *expect_data_filename, BOOL use_2d_buffer) { - struct check_mf_sample_context ctx = {.file = file, .line = line}; + struct check_mf_sample_context ctx = {.file = file, .line = line, .use_2d_buffer = use_2d_buffer}; DWORD count; HRESULT hr;
if (expect_data_filename) load_resource(expect_data_filename, &ctx.data, &ctx.data_len); enum_mf_samples(samples, expect_samples, check_mf_sample_collection_enum, &ctx);
- if (expect_data_filename) dump_mf_sample_collection(samples, expect_samples, expect_data_filename); + if (expect_data_filename) dump_mf_sample_collection(samples, expect_samples, expect_data_filename, use_2d_buffer);
hr = IMFCollection_GetElementCount(samples, &count); ok_(file, line)(hr == S_OK, "GetElementCount returned %#lx\n", hr); @@ -7727,6 +7788,8 @@ static void test_video_processor(BOOL use_2d_buffer) .length = actual_width * actual_height * 4, .compare = compare_rgb32, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, .dump = dump_rgb32, .size = {.cx = actual_width, .cy = actual_height}, + .length_2d = actual_width * actual_height * 4, .abs_stride = actual_width * 4, + .size_2d = {.cx = actual_width, .cy = actual_height}, }; const struct sample_desc rgb32_sample_desc = { @@ -7740,6 +7803,8 @@ static void test_video_processor(BOOL use_2d_buffer) .length = actual_aperture.Area.cx * actual_aperture.Area.cy * 4, .compare = compare_rgb32, .compare_rect = {.right = actual_aperture.Area.cx, .bottom = actual_aperture.Area.cy}, .dump = dump_rgb32, .size = actual_aperture.Area, + .length_2d = actual_width * actual_aperture.Area.cy * 4, .abs_stride = actual_width * 4, + .size_2d = {.cx = actual_width, .cy = actual_aperture.Area.cy}, }; const struct sample_desc rgb32_crop_sample_desc = { @@ -7753,6 +7818,8 @@ static void test_video_processor(BOOL use_2d_buffer) .length = actual_width * actual_height * 2, .compare = compare_rgb16, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, .dump = dump_rgb16, .size = {.cx = actual_width, .cy = actual_height}, + .length_2d = actual_width * actual_height * 2, .abs_stride = actual_width * 2, + .size_2d = {.cx = actual_width, .cy = actual_height}, }; const struct sample_desc rgb555_sample_desc = { @@ -7766,6 +7833,8 @@ static void test_video_processor(BOOL use_2d_buffer) .length = actual_width * actual_height * 3 / 2, .compare = compare_nv12, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, .dump = dump_nv12, .size = {.cx = actual_width, .cy = actual_height}, + .length_2d = nv12_aligned_width * actual_height * 3 / 2, .abs_stride = nv12_aligned_width, + .size_2d = {.cx = nv12_aligned_width, .cy = actual_height}, }; const struct sample_desc nv12_sample_desc = { @@ -7781,6 +7850,7 @@ static void test_video_processor(BOOL use_2d_buffer) const struct attribute_desc *output_type_desc; const struct sample_desc *output_sample_desc; const WCHAR *output_bitmap; + const WCHAR *output_2d_bitmap; ULONG delta; BOOL broken; const struct buffer2d_desc *input_2d_desc; @@ -7791,114 +7861,133 @@ static void test_video_processor(BOOL use_2d_buffer) { .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_default_stride, .output_bitmap = L"rgb32frame-flip.bmp", + .output_2d_bitmap = L"rgb32frame-flip-2d.bmp", .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, }, { .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_negative_stride, .output_bitmap = L"rgb32frame-flip.bmp", + .output_2d_bitmap = L"rgb32frame-flip-2d.bmp", .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, }, { .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_positive_stride, .output_bitmap = L"rgb32frame.bmp", + .output_2d_bitmap = L"rgb32frame-2d.bmp", .output_sample_desc = &rgb32_sample_desc, .delta = 6, .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_positive_stride_2d, }, { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame-flip.bmp", + .output_2d_bitmap = L"nv12frame-flip-2d.bmp", .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, }, { .input_type_desc = rgb32_negative_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = nv12_default_stride, .output_bitmap = L"nv12frame-flip.bmp", + .output_2d_bitmap = L"nv12frame-flip-2d.bmp", .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, }, { .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.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 1, Wine needs 2 */ .input_2d_desc = &rgb32_positive_stride_2d, .output_2d_desc = &nv12_default_stride_2d, }, { .input_type_desc = rgb32_negative_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_negative_stride, .output_bitmap = L"rgb32frame.bmp", + .output_2d_bitmap = L"rgb32frame-2d.bmp", .output_sample_desc = &rgb32_sample_desc, .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb32_negative_stride_2d, }, { .input_type_desc = rgb32_negative_stride, .input_bitmap = L"rgb32frame.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, .delta = 3, /* Windows returns 3 */ .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb32_positive_stride_2d, }, { .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_negative_stride, .output_bitmap = L"rgb32frame-flip.bmp", + .output_2d_bitmap = L"rgb32frame-flip-2d.bmp", .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, }, { .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_positive_stride, .output_bitmap = L"rgb32frame.bmp", + .output_2d_bitmap = L"rgb32frame-2d.bmp", .output_sample_desc = &rgb32_sample_desc, .input_2d_desc = &rgb32_positive_stride_2d, .output_2d_desc = &rgb32_positive_stride_2d, }, { .input_type_desc = rgb32_with_aperture, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb32_with_aperture, .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 = &rgb32_negative_stride_2d, .output_2d_desc = &rgb32_negative_stride_2d, }, { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb555_default_stride, .output_bitmap = L"rgb555frame.bmp", + .output_2d_bitmap = L"rgb555frame-2d.bmp", .output_sample_desc = &rgb555_sample_desc, .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb555_negative_stride_2d, }, { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb555_negative_stride, .output_bitmap = L"rgb555frame.bmp", + .output_2d_bitmap = L"rgb555frame-2d.bmp", .output_sample_desc = &rgb555_sample_desc, .input_2d_desc = &rgb32_negative_stride_2d, .output_2d_desc = &rgb555_negative_stride_2d, }, { .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", .output_type_desc = rgb555_positive_stride, .output_bitmap = L"rgb555frame-flip.bmp", + .output_2d_bitmap = L"rgb555frame-flip-2d.bmp", .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, }, { .input_type_desc = rgb555_default_stride, .input_bitmap = L"rgb555frame.bmp", .output_type_desc = rgb555_positive_stride, .output_bitmap = L"rgb555frame-flip.bmp", + .output_2d_bitmap = L"rgb555frame-flip-2d.bmp", .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, }, { .input_type_desc = nv12_with_aperture, .input_bitmap = L"nv12frame.bmp", .output_type_desc = rgb32_no_aperture, .output_bitmap = L"rgb32frame-crop-flip.bmp", - .output_sample_desc = &rgb32_crop_sample_desc, .delta = 2, /* Windows returns 0, Wine needs 2 */ + .output_2d_bitmap = L"rgb32frame-crop-flip-2d.bmp", + .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, }, { .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", + .output_2d_bitmap = L"rgb32frame-flip-2d.bmp", .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, }, { .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", - .output_sample_desc = &rgb32_crop_sample_desc, + .output_2d_bitmap = L"rgb32frame-crop-flip-2d.bmp", + .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, }, { .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", + .output_2d_bitmap = L"rgb32frame-crop-flip-2d.bmp", .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, }, @@ -7924,7 +8013,10 @@ static void test_video_processor(BOOL use_2d_buffer) hr = CoInitialize(NULL); ok(hr == S_OK, "Failed to initialize, hr %#lx.\n", hr);
- winetest_push_context("videoproc"); + if (use_2d_buffer) + winetest_push_context("videoproc 2d"); + else + winetest_push_context("videoproc 1d");
if (!check_mft_enum(MFT_CATEGORY_VIDEO_PROCESSOR, &input_type, &output_type, class_id)) goto failed; @@ -8339,6 +8431,11 @@ static void test_video_processor(BOOL use_2d_buffer)
ret = check_mf_sample_collection(output_samples, test->output_sample_desc, test->output_bitmap); 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); + 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);
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 z$3Ol}1CRN42%dj<{=t9O@4k!QnIH4LcOCxiJpY(K`?&u{U&Hvv|2o`<SCs+(_+OR1 zb@*KT9{6-t||lm@xLm2+rew$NxGwTvdk4+2O!2dhq(w@MRqA|5@E09_QM@zF~iH z@4$cb|9|2i|IYn0y%zuYPdDu3$3OlZKk2pj$A7wECqMr2@Ayft#XtVj4LkYqkAKHc zdM*C(pKjR6kAM6-e$s34kN<STPX3eQ*}yP*@cHF%JP!8%WbXgLzF~iH@4$cb{vZ6~ z-+6vWuf;$9(+xZM@sEGUP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ZANex+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 z-}TR%&(F8XBrpXHuCBvVoU8e|(R_S-4FB?k9f6%{@4*lLqj)g<zz_U1uA$T~>X*`g z!4LevkH`S^i~6N7pv2NY(?7!x{-ZFU#Nt2r5B%Ui3Ij@P;r_Gf%>q-<;N&LU#aZh4 z7wib^RC^D8@E^s4;Rk-;r*Z#G{i1#;=NIq;Kky?mK>ebADGVsF^w0Fq@Pq#-3@EYq z5B>u`_>aPX5?i?cEEm1N6g0R!4vRQTJ^z9oft_ma!4LkUcrg6H5BxOlpQ&HeFXj9K ze&7dwL<X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K?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);
From: Brendan McGrath bmcgrath@codeweavers.com
These tests ensure that the transform will work with input and output buffers that have differing height values. --- dlls/mf/tests/nv12frame-extra-height-2d.bmp | Bin 0 -> 78902 bytes dlls/mf/tests/nv12frame-extra-height.bmp | Bin 0 -> 59190 bytes .../tests/nv12frame-extra-width-height-2d.bmp | Bin 0 -> 118326 bytes .../mf/tests/nv12frame-extra-width-height.bmp | Bin 0 -> 88758 bytes dlls/mf/tests/resource.rc | 32 +++ dlls/mf/tests/rgb32frame-extra-height-2d.bmp | Bin 0 -> 43062 bytes dlls/mf/tests/rgb32frame-extra-height.bmp | Bin 0 -> 43062 bytes .../rgb32frame-extra-width-height-2d.bmp | Bin 0 -> 64566 bytes .../tests/rgb32frame-extra-width-height.bmp | Bin 0 -> 64566 bytes dlls/mf/tests/transform.c | 192 +++++++++++++++++- 10 files changed, 220 insertions(+), 4 deletions(-) create mode 100644 dlls/mf/tests/nv12frame-extra-height-2d.bmp create mode 100644 dlls/mf/tests/nv12frame-extra-height.bmp create mode 100644 dlls/mf/tests/nv12frame-extra-width-height-2d.bmp create mode 100644 dlls/mf/tests/nv12frame-extra-width-height.bmp create mode 100644 dlls/mf/tests/rgb32frame-extra-height-2d.bmp create mode 100644 dlls/mf/tests/rgb32frame-extra-height.bmp create mode 100644 dlls/mf/tests/rgb32frame-extra-width-height-2d.bmp create mode 100644 dlls/mf/tests/rgb32frame-extra-width-height.bmp
diff --git a/dlls/mf/tests/nv12frame-extra-height-2d.bmp b/dlls/mf/tests/nv12frame-extra-height-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..42c90555126aa84f3f743aa36f1dd7a73c14c433 GIT binary patch literal 78902 zcmeI3F;3k;5QfPOe1wQ9TmY1kP*YIQAmsu<La9=_LzIt(6YvnCc(;f|q-_ut1&V}H zQNRs0YpOBDt{$G%*q(2#eKO+3zxV(C8E-7{ZGZdk#@pCVpI_2!)BKs{r;X3)GmXD* zpS_Q!Z6njpgAhWroUpfJ-+6DzzSD+3{K<e_2B?2K@5hjP_`}~a17oNG&-Y--zSH*X z{TSA6&Hp+5AA~u;gVVEkpXSZw>O&L$1H2zYcH!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> zxG4I02ZU8sPV?#^R1p;yML+L=u&T;wULF2bOcxg|`EULA2k6&z0RDLg>bhV4`x|Th zw(`ikA3|mM7X7>f+Ww!OU9RMjSJ&r{zI6X`h5va6nseP_?_xdwb=8}5^zmOhkWYUI z%SQLO+Lh|%{-dkDY|zJl=|Cy}JDa-4_kF2e&cCku&L;Z!FC8f5|MpS$`12su%lX$; zzkNg>|D^+^{2#sO9>4xc^>Y4o)sJ4#$A9TSDgUo0y2n#1)yw(URewD}AOEETrTok9 o);LE$??4UD<u&u_A;|C6I3K&d_WS?$*DJ06{r9zhMnCVse}%m&tN;K2
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/nv12frame-extra-height.bmp b/dlls/mf/tests/nv12frame-extra-height.bmp new file mode 100644 index 0000000000000000000000000000000000000000..082d0dc15a5c858bd61f13af721eed0c7c95cb22 GIT binary patch literal 59190 zcmeI5v1(f}6hPBIc%M)_)jtrEG0p73Ll#4za}1_a=C_56_L48~ON|HrMZg(NrVL&} zCJ*)>sCrF@Xt_}7R#)vi64ziv?vqcBu7oi7>+tl)$**?mU%&YH=Ht7MPbZ)Kt8c%@ z-`~8yR(0(N7~lX7-~bNb01n^)4&XpH9N7EwKas%T_Rc-~SS{930s92@t-J8IUBB>$ zf0y?V{KtR%k2?FbXC}@+oPYjl2dMwHYZ(6UXa9}ff49}#5eW<~?%ku0*!v&YC$Mkb zg}?3kg+KheyocaF{^LLAA1eo_Khz&9_eyv!{^NfM9$L*I(f?&rIU<3<!?|mG#NPkF zK7oDfF8poRFZ|)(<vj%d@gM&=|5!Od{h|I?xmUt-@gM(7@X%@wiT=+9Jx3%kxEi{d zkJ$Sk*e9@W-G#sH`h`FIyS#_sKmOxC=N~Hvs6W&nEB8uxF8<?x2_9O_A<_TIX6J|m z22U^U+DGjD59|}zx9-B<cKyO1{$1Wf@E`y2pYxBE1JobtkCl5RJQx4*zXT7h=8)+B zXnb%)0)v}3cj+Vc{s;C6>|1x?Z@Yfs5C1OjA^4B~_|N&r$^q&R^~cJ+5}u3y_+NsD zR&z-7zki%MB7wnc?aq9}-v7Wpfqm;P{B74S{Ndl_Jp}*pAOAW3SUEubq5fF8SHg4g zAOB16&}t5e{>R>1@ON>)_YOC>;Q$Wc01n^)4&VR|-~bNb01n^)4&-*As%uBU00(dY z2XFufZ~zBz00%naKt+Q<cM0sZ+w&@D+UfV?myyB;J~9D$G_yZj?e-XypOtp{E%{}n z@PUs^KpxHP&r-WJVg1ogza+nm6h82g3CN?F{h6t^u>Pp0pOIf?3Lp5$1mw}Y{!Fyn zbvS?R^b_*SNZ|t?nSeZ+*`JYiyA11(cKQ+dWu)+dk4!)w&FoKKyPbvgM>~C={4!Gb zz(*z^k7o8KtQNe300bbAk3e_7`NSuOK;^&YOZ%S)+}<tLAG`KvBfm^EH=k;*+b`}v z+Ot^eX0PVtmx<=)(^R_s;XL$5H+xf&UnZKH&!DH<uZE#Ny4eRk^2<bX^V#fl`_oJ4 zk8bwOj{Gvw+<e9d-G1{H`lFkDd?3F}G&i5)RJXs@p+CCWk5lr?M04{A|J%HSz@HJ2 LZxa~(+XQ|B;m5&E
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/nv12frame-extra-width-height-2d.bmp b/dlls/mf/tests/nv12frame-extra-width-height-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..9d8396792c6431849378b4865a12267951b389fc GIT binary patch literal 118326 zcmeI4zlv2!5XSWl#>{XvT44kccEEJ=g&hO~UtrKc76emoU?d7EK7fIL7!AhEbTgSi z1|}Colfh&j;p`b^FW4f@t*-CXJw^YjDTm|fuKLb*e%*-o>YsmY{eAY#No<Yz`<VZZ z`OlbV&-^z2I>!I^PcKe?-B>IJa(y0r`t)fa*XIH3uaEr`?_qy^?4NiK|M1`Q9)y4R zhyV35(DNSbnY}qYd(Z66;o0ZFK+hWHz(CI$dS-79&)ze8b9nYSFwnDx@8jRWk$w-} zz1kaEvS;?@@a(YfXaB^*7WPlp%z=TPHNZdo!@q`sp7#>x|9U^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<O!a~bjz2dTBizdsOvYY<OqNQc7UU6BmMU!Ps*-d|C(b6)v{#^$D i-4;!jHGYNl3KlIbbL-vxcUv@B*7z0HD_FF&%>57F%g&tu
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/nv12frame-extra-width-height.bmp b/dlls/mf/tests/nv12frame-extra-width-height.bmp new file mode 100644 index 0000000000000000000000000000000000000000..d30529daeba0242a368e9956715d8973f46b1050 GIT binary patch literal 88758 zcmeI3F>6#y6vutvVC^iQR!@i^f&tstTP%WwUm%!59tgH>VI>Mt`~Vh4SyQZ?A3;)t zK>C1a6Vl`h2=nef-!gX?I5_h^m%Z-%W;n^-8PCkgZ+`becH`f7w|`vvuWff<|LS6| zi+{TK<I<nq*RK6P|MTMK*U4-ai1jfzIywr!bKuVU+*z{!o!wd1jz9RLIE+8|gFowa zK)DB%vl~OM^0SkxdpiaPlp1hAcR*pNoZT35m7kql-Muk5pww{Q{SHa!3=Z}ep(d2G z8$&Mc=<X~T*0{6G8G{2#4fumU_~YY%axd}xS^pU*=eO=${J|f^LHxlV{3-ui0EHR3 z@t))P6ItLzISc$LXNG5yS*!kh-+2}Yok6SqoOS*XI)hgIIoWy{2%Q1`=nPx-uvvdD zzX~UW%m9DzNV$*j2Y>LV{QYNz8M*PE<M|U=;6*tL{3&OKXOS8HL>72a&H{hRnc-Pv z)~Y{;cb)`7XV9uY$DKcf&Y)F)KF)3iLT7+KI>VMdY}KFn`$-^l2Kb{hY}rHn!5_tc z{J|gmDgXRbVMcDe=Xm}^7I;z40)NVx;aOycKamAql(T5npLZ{=1VU%fsy`n(e+ZpH ztNy&6UJZoKpjCg~bp8-JgI4|7+rAbEodN#n3|saPfAB}~AAj%%f671qQkan&?>U}7 zkp*6qv%sHnW_T8v;ZJ0N7v(JQr<@s{MP~RDS>Q!Ei&p*FJv<GB&H#UOhAn%DKlr2g zk3aZ>KjrT~E6m7^_Z-ik$O13QS>R7OGdzpT@F%jsi*gqDQ_c*}A~XDnEbyY7MXUbo z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bj|^PS%-%hprJkHgf5e~9{-WRed;Q95>ai)o$L6#1 z%)9q(-e1_e=d)Wcy}MS=yYRFdTgSb#pliw@2Hg-SqBSJ?|&poqBAdo5knF74NR` znO^noT0Ps>ygT*SMBy_epTkq{uAP^6HHW9vV>8_>K8vs3UE}lk%)4v#Jh<@g)MFFf zEIv<<y}QQe%X9Cp)pPO4yHk%%bhG$;n|XJQ&)d0o*Xl{L{jc(OQ0)=_3epwr-SgQr z+y5%x(H`-yAYIYkJ)cdp{jc&J?GgXaQ_>af-SgQr+y5%x(H`-yAYIYkJ)cdp{jc&J H?U8>0gOW0%
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index ca4b3d9cc00..d020615e1c0 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -149,6 +149,22 @@ rgb32frame-extra-width.bmp RCDATA rgb32frame-extra-width.bmp /* @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: rgb32frame-extra-height.bmp */ +rgb32frame-extra-height.bmp RCDATA rgb32frame-extra-height.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-extra-height-2d.bmp */ +rgb32frame-extra-height-2d.bmp RCDATA rgb32frame-extra-height-2d.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-extra-width-height.bmp */ +rgb32frame-extra-width-height.bmp RCDATA rgb32frame-extra-width-height.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-extra-width-height-2d.bmp */ +rgb32frame-extra-width-height-2d.bmp RCDATA rgb32frame-extra-width-height-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: nv12frame-extra-width.bmp */ nv12frame-extra-width.bmp RCDATA nv12frame-extra-width.bmp @@ -157,6 +173,22 @@ nv12frame-extra-width.bmp RCDATA nv12frame-extra-width.bmp /* @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: nv12frame-extra-height.bmp */ +nv12frame-extra-height.bmp RCDATA nv12frame-extra-height.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: nv12frame-extra-height-2d.bmp */ +nv12frame-extra-height-2d.bmp RCDATA nv12frame-extra-height-2d.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: nv12frame-extra-width-height.bmp */ +nv12frame-extra-width-height.bmp RCDATA nv12frame-extra-width-height.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: nv12frame-extra-width-height-2d.bmp */ +nv12frame-extra-width-height-2d.bmp RCDATA nv12frame-extra-width-height-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-height-2d.bmp b/dlls/mf/tests/rgb32frame-extra-height-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..ce36d080e34de8516074734ca65098fb00f34f14 GIT binary patch literal 43062 zcmeI*JxW7C6o%pPr_TaJ5DU>-&|a`qZ0zl9EL=kNV4<~zxCOyhJ6pj8s36!VHcC96 z7;yogAKo1DUYHP(nLE5Zxr9qdHn!Hz+xM}SkIOmsavbKEY76<8$It&qfBZg1K4Z`T z0~o*n1~7mD3}65Q6JQ`X^aAfW^)1I$j=nf@8i!bb{$e=OH2RxDip$Vn3}>1~e^W?t z8TyOiOw;IZ3Mno_e=(eC8vRWn#bxL(hBHm0zbT}+jG=$aQ!}&%tFICJj}e!b8Bx6d zLwl|Lup9mLb`E#+r@zBd)iv;s|EhK!`^G>19geE5fq(p0wd>e7{_FdX&y>K>8aypU z+-}Fm*{OX0hxUK)M}N(&>-A25`nxPuTnGR7ujtmbXZ+*eWvSvi_{V=mx2`?ozr6pM z{PYh)Yq0XL7&|wcadLbl-~XY#)_&NH{(3uyJNnb#;i&2w_{V=$yN-S1AO8+VRoB2j z{;S$`>>K~}{ST%h7+QnR=|RNod)&?4%J+Y0ueBd`qrcwH;g0_FcQ~rL2LAD1)vjaT z_{YD)QPnl@kN>K69s9<AegCZu@_W7+N`txf7VGUf4tm$}{U7DL%o%y5f48q&`qO`s zuSNLBKmK|D)0F|PKU{yhvNsOr#XtVX!C_Z>aQM%gKlvp_45h(K>&1PWkBjMD`Tmb` zUgnIv(!bl+E&b^~$=4$M;~)RL|LMvA*B`DwUD+Fl^Wq=><KVEXJy`tr_1~^ifAflY yG{*o2Fn|FJU;qOczyJm?fB_6(00aMLpyg+O7&O2D1~7mD3}65Q7{I_}82AF~X_=n@
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/rgb32frame-extra-height.bmp b/dlls/mf/tests/rgb32frame-extra-height.bmp new file mode 100644 index 0000000000000000000000000000000000000000..ce36d080e34de8516074734ca65098fb00f34f14 GIT binary patch literal 43062 zcmeI*JxW7C6o%pPr_TaJ5DU>-&|a`qZ0zl9EL=kNV4<~zxCOyhJ6pj8s36!VHcC96 z7;yogAKo1DUYHP(nLE5Zxr9qdHn!Hz+xM}SkIOmsavbKEY76<8$It&qfBZg1K4Z`T z0~o*n1~7mD3}65Q6JQ`X^aAfW^)1I$j=nf@8i!bb{$e=OH2RxDip$Vn3}>1~e^W?t z8TyOiOw;IZ3Mno_e=(eC8vRWn#bxL(hBHm0zbT}+jG=$aQ!}&%tFICJj}e!b8Bx6d zLwl|Lup9mLb`E#+r@zBd)iv;s|EhK!`^G>19geE5fq(p0wd>e7{_FdX&y>K>8aypU z+-}Fm*{OX0hxUK)M}N(&>-A25`nxPuTnGR7ujtmbXZ+*eWvSvi_{V=mx2`?ozr6pM z{PYh)Yq0XL7&|wcadLbl-~XY#)_&NH{(3uyJNnb#;i&2w_{V=$yN-S1AO8+VRoB2j z{;S$`>>K~}{ST%h7+QnR=|RNod)&?4%J+Y0ueBd`qrcwH;g0_FcQ~rL2LAD1)vjaT z_{YD)QPnl@kN>K69s9<AegCZu@_W7+N`txf7VGUf4tm$}{U7DL%o%y5f48q&`qO`s zuSNLBKmK|D)0F|PKU{yhvNsOr#XtVX!C_Z>aQM%gKlvp_45h(K>&1PWkBjMD`Tmb` zUgnIv(!bl+E&b^~$=4$M;~)RL|LMvA*B`DwUD+Fl^Wq=><KVEXJy`tr_1~^ifAflY yG{*o2Fn|FJU;qOczyJm?fB_6(00aMLpyg+O7&O2D1~7mD3}65Q7{I_}82AF~X_=n@
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/rgb32frame-extra-width-height-2d.bmp b/dlls/mf/tests/rgb32frame-extra-width-height-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e4484622f19ac9240ec3f1a4bd5f3de760231118 GIT binary patch literal 64566 zcmeI)v27GV7>40>LLG!u-~x!D7bFUBOh$%~=zt=S$Q_Uq(E&N~F~?dIFt4Q@YoC+m z1VW#^`_HrAowbKwzrFpl{d?Sw=T~EW9P8a!H`~kcJRXn#zW?R_^JV<WI%o#>&-}s8 zvDeNs=X1{wKgBRV{P1(EfpQI&y;~t$&Rw><UBN&(1_ru;GQ+ZWD`d;L%XWJ!7%0bZ z@#quyF}}pz+$wvwLbeajSGe#4L74zQWqPvwFi<AIPnn)9KMa%!@KdHI%MSx(0{oQe z$@0TMnE*d!da@_>vyI)i+6=yZA49yGTPxhdD#yT1vvZvvKYfO0cE}Gu#Xmp%@H6)= zsLV}vzwY#p{wdc2Km73H^{W^tS^cAb_|ZSbK*{PK{lm{(|BzGUJZ8UsI_>>0e)ySd zo;}46Km0s_f$}L9uV3R+2nX-MbN>GP@KgNq!w)}GZ-cyUJ;Cd?{?R}BNB<N9C98k* z4?p^+7%15j_s`9ko7HCU`OAmX-v45!*}2Y-pFYDgJLHF-;-4RW_?i0g>%PoQcE9fQ zkNzpw0zdrl<Mpc;C|UiZfB4Zq#X!mGAN|A6T>m_bk55@`2A3DVPkaB1oo44cKYscQ z&+L#Neu{s7_~FO<=VG8_^^gAHNB<N9C98k*4?p^+7${l&qks6(KgB@Fp1FUv?crjz z8NA<qo%a40JI&5@e*E+qp4lNk{1pHE@WapC&tGM3vio(XfAmke7Wm<ZAFp4<K*{PK z{lky`DF#Yb|L7ln=K5#c{2ISP+$uBpxxG2<{jV}N+5NiXNB@*-fggVO@&2b6C|UiZ zfB4Zq#X!mGAN|9R{wW4ZR{!W9e)LZ<P_p_*|L`-}KX>EzuUUu9U~bpeNwIV6^|OwI zxg+6+pE)^uiXVRXIo3eA2Fu>9kS*sf+ug2Upd14O-9VXP*}E08<=kbvy%h|UV_={g zC^Ia3w?ej@yKJ|&f`M`j40Ho!hGp+o$d+@L?e<nMP>x|6|M$x}ZU$xVR>-n*oSp0J zS1?eHfggVOIo3eA2Fu>9kS*sf+ug2Upd14O-9VXP*}E08<=kbvy%h|UV_={gC^Ia3 Hw?g(WEVa!9
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/rgb32frame-extra-width-height.bmp b/dlls/mf/tests/rgb32frame-extra-width-height.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e4484622f19ac9240ec3f1a4bd5f3de760231118 GIT binary patch literal 64566 zcmeI)v27GV7>40>LLG!u-~x!D7bFUBOh$%~=zt=S$Q_Uq(E&N~F~?dIFt4Q@YoC+m z1VW#^`_HrAowbKwzrFpl{d?Sw=T~EW9P8a!H`~kcJRXn#zW?R_^JV<WI%o#>&-}s8 zvDeNs=X1{wKgBRV{P1(EfpQI&y;~t$&Rw><UBN&(1_ru;GQ+ZWD`d;L%XWJ!7%0bZ z@#quyF}}pz+$wvwLbeajSGe#4L74zQWqPvwFi<AIPnn)9KMa%!@KdHI%MSx(0{oQe z$@0TMnE*d!da@_>vyI)i+6=yZA49yGTPxhdD#yT1vvZvvKYfO0cE}Gu#Xmp%@H6)= zsLV}vzwY#p{wdc2Km73H^{W^tS^cAb_|ZSbK*{PK{lm{(|BzGUJZ8UsI_>>0e)ySd zo;}46Km0s_f$}L9uV3R+2nX-MbN>GP@KgNq!w)}GZ-cyUJ;Cd?{?R}BNB<N9C98k* z4?p^+7%15j_s`9ko7HCU`OAmX-v45!*}2Y-pFYDgJLHF-;-4RW_?i0g>%PoQcE9fQ zkNzpw0zdrl<Mpc;C|UiZfB4Zq#X!mGAN|A6T>m_bk55@`2A3DVPkaB1oo44cKYscQ z&+L#Neu{s7_~FO<=VG8_^^gAHNB<N9C98k*4?p^+7${l&qks6(KgB@Fp1FUv?crjz z8NA<qo%a40JI&5@e*E+qp4lNk{1pHE@WapC&tGM3vio(XfAmke7Wm<ZAFp4<K*{PK z{lky`DF#Yb|L7ln=K5#c{2ISP+$uBpxxG2<{jV}N+5NiXNB@*-fggVO@&2b6C|UiZ zfB4Zq#X!mGAN|9R{wW4ZR{!W9e)LZ<P_p_*|L`-}KX>EzuUUu9U~bpeNwIV6^|OwI zxg+6+pE)^uiXVRXIo3eA2Fu>9kS*sf+ug2Upd14O-9VXP*}E08<=kbvy%h|UV_={g zC^Ia3w?ej@yKJ|&f`M`j40Ho!hGp+o$d+@L?e<nMP>x|6|M$x}ZU$xVR>-n*oSp0J zS1?eHfggVOIo3eA2Fu>9kS*sf+ug2Upd14O-9VXP*}E08<=kbvy%h|UV_={gC^Ia3 Hw?g(WEVa!9
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index c53451f46d7..c3830f22824 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -7640,7 +7640,7 @@ 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 extra_width = actual_width + 0x30, extra_height = actual_height + 0x10; static const DWORD nv12_aligned_extra_width = 192; const struct attribute_desc rgb32_with_aperture[] = { @@ -7666,6 +7666,13 @@ static void test_video_processor(BOOL use_2d_buffer) ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, actual_height, .required = TRUE), {0}, }; + const struct attribute_desc nv12_extra_height[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12, .required = TRUE), + ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, extra_height, .required = TRUE), + {0}, + }; const struct attribute_desc rgb32_default_stride[] = { ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), @@ -7673,6 +7680,14 @@ static void test_video_processor(BOOL use_2d_buffer) ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, actual_height, .required = TRUE), {0}, }; + const struct attribute_desc rgb32_extra_height[] = + { + 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, actual_width, extra_height, .required = TRUE), + ATTR_UINT32(MF_MT_DEFAULT_STRIDE, actual_width * 4), + {0}, + }; const struct attribute_desc rgb32_negative_stride[] = { ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), @@ -7750,6 +7765,20 @@ static void test_video_processor(BOOL use_2d_buffer) .stride = nv12_aligned_extra_width, .length = nv12_aligned_extra_width * actual_height * 3 / 2, }; + const struct buffer2d_desc nv12_extra_height_2d = { + .width = actual_width, + .height = extra_height, + .fourCC = MFVideoFormat_NV12.Data1, + .stride = nv12_aligned_width, + .length = nv12_aligned_width * extra_height * 3 / 2, + }; + const struct buffer2d_desc nv12_extra_width_height_2d = { + .width = extra_width, + .height = extra_height, + .fourCC = MFVideoFormat_NV12.Data1, + .stride = nv12_aligned_extra_width, + .length = nv12_aligned_extra_width * extra_height * 3 / 2, + }; const struct buffer2d_desc rgb32_negative_stride_2d = { .width = actual_width, .height = actual_height, @@ -7772,6 +7801,20 @@ static void test_video_processor(BOOL use_2d_buffer) .stride = extra_width * 4, .length = extra_width * actual_height * 4, }; + const struct buffer2d_desc rgb32_extra_height_2d = { + .width = actual_width, + .height = extra_height, + .fourCC = MFVideoFormat_RGB32.Data1, + .stride = actual_width * 4, + .length = actual_width * extra_height * 4, + }; + const struct buffer2d_desc rgb32_extra_width_height_2d = { + .width = extra_width, + .height = extra_height, + .fourCC = MFVideoFormat_RGB32.Data1, + .stride = extra_width * 4, + .length = extra_width * extra_height * 4, + }; const struct buffer2d_desc rgb32_no_aperture_2d = { .width = 82, .height = 84, @@ -7851,6 +7894,38 @@ static void test_video_processor(BOOL use_2d_buffer) .buffer_count = 1, .buffers = &rgb32_extra_width_buffer_desc, };
+ const struct buffer_desc rgb32_extra_height_buffer_desc = + { + .length = actual_width * extra_height * 4, + .compare = compare_rgb32, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, + .dump = dump_rgb32, .size = {.cx = actual_width, .cy = extra_height}, + .length_1d = actual_width * extra_height * 4, + .length_2d = actual_width * extra_height * 4, .abs_stride = actual_width * 4, + .size_2d = {.cx = actual_width, .cy = extra_height}, + }; + const struct sample_desc rgb32_extra_height_sample_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &rgb32_extra_height_buffer_desc, + }; + + const struct buffer_desc rgb32_extra_width_height_buffer_desc = + { + .length = extra_width * extra_height * 4, + .compare = compare_rgb32, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, + .dump = dump_rgb32, .size = {.cx = extra_width, .cy = extra_height}, + .length_1d = actual_width * extra_height * 4, + .length_2d = extra_width * extra_height * 4, .abs_stride = extra_width * 4, + .size_2d = {.cx = extra_width, .cy = extra_height}, + }; + const struct sample_desc rgb32_extra_width_height_sample_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &rgb32_extra_width_height_buffer_desc, + }; + const struct buffer_desc rgb555_buffer_desc = { .length = actual_width * actual_height * 2, @@ -7897,6 +7972,38 @@ static void test_video_processor(BOOL use_2d_buffer) .buffer_count = 1, .buffers = &nv12_extra_width_buffer_desc, };
+ const struct buffer_desc nv12_extra_height_buffer_desc = + { + .length = actual_width * extra_height * 3 / 2, + .compare = compare_nv12, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, + .dump = dump_nv12, .size = {.cx = actual_width, .cy = extra_height}, + .length_1d = actual_width * extra_height * 3 / 2, + .length_2d = nv12_aligned_width * extra_height * 3 / 2, .abs_stride = nv12_aligned_width, + .size_2d = {.cx = nv12_aligned_width, .cy = extra_height}, + }; + const struct sample_desc nv12_extra_height_sample_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &nv12_extra_height_buffer_desc, + }; + + const struct buffer_desc nv12_extra_width_height_buffer_desc = + { + .length = extra_width * extra_height * 3 / 2, + .compare = compare_nv12, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, + .dump = dump_nv12, .size = {.cx = extra_width, .cy = extra_height}, + .length_1d = actual_width * extra_height * 3 / 2, + .length_2d = nv12_aligned_extra_width * extra_height * 3 / 2, .abs_stride = nv12_aligned_extra_width, + .size_2d = {.cx = nv12_aligned_extra_width, .cy = extra_height}, + }; + const struct sample_desc nv12_extra_width_height_sample_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &nv12_extra_width_height_buffer_desc, + }; + const struct transform_desc { const struct attribute_desc *input_type_desc; @@ -8126,6 +8233,44 @@ static void test_video_processor(BOOL use_2d_buffer) .test_2d_only = TRUE, .is_todo_wine = TRUE, }, + /* Test 25 */ + { + .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", + .output_type_desc = rgb32_extra_height, .output_bitmap = L"rgb32frame-extra-height.bmp", + .output_2d_bitmap = L"rgb32frame-extra-height-2d.bmp", + .output_sample_desc = &rgb32_extra_height_sample_desc, + .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_extra_height_2d, + .is_todo_wine = TRUE, + }, + /* Test 26 */ + { + .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", + .output_type_desc = nv12_extra_height, .output_bitmap = L"nv12frame-extra-height.bmp", + .output_2d_bitmap = L"nv12frame-extra-height-2d.bmp", + .output_sample_desc = &nv12_extra_height_sample_desc, .delta = 2, /* Windows returns 1, Wine needs 2 */ + .input_2d_desc = &rgb32_positive_stride_2d, .output_2d_desc = &nv12_extra_height_2d, + .is_todo_wine = TRUE, + }, + /* Test 27 */ + { + .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", + .output_type_desc = rgb32_extra_height, .output_bitmap = L"rgb32frame-extra-width-height.bmp", + .output_2d_bitmap = L"rgb32frame-extra-width-height-2d.bmp", + .output_sample_desc = &rgb32_extra_width_height_sample_desc, + .input_2d_desc = &nv12_default_stride_2d, .output_2d_desc = &rgb32_extra_width_height_2d, + .test_2d_only = TRUE, + .is_todo_wine = TRUE, + }, + /* Test 28 */ + { + .input_type_desc = rgb32_default_stride, .input_bitmap = L"rgb32frame.bmp", + .output_type_desc = nv12_extra_height, .output_bitmap = L"nv12frame-extra-width-height.bmp", + .output_2d_bitmap = L"nv12frame-extra-width-height-2d.bmp", + .output_sample_desc = &nv12_extra_width_height_sample_desc, + .input_2d_desc = &rgb32_positive_stride_2d, .output_2d_desc = &nv12_extra_width_height_2d, + .test_2d_only = TRUE, + .is_todo_wine = TRUE, + }, };
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Video, MFVideoFormat_NV12}; @@ -8492,6 +8637,18 @@ static void test_video_processor(BOOL use_2d_buffer) output_info.cbSize = actual_aperture.Area.cx * actual_aperture.Area.cy * 4; check_mft_get_output_stream_info(transform, S_OK, &output_info); } + else if (test->output_sample_desc == &nv12_extra_height_sample_desc + || test->output_sample_desc == &nv12_extra_width_height_sample_desc) + { + output_info.cbSize = actual_width * extra_height * 3 / 2; + check_mft_get_output_stream_info(transform, S_OK, &output_info); + } + else if (test->output_sample_desc == &rgb32_extra_height_sample_desc + || test->output_sample_desc == &rgb32_extra_width_height_sample_desc) + { + output_info.cbSize = actual_width * extra_height * 4; + check_mft_get_output_stream_info(transform, S_OK, &output_info); + } else { output_info.cbSize = actual_width * actual_height * 4; @@ -8500,8 +8657,16 @@ static void test_video_processor(BOOL use_2d_buffer)
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 == &rgb32_extra_height_2d) + output_size = rgb32_extra_height_2d.width * rgb32_extra_height_2d.height * 4; + else if (test->output_2d_desc == &rgb32_extra_width_height_2d) + output_size = rgb32_extra_width_height_2d.width * rgb32_extra_width_height_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 if (test->output_2d_desc == &nv12_extra_height_2d) + output_size = nv12_extra_height_2d.width * nv12_extra_height_2d.height * 3 / 2; + else if (test->output_2d_desc == &nv12_extra_width_height_2d) + output_size = nv12_extra_width_height_2d.width * nv12_extra_width_height_2d.height * 3 / 2; else output_size = output_info.cbSize;
@@ -8520,6 +8685,16 @@ static void test_video_processor(BOOL use_2d_buffer) input_info.cbSize = 82 * 84 * 4; check_mft_get_input_stream_info(transform, S_OK, &input_info); } + else if (test->input_type_desc == nv12_extra_height) + { + input_info.cbSize = actual_width * extra_height * 3 / 2; + check_mft_get_input_stream_info(transform, S_OK, &input_info); + } + else if (test->input_type_desc == rgb32_extra_height) + { + input_info.cbSize = actual_width * extra_height * 4; + check_mft_get_input_stream_info(transform, S_OK, &input_info); + } else { input_info.cbSize = actual_width * actual_height * 4; @@ -8527,7 +8702,8 @@ static void test_video_processor(BOOL use_2d_buffer) }
load_resource(test->input_bitmap, &input_data, &input_data_len); - if (test->input_type_desc == nv12_default_stride || test->input_type_desc == nv12_with_aperture) + if (test->input_type_desc == nv12_default_stride || test->input_type_desc == nv12_with_aperture + || test->input_type_desc == nv12_extra_height) { /* skip BMP header and RGB data from the dump */ length = *(DWORD *)(input_data + 2); @@ -8542,8 +8718,16 @@ static void test_video_processor(BOOL use_2d_buffer)
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 == &rgb32_extra_height_2d) + expected_input_size = rgb32_extra_height_2d.width * rgb32_extra_height_2d.height * 4; + else if (test->input_2d_desc == &rgb32_extra_width_height_2d) + expected_input_size = rgb32_extra_width_height_2d.width * rgb32_extra_width_height_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 if (test->input_2d_desc == &nv12_extra_height_2d) + expected_input_size = nv12_extra_height_2d.width * nv12_extra_height_2d.height * 3 / 2; + else if (test->input_2d_desc == &nv12_extra_width_height_2d) + expected_input_size = nv12_extra_width_height_2d.width * nv12_extra_width_height_2d.height * 3 / 2; else expected_input_size = input_info.cbSize;
@@ -8586,12 +8770,12 @@ static void test_video_processor(BOOL use_2d_buffer)
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); + ok(ret <= test->delta || broken(test->broken), "1d 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); + ok(ret <= test->delta || broken(test->broken), "2d got %lu%% diff\n", ret); } IMFCollection_Release(output_samples);
This looks generally good but I felt that it makes the transform test framework too complicated when it already is quite a bit. I've made various changes and opened https://gitlab.winehq.org/wine/wine/-/merge_requests/6220 instead, using MFCreateMediaBufferFromMediaType instead to create 2D buffers and simplify the tests.
This merge request was closed by Brendan McGrath.
OK, thanks @rbernon . I'll close this one.