summaryrefslogtreecommitdiffstats
path: root/src/multimedia/doc
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-08-05 21:11:18 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2021-08-09 14:30:11 +0200
commit6e479464a37ddc6abbc46fbd5a3a1065091da480 (patch)
treee5c95bcfccbd97fe90d730b5c49ec5b48b648613 /src/multimedia/doc
parente49d7b66d9f48a9b0c4e5535f6feb9e82638669d (diff)
Larger rework of the RGB pixel formats
Until now, pixel formats where not declared in an endian independent way. Format_ARGB32 meant that we casted the data to an array of integers and interpreted the highest 8 bits as alpha. This is unfortunate, as this adds endianness into the picture and complicates things. Change this towards endian independent ordering of the A, R, G and B components. New names of those formats are in line with the endian independent formats in QImage, where RGBA8888 indicates that the first byte is R and the last byte A. Add a couple of missing RGB formats, so that we have a symmetrical set and extend our conversion handling and other places to cover those as well. Refactor all our code to use the new formats and adjust our built-in converters to QImage to handle them correctly. Also refactor the SSE/AVX optimized code paths to handle all RGB based pixel formats. Adjust our shaders to work correctly with the new definitions. Finally enable all RGB pixel formats for GL accelerated rendering on gstreamer, as the byte order issues are now solved. Change-Id: I8927dc01d569233e9868e54b890f0f7c34705a2b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/multimedia/doc')
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/video.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/video.cpp b/src/multimedia/doc/snippets/multimedia-snippets/video.cpp
index a04363248..4e29269d8 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/video.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/video.cpp
@@ -128,7 +128,7 @@ void VideoExample::VideoSurface()
{
//! [Widget Surface]
QImage img = QImage("images/qt-logo.png").convertToFormat(QImage::Format_ARGB32);
- QVideoFrameFormat format(img.size(), QVideoFrameFormat::Format_ARGB32);
+ QVideoFrameFormat format(img.size(), QVideoFrameFormat::Format_ARGB8888);
videoWidget = new QVideoWidget;
videoWidget->videoSurface()->start(format);
videoWidget->videoSurface()->present(img);