mfvideosrc: Fix for negative MF stride
authorSeungha Yang <seungha@centricular.com>
Thu, 19 Aug 2021 12:56:05 +0000 (21:56 +0900)
committerSeungha Yang <seungha@centricular.com>
Thu, 19 Aug 2021 13:01:50 +0000 (22:01 +0900)
commit75f6f79e571dbc3aee66c4ff4e55564c527e9c71
tree49bc606f5679e1ae2c9acc09a79980c5395e182b
parent0a6a8e3869dac3cdcf6e705e3604c58c6e3cbe1f
mfvideosrc: Fix for negative MF stride

Negative stride value can be used in MediaFoundation to inform
whether memory layout is top-down or bottom-up manner. Note that
negative stride is allowed only for RGB, system memory.

See also
https://docs.microsoft.com/en-us/windows/win32/medfound/image-stride

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1646
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2473>
sys/mediafoundation/gstmfsourcereader.cpp
sys/mediafoundation/gstmfutils.cpp
sys/mediafoundation/gstmfutils.h