[PATCH 2/4] mfreadwrite/tests: Add some video media type attributes tests.

Nikolay Sivov nsivov at codeweavers.com
Mon Nov 1 18:34:38 CDT 2021



On 10/28/21 5:01 PM, Rémi Bernon wrote:
> +    UINT32 uint32_value, buffer_value_size, width = expect->width, height = expect->height;
> +    BOOL is_h264 = IsEqualGUID(&expect->subtype, &MFVideoFormat_H264);
> +    BYTE buffer_value[512];
> +    UINT64 uint64_value;
> +    GUID guid_value;
> +    HRESULT hr;
> +
> +    memset(&guid_value, 0xcd, sizeof(guid_value));
> +    hr = IMFMediaType_GetGUID(media_type, &MF_MT_MAJOR_TYPE, &guid_value);
> +    ok(hr == S_OK, "missing MF_MT_MAJOR_TYPE, hr %#x\n", hr);
> +    ok(IsEqualGUID(&guid_value, &MFMediaType_Video), "got MF_MT_MAJOR_TYPE %s\n", debugstr_guid(&guid_value));
> +
> +    memset(&guid_value, 0xcd, sizeof(guid_value));
> +    hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid_value);
> +    ok(hr == S_OK, "missing MF_MT_SUBTYPE, hr %#x\n", hr);
> +    todo_wine_if(is_h264)
> +    ok(IsEqualGUID(&guid_value, &expect->subtype), "got MF_MT_SUBTYPE %s\n", debugstr_guid(&guid_value));
> +
> +    uint32_value = 0xdeadbeef;
> +    hr = IMFMediaType_GetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, &uint32_value);
> +    if (is_h264)
> +    {
> +        todo_wine
> +        ok(hr == MF_E_ATTRIBUTENOTFOUND, "got MF_MT_ALL_SAMPLES_INDEPENDENT, hr %#x\n", hr);
> +    }
> +    else
> +    {
> +        ok(hr == S_OK, "missing MF_MT_ALL_SAMPLES_INDEPENDENT, hr %#x\n", hr);
> +        ok(uint32_value == 1, "got MF_MT_ALL_SAMPLES_INDEPENDENT %u\n", uint32_value);
> +    }
It's certainly possible decoders differ in attributes they use, but here
what matters is compressed/uncompressed distinction, and not whether
it's H264 or not, I think. So turning this in two paths, with
possibility to add more format-specific checks for compressed part, will
make this more compact and easy to follow.



More information about the wine-devel mailing list