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/evrd3dpresentengine.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/evrd3dpresentengine.h')
-rw-r--r-- | src/plugins/common/evr/evrd3dpresentengine.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/common/evr/evrd3dpresentengine.h b/src/plugins/common/evr/evrd3dpresentengine.h index 8d9bca2dd..854e3c84b 100644 --- a/src/plugins/common/evr/evrd3dpresentengine.h +++ b/src/plugins/common/evr/evrd3dpresentengine.h @@ -41,6 +41,7 @@ #define EVRD3DPRESENTENGINE_H #include <QMutex> +#include <QSize> #include <QVideoSurfaceFormat> #include <d3d9.h> @@ -120,7 +121,7 @@ public: bool supportsTextureRendering() const; bool isTextureRenderingEnabled() const { return m_useTextureRendering; } - HRESULT createVideoSamples(IMFMediaType *format, QList<IMFSample*>& videoSampleQueue); + HRESULT createVideoSamples(IMFMediaType *format, QList<IMFSample*>& videoSampleQueue, QSize frameSize); QVideoSurfaceFormat videoSurfaceFormat() const { return m_surfaceFormat; } QVideoFrame makeVideoFrame(IMFSample* sample); |