From: David Gow <david(a)ingeniumdigital.com> Add support for NV12 to evr_render(), as otherwise no video is rendered at all in games like Age of Empires II DE. Signed-off-by: David Gow <david(a)ingeniumdigital.com> --- dlls/evr/evr.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c index 516427c5fff..24ee7551c5d 100644 --- a/dlls/evr/evr.c +++ b/dlls/evr/evr.c @@ -368,10 +368,21 @@ static HRESULT evr_copy_sample_buffer(struct evr *filter, const GUID *subtype, I { width = (3 * width + 3) & ~3; } - else + else if (IsEqualGUID(subtype, &MFVideoFormat_NV12)) + { + /* UV plane has same width as Y (half the pixels, twice the components), but half height. */ + lines = (lines * 3) / 2; + } + else if (IsEqualGUID(subtype, &MFVideoFormat_ARGB32) + || IsEqualGUID(subtype, &MFVideoFormat_RGB32)) { width *= 4; } + else + { + ERR("unsupported video format %s\n", debugstr_guid(subtype)); + return -E_UNEXPECTED; + } if (FAILED(hr = IMediaSample_GetPointer(input_sample, &src))) { @@ -427,7 +438,8 @@ static HRESULT evr_render(struct strmbase_renderer *iface, IMediaSample *input_s if (IsEqualGUID(&subtype, &MFVideoFormat_ARGB32) || IsEqualGUID(&subtype, &MFVideoFormat_RGB32) - || IsEqualGUID(&subtype, &MFVideoFormat_YUY2)) + || IsEqualGUID(&subtype, &MFVideoFormat_YUY2) + || IsEqualGUID(&subtype, &MFVideoFormat_NV12)) { if (SUCCEEDED(hr = evr_copy_sample_buffer(filter, &subtype, input_sample, &sample))) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5157