On Thu Aug 25 17:28:23 2022 +0000, **** wrote:
Zebediah Figura (she/her) replied on the mailing list:
On 8/25/22 12:13, Nikolay Sivov wrote: > + mediatype_set_guid(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video, &hr); > + mediatype_set_guid(media_type, &MF_MT_SUBTYPE, subtype, &hr); > + mediatype_set_uint64(media_type, &MF_MT_PIXEL_ASPECT_RATIO, 1, 1, &hr); > + mediatype_set_uint32(media_type, &MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive, &hr); > + mediatype_set_uint64(media_type, &MF_MT_FRAME_SIZE, vih->bmiHeader.biWidth, vih->bmiHeader.biHeight, &hr); > + mediatype_set_uint32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1, &hr); > + > + if (SUCCEEDED(MFGetStrideForBitmapInfoHeader(subtype->Data1, vih->bmiHeader.biWidth, &stride))) > + { > + mediatype_set_uint32(media_type, &MF_MT_DEFAULT_STRIDE, stride, &hr); > + mediatype_set_uint32(media_type, &MF_MT_SAMPLE_SIZE, abs(stride) * vih->bmiHeader.biHeight, &hr); > + mediatype_set_uint32(media_type, &MF_MT_FIXED_SIZE_SAMPLES, 1, &hr); Note that it's legal for the height to be negative, indicating that the video is flipped. I don't know if that means the same thing in MF_MT_FRAME_SIZE (the documentation doesn't say so, at least) but I think it does mean that MF_MT_SAMPLE_SIZE is broken.
That's a good point, I'll add some tests.