[PATCH 3/6] mfreadwrite/tests: Add some audio media type attributes tests.

Nikolay Sivov nsivov at codeweavers.com
Tue Nov 9 14:53:08 CST 2021



On 11/8/21 5:08 PM, Rémi Bernon wrote:
> +    static const struct media_type_desc audio_44100_s8_desc =
> +    {
> +        .items =
> +        {
> +            {.key = &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, .value = {.vt = VT_UI4, .ulVal = 44100}, .todo_missing = TRUE},
> +            {.key = &MF_MT_AUDIO_BLOCK_ALIGNMENT, .value = {.vt = VT_UI4, .ulVal = 1}, .todo_missing = TRUE},
> +            {.key = &MF_MT_AUDIO_NUM_CHANNELS, .value = {.vt = VT_UI4, .ulVal = 1}},
> +            {.key = &MF_MT_MAJOR_TYPE, .value = {.vt = VT_CLSID, .puuid = (GUID *)&MFMediaType_Audio}},
> +            {.key = &MF_MT_AUDIO_SAMPLES_PER_SECOND, .value = {.vt = VT_UI4, .ulVal = 44100}},
> +            {.key = &MF_MT_AUDIO_PREFER_WAVEFORMATEX, .value = {.vt = VT_UI4, .ulVal = 1}, .todo_missing = TRUE},
> +            {.key = &MF_MT_ALL_SAMPLES_INDEPENDENT, .value = {.vt = VT_UI4, .ulVal = 1}},
> +            {.key = &MF_MT_AUDIO_BITS_PER_SAMPLE, .value = {.vt = VT_UI4, .ulVal = 8}},
> +            {.key = &MF_MT_SUBTYPE, .value = {.vt = VT_CLSID, .puuid = (GUID *)&MFAudioFormat_PCM}},
> +        },
> +        .todo_spurious = 1,
> +    };
When you explicitly checking audio types, you can drop MAJOR_TYPE,
PREFER_WAVEFORMATEX, ALL_SAMPLES_INDEPENDENT, or maybe even subtype from
static data, because it will always be the same. You can check for these
still right in the loop, for all data entries.



More information about the wine-devel mailing list