From c96d34e86e624159287dea0f3db12e3175000b15 Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Wed, 4 Jan 2023 11:08:13 +0800 Subject: [PATCH] mfplat/tests: Add more RGB24 image size tests. --- dlls/mfplat/tests/mfplat.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index f8bd56698b1..f1f61e25d00 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -4262,6 +4262,7 @@ image_size_tests[] = { &MFVideoFormat_RGB565, 1, 1, 4, 0, 64, 4, 64 }, { &MFVideoFormat_RGB24, 3, 5, 60, 0, 320, 60, 64 }, { &MFVideoFormat_RGB24, 1, 1, 4, 0, 64, 4, 64 }, + { &MFVideoFormat_RGB24, 4, 3, 36, 0, 192, 36, 64 }, { &MFVideoFormat_RGB32, 3, 5, 60, 0, 320, 60, 64 }, { &MFVideoFormat_RGB32, 1, 1, 4, 0, 64, 4, 64 }, { &MFVideoFormat_ARGB32, 3, 5, 60, 0, 320, 60, 64 }, @@ -4278,6 +4279,7 @@ image_size_tests[] = { &MEDIASUBTYPE_RGB565, 1, 1, 4 }, { &MEDIASUBTYPE_RGB24, 3, 5, 60 }, { &MEDIASUBTYPE_RGB24, 1, 1, 4 }, + { &MEDIASUBTYPE_RGB24, 4, 3, 36 }, { &MEDIASUBTYPE_RGB32, 3, 5, 60 }, { &MEDIASUBTYPE_RGB32, 1, 1, 4 }, @@ -4390,7 +4392,9 @@ static void test_MFCalculateImageSize(void) hr = MFCalculateImageSize(ptr->subtype, ptr->width, ptr->height, &size); todo_wine_if(is_MEDIASUBTYPE_RGB(ptr->subtype) || IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) ok(hr == S_OK || (is_broken && hr == E_INVALIDARG), "%u: failed to calculate image size, hr %#lx.\n", i, hr); - todo_wine_if(is_MEDIASUBTYPE_RGB(ptr->subtype) || IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) + todo_wine_if(is_MEDIASUBTYPE_RGB(ptr->subtype) + || IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11) + || (IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0)) ok(size == ptr->size, "%u: unexpected image size %u, expected %u. Size %u x %u, format %s.\n", i, size, ptr->size, ptr->width, ptr->height, wine_dbgstr_an((char *)&ptr->subtype->Data1, 4)); } @@ -4418,11 +4422,12 @@ static void test_MFGetPlaneSize(void) const struct image_size_test *ptr = &image_size_tests[i]; unsigned int plane_size = ptr->plane_size ? ptr->plane_size : ptr->size; if ((is_MEDIASUBTYPE_RGB(ptr->subtype))) - plane_size = 0; + continue; hr = pMFGetPlaneSize(ptr->subtype->Data1, ptr->width, ptr->height, &size); ok(hr == S_OK, "%u: failed to get plane size, hr %#lx.\n", i, hr); - todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) + todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11) + || (IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0)) ok(size == plane_size, "%u: unexpected plane size %lu, expected %u. Size %u x %u, format %s.\n", i, size, plane_size, ptr->width, ptr->height, wine_dbgstr_an((char*)&ptr->subtype->Data1, 4)); } @@ -5989,11 +5994,13 @@ static void test_MFCreate2DMediaBuffer(void) hr = IMF2DBuffer_GetContiguousLength(_2dbuffer, &length); ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr); + todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0) ok(length == ptr->contiguous_length, "%d: unexpected contiguous length %lu for %u x %u, format %s.\n", i, length, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype)); hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL); ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr); + todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0) ok(length2 == ptr->contiguous_length, "%d: unexpected linear buffer length %lu for %u x %u, format %s.\n", i, length2, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype)); -- 2.11.4.GIT