diff options
author | André de la Rocha <andre.rocha@qt.io> | 2022-08-16 20:33:53 +0200 |
---|---|---|
committer | André de la Rocha <andre.rocha@qt.io> | 2022-09-28 11:19:48 +0200 |
commit | 729cdaed40a90ef7ffbf208f7272b9a95b945283 (patch) | |
tree | c4f46fe67d3c756fc2dac0fdaed826d3aeb41f2b /src/plugins/common/evr/evrvideowindowcontrol.h | |
parent | 11c4ad2c8a39819c9359341ef0145984b9ac16d0 (diff) |
Windows: Fix cropping for HEVC-encoded videos
The cropping info associated with HEVC-encoded video files was not
being applied and as a result some videos could show garbage on
the borders of the actual video contents, since instead of the
source frames width and height, the sizes in pixels of the buffers
used by the encoding algorithm, which are padded to multiples of
some power of two, were used.
Root cause seems to be a bug in Media Foundation or incompatibility
with the Windows HEVC decoder, as the API is returning buffer sizes
where sizes of actual video contents should be returned. It works
as expected for other video formats.
This patch makes the QtMultimedia decoder enforce the actual video
dimensions obtained through the file's metadata.
Fixes: QTBUG-105381
Change-Id: I2d67c64f07de489edd1d274060eccd5a4d69bafe
Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 65345a04c67c585c4d38d56cb1416a3033434aaf)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/plugins/common/evr/evrvideowindowcontrol.h')
-rw-r--r-- | src/plugins/common/evr/evrvideowindowcontrol.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/common/evr/evrvideowindowcontrol.h b/src/plugins/common/evr/evrvideowindowcontrol.h index 6dead07dd..cfc548918 100644 --- a/src/plugins/common/evr/evrvideowindowcontrol.h +++ b/src/plugins/common/evr/evrvideowindowcontrol.h @@ -85,6 +85,8 @@ public: void applyImageControls(); + void setCropRect(QRect cropRect); + private: void clear(); DXVA2_Fixed32 scaleProcAmpValue(DWORD prop, int value) const; @@ -94,6 +96,7 @@ private: DWORD m_dirtyValues; Qt::AspectRatioMode m_aspectRatioMode; QRect m_displayRect; + QRect m_cropRect; int m_brightness; int m_contrast; int m_hue; |