summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2018-09-14 11:52:33 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-10-03 10:41:04 +0000
commit704e120042a504cfe5ff76f6f35133f47d067028 (patch)
tree987494c10d21cc2d09b15d8da04f6b3fc2e65b05 /src
parentf4cd7293efda5042d1fb66f4d4fb3ae5dde3c125 (diff)
Android: Change video frame format from BGR32 to ABGR32
When mapping video frame, data will be downloaded to QImage from frame buffer with QImage::Format_RGBX8888 which is XBGR32 in Little Endian. Thus added new pixel format QVideoFrame::Format_ABGR32. Changed QVideoFrame::Format_BGR32 to QVideoFrame::Format_ABGR32. Task-number: QTBUG-69968 Change-Id: I0f58d1a5b5cbdb5ab48ee5ad4d75f9b62f516333 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/multimedia/video/qvideoframe.cpp3
-rw-r--r--src/multimedia/video/qvideoframe.h1
-rw-r--r--src/plugins/android/src/common/qandroidvideooutput.cpp2
-rw-r--r--src/plugins/android/videonode/qandroidsgvideonodeplugin.cpp2
4 files changed, 6 insertions, 2 deletions
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp
index bbb87b63b..116436277 100644
--- a/src/multimedia/video/qvideoframe.cpp
+++ b/src/multimedia/video/qvideoframe.cpp
@@ -195,6 +195,9 @@ private:
\value Format_BGRA32_Premultiplied
The frame is stored using a premultiplied 32bit BGRA format.
+ \value Format_ABGR32
+ The frame is stored using a 32-bit ABGR format (0xAABBGGRR).
+
\value Format_BGR32
The frame is stored using a 32-bit BGR format (0xBBGGRRff).
diff --git a/src/multimedia/video/qvideoframe.h b/src/multimedia/video/qvideoframe.h
index be7517c7c..2d906cb7c 100644
--- a/src/multimedia/video/qvideoframe.h
+++ b/src/multimedia/video/qvideoframe.h
@@ -75,6 +75,7 @@ public:
Format_ARGB8565_Premultiplied,
Format_BGRA32,
Format_BGRA32_Premultiplied,
+ Format_ABGR32,
Format_BGR32,
Format_BGR24,
Format_BGR565,
diff --git a/src/plugins/android/src/common/qandroidvideooutput.cpp b/src/plugins/android/src/common/qandroidvideooutput.cpp
index b425b9d89..eeaf70982 100644
--- a/src/plugins/android/src/common/qandroidvideooutput.cpp
+++ b/src/plugins/android/src/common/qandroidvideooutput.cpp
@@ -314,7 +314,7 @@ void QAndroidTextureVideoOutput::onFrameAvailable()
return;
QAbstractVideoBuffer *buffer = new AndroidTextureVideoBuffer(this, m_nativeSize);
- QVideoFrame frame(buffer, m_nativeSize, QVideoFrame::Format_BGR32);
+ QVideoFrame frame(buffer, m_nativeSize, QVideoFrame::Format_ABGR32);
if (m_surface->isActive() && (m_surface->surfaceFormat().pixelFormat() != frame.pixelFormat()
|| m_surface->surfaceFormat().frameSize() != frame.size())) {
diff --git a/src/plugins/android/videonode/qandroidsgvideonodeplugin.cpp b/src/plugins/android/videonode/qandroidsgvideonodeplugin.cpp
index e69c9c16e..d70c8100b 100644
--- a/src/plugins/android/videonode/qandroidsgvideonodeplugin.cpp
+++ b/src/plugins/android/videonode/qandroidsgvideonodeplugin.cpp
@@ -48,7 +48,7 @@ QList<QVideoFrame::PixelFormat> QAndroidSGVideoNodeFactoryPlugin::supportedPixel
QList<QVideoFrame::PixelFormat> pixelFormats;
if (handleType == QAbstractVideoBuffer::GLTextureHandle)
- pixelFormats.append(QVideoFrame::Format_BGR32);
+ pixelFormats.append(QVideoFrame::Format_ABGR32);
return pixelFormats;
}