``` + if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) + return hr; ```
No need to call a method on yourself, you can just access impl->output_info.
``` + if (pitch < 0) + pitch = -pitch; ```
Well, in a sense yes, but we also don't actually handle this case. It probably would be better to just spit an ERR, and ideally return failure, than to pretend to handle it and not actually do so.
``` +HRESULT wg_transform_read_mf(wg_transform_t transform, IMFSample *sample, + DWORD plane_size, DWORD *flags, bool *preserve_timestamps) ```
As far as I can tell both the callers and the function expect the size of the entire frame, not just (the first) plane.
``` + if (wg_sample->stride && plane_size) + { + /* The sample size must match the frame size, which differs from the contiguous length + * if the buffer has extra width. MF allows a frame to be placed in a wider 2D buffer. */ + sample_size = min(plane_size, wg_sample->size); + } ```
So the length we set is supposed to *exclude* padding? But it doesn't exclude the padding that the sample has according to normal YUV rules?