diff options
author | Andy Shaw <andy.shaw@qt.io> | 2020-11-27 11:31:43 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2020-11-30 10:32:39 +0000 |
commit | 67d1ff140e60e3372d05fc7af2cf85de891a31f0 (patch) | |
tree | 39b007b420cbaf54926a6ccb307402fc4a142469 | |
parent | bef870b733bb8676a9cbce3bcd9e7939e56b358c (diff) |
Revert "Map QVideoFrame::Format_Y8=>QImage::Format_Grayscale8 in QVideoFrame"
This reverts commit 2b96c113cf7057b556856149114999b973b3f2c2, due to the
fact that it introduces a problem with existing cameras on Windows. So
reverting for now until a fix can be found.
Pick-to: 5.15
Change-Id: Ica59c8a68de7aecf6a4ebd1bd044363e9acefd93
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
4 files changed, 5 insertions, 9 deletions
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp index 2df52f360..712b6b8f3 100644 --- a/src/multimedia/video/qvideoframe.cpp +++ b/src/multimedia/video/qvideoframe.cpp @@ -963,8 +963,6 @@ QVideoFrame::PixelFormat QVideoFrame::pixelFormatFromImageFormat(QImage::Format return Format_RGB555; case QImage::Format_RGB888: return Format_RGB24; - case QImage::Format_Grayscale8: - return Format_Y8; default: return Format_Invalid; } @@ -1018,13 +1016,12 @@ QImage::Format QVideoFrame::imageFormatFromPixelFormat(PixelFormat format) case Format_IMC2: case Format_IMC3: case Format_IMC4: + case Format_Y8: case Format_Y16: case Format_Jpeg: case Format_CameraRaw: case Format_AdobeDng: return QImage::Format_Invalid; - case Format_Y8: - return QImage::Format_Grayscale8; case Format_User: default: return QImage::Format_Invalid; diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp index bb194bd61..6ba7cff02 100644 --- a/src/multimediawidgets/qpaintervideosurface.cpp +++ b/src/multimediawidgets/qpaintervideosurface.cpp @@ -108,8 +108,7 @@ QVideoSurfaceGenericPainter::QVideoSurfaceGenericPainter() m_imagePixelFormats << QVideoFrame::Format_RGB24; m_imagePixelFormats << QVideoFrame::Format_ARGB32 - << QVideoFrame::Format_RGB565 - << QVideoFrame::Format_Y8; + << QVideoFrame::Format_RGB565; } QList<QVideoFrame::PixelFormat> QVideoSurfaceGenericPainter::supportedPixelFormats( diff --git a/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp b/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp index 98ec5fc06..be5c85ab9 100644 --- a/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp +++ b/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp @@ -253,8 +253,8 @@ void tst_QPainterVideoSurface::supportedFormat_data() << QAbstractVideoBuffer::NoHandle << QVideoFrame::Format_Y8 << QSize(640, 480) - << true - << true; + << false + << false; QTest::newRow("Texture: rgb32 640x480") << QAbstractVideoBuffer::GLTextureHandle << QVideoFrame::Format_RGB32 diff --git a/tests/auto/unit/qvideoframe/tst_qvideoframe.cpp b/tests/auto/unit/qvideoframe/tst_qvideoframe.cpp index e99c4bf77..402ddf334 100644 --- a/tests/auto/unit/qvideoframe/tst_qvideoframe.cpp +++ b/tests/auto/unit/qvideoframe/tst_qvideoframe.cpp @@ -978,7 +978,7 @@ void tst_QVideoFrame::formatConversion_data() << QImage::Format_Invalid << QVideoFrame::Format_IMC4; QTest::newRow("QVideoFrame::Format_Y8") - << QImage::Format_Grayscale8 + << QImage::Format_Invalid << QVideoFrame::Format_Y8; QTest::newRow("QVideoFrame::Format_Y16") << QImage::Format_Invalid |