From 55228c2b2ca068a4197072a0b36da9a09a63566a Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 13 Apr 2021 12:40:51 -0400 Subject: [PATCH] mfplat: Add corresponding 'IYUV' type alongside 'I420'. Add references the 'IYUV' mediatype wherever 'I420' is referenced, as they are identical. Signed-off-by: Connor McAdams Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mfplat/mediatype.c | 3 +++ dlls/mfplat/tests/mfplat.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 85219c74dd5..c8028b2a46f 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -2634,6 +2634,7 @@ static const struct uncompressed_video_format video_formats[] = { &MFVideoFormat_IMC2, 1, 0, 0, 1 }, { &MFVideoFormat_IMC3, 2, 3, 0, 1 }, { &MFVideoFormat_IMC4, 1, 0, 0, 1 }, + { &MFVideoFormat_IYUV, 1, 0, 0, 1 }, { &MFVideoFormat_NV12, 1, 0, 0, 1 }, { &MFVideoFormat_D16, 2, 3, 0, 0 }, { &MFVideoFormat_L16, 2, 3, 0, 0 }, @@ -2716,6 +2717,7 @@ HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height case MAKEFOURCC('N','V','1','2'): case MAKEFOURCC('Y','V','1','2'): case MAKEFOURCC('I','4','2','0'): + case MAKEFOURCC('I','Y','U','V'): /* 2 x 2 block, interleaving UV for half the height */ *size = ((width + 1) & ~1) * height * 3 / 2; break; @@ -2758,6 +2760,7 @@ HRESULT WINAPI MFGetPlaneSize(DWORD fourcc, DWORD width, DWORD height, DWORD *si case MAKEFOURCC('N','V','1','2'): case MAKEFOURCC('Y','V','1','2'): case MAKEFOURCC('I','4','2','0'): + case MAKEFOURCC('I','Y','U','V'): *size = stride * height * 3 / 2; break; default: diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index c33d540ba4b..603dbbe22ff 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -3979,6 +3979,12 @@ static void test_MFCalculateImageSize(void) { &MFVideoFormat_I420, 4, 3, 18 }, { &MFVideoFormat_I420, 320, 240, 115200 }, + { &MFVideoFormat_IYUV, 1, 1, 3, 1 }, + { &MFVideoFormat_IYUV, 2, 1, 3 }, + { &MFVideoFormat_IYUV, 1, 2, 6, 3 }, + { &MFVideoFormat_IYUV, 4, 3, 18 }, + { &MFVideoFormat_IYUV, 320, 240, 115200 }, + { &MFVideoFormat_YUY2, 2, 1, 4 }, { &MFVideoFormat_YUY2, 4, 3, 24 }, { &MFVideoFormat_YUY2, 128, 128, 32768 }, @@ -5307,6 +5313,10 @@ static void test_MFGetStrideForBitmapInfoHeader(void) { &MFVideoFormat_I420, 2, 2 }, { &MFVideoFormat_I420, 3, 3 }, { &MFVideoFormat_I420, 320, 320 }, + { &MFVideoFormat_IYUV, 1, 1 }, + { &MFVideoFormat_IYUV, 2, 2 }, + { &MFVideoFormat_IYUV, 3, 3 }, + { &MFVideoFormat_IYUV, 320, 320 }, }; unsigned int i; LONG stride;