diff options
author | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2018-11-20 09:05:06 +0100 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2018-11-30 08:39:40 +0000 |
commit | 4aa4bbf4ad701adcb07f20b40ed190a80f51cc5b (patch) | |
tree | 19557a7833acee9d5b1dab11515cf01a97327381 /src/multimedia/video | |
parent | 812351c9d0b81ea6509d85b3bb8464edb9e8d656 (diff) |
Fix conversion from QVideoFrame to QImage to respect bytesPerLine
Since bytes per line can vary and be more than width * bytes in pixel,
it should be respected in the conversion.
This issue could be observed with ANGLE and IDirect3DSurface9 surfaces.
Where IDirect3DSurface9::LockRect returns D3DLOCKED_RECT with Pitch
(number bytes in the row) higher than width * bytes in pixel.
Task-number: QTBUG-71610
Change-Id: Ic62c50382d9006b0f214626f34f2eb4fd70e8377
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/multimedia/video')
-rw-r--r-- | src/multimedia/video/qvideoframe.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp index 426aaef0a..7b1998afc 100644 --- a/src/multimedia/video/qvideoframe.cpp +++ b/src/multimedia/video/qvideoframe.cpp @@ -1107,7 +1107,7 @@ QImage qt_imageFromVideoFrame(const QVideoFrame &f) // Formats supported by QImage don't need conversion QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(frame.pixelFormat()); if (imageFormat != QImage::Format_Invalid) { - result = QImage(frame.bits(), frame.width(), frame.height(), imageFormat).copy(); + result = QImage(frame.bits(), frame.width(), frame.height(), frame.bytesPerLine(), imageFormat).copy(); } // Load from JPG |