mfvideoenc: Fix broken encoding when resolution is not an even number
authorSeungha Yang <seungha@centricular.com>
Sat, 25 Jun 2022 21:39:54 +0000 (06:39 +0900)
committerSeungha Yang <seungha@centricular.com>
Wed, 29 Jun 2022 08:26:45 +0000 (08:26 +0000)
commit236378c9d5be1fc8dbbff897888ecd86d421a9d0
tree089642de5414e390de836be8c62f7e81a889b642
parent4902076968bb62fc03f70bc7c733eeb1d26f40d2
mfvideoenc: Fix broken encoding when resolution is not an even number

Width and height values of 4:2:0 subsampled YUV format should be even number,
and if it's not the case, there should be padding which is not a contiguous memory layout.
Do copy input frames to MediaFoundation's memory in that case for now.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1165
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2661>
subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoencoder.cpp
subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoencoder.h