From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/mediatype.c | 17 +++++++++++++++++ dlls/mfplat/tests/mfplat.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+)
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 245922ba068..16854c7a5a4 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -26,6 +26,7 @@ #include "ks.h" #include "ksmedia.h" #include "amvideo.h" +#include "wmcodecdsp.h"
WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
@@ -3593,6 +3594,22 @@ static const GUID * get_mf_subtype_for_am_subtype(const GUID *subtype)
if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB32)) return &MFVideoFormat_RGB32; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_ARGB32)) + return &MFVideoFormat_ARGB32; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_I420)) + return &MFVideoFormat_I420; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_AYUV)) + return &MFVideoFormat_AYUV; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_YV12)) + return &MFVideoFormat_YV12; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_YUY2)) + return &MFVideoFormat_YUY2; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_UYVY)) + return &MFVideoFormat_UYVY; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_YVYU)) + return &MFVideoFormat_YVYU; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_NV12)) + return &MFVideoFormat_NV12; else { FIXME("Unknown subtype %s.\n", debugstr_guid(subtype)); diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 1e5dc190944..58321672cea 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -56,6 +56,7 @@ #undef EXTERN_GUID #define EXTERN_GUID DEFINE_GUID #include "mfd3d12.h" +#include "wmcodecdsp.h"
DEFINE_GUID(DUMMY_CLSID, 0x12345678,0x1234,0x1234,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19); DEFINE_GUID(DUMMY_GUID1, 0x12345678,0x1234,0x1234,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21); @@ -8421,6 +8422,22 @@ static void test_MFInitMediaTypeFromAMMediaType(void) {0}, {0}, 0, 0, 0, {sizeof(BITMAPINFOHEADER), 32, 24, 1, 0, 0xdeadbeef} }; + static const struct guid_type_pair + { + const GUID *am_type; + const GUID *mf_type; + } guid_types[] = + { + { &MEDIASUBTYPE_I420, &MFVideoFormat_I420 }, + { &MEDIASUBTYPE_AYUV, &MFVideoFormat_AYUV }, + { &MEDIASUBTYPE_YV12, &MFVideoFormat_YV12 }, + { &MEDIASUBTYPE_YUY2, &MFVideoFormat_YUY2 }, + { &MEDIASUBTYPE_UYVY, &MFVideoFormat_UYVY }, + { &MEDIASUBTYPE_YVYU, &MFVideoFormat_YVYU }, + { &MEDIASUBTYPE_NV12, &MFVideoFormat_NV12 }, + { &MEDIASUBTYPE_ARGB32, &MFVideoFormat_ARGB32 }, + }; + unsigned int i;
hr = MFCreateMediaType(&media_type); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); @@ -8539,6 +8556,22 @@ static void test_MFInitMediaTypeFromAMMediaType(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(value32 == 128, "Unexpected value %d.\n", value32);
+ vih.bmiHeader.biHeight = 24; + for (i = 0; i < ARRAY_SIZE(guid_types); ++i) + { + memcpy(&mt.subtype, guid_types[i].am_type, sizeof(GUID)); + + hr = MFInitMediaTypeFromAMMediaType(media_type, &mt); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaType_GetGUID(media_type, &MF_MT_MAJOR_TYPE, &guid); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(IsEqualGUID(&guid, &MFMediaType_Video), "Unexpected guid %s.\n", debugstr_guid(&guid)); + hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(IsEqualGUID(&guid, guid_types[i].mf_type), "Unexpected guid %s.\n", debugstr_guid(&guid)); + } + IMFMediaType_Release(media_type); }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=131694
Your paranoid android.
=== debian11 (32 bit report) ===
evr: evr.c:677: Test succeeded inside todo block: Got hr 0.