summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJøger Hansegård <joger.hansegard@qt.io>2023-09-19 15:59:34 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-09-20 18:13:46 +0000
commit104e76ebe34e626f794985e692ae5b8a1db0e62a (patch)
treeeba00b1860a3b60c578921fbd1c77171d9bc07ee
parent1f01fdd6b267f78040f7ae203ac2c6962c1e2153 (diff)
Mute warning that always appear on first call to QVideoFrame::toImage
When calling the QVideoFrame::toImage using the FFmpeg backend, the following warning was always logged: QVideoFrame::toImage: failed to get textures for frame; format: 172 textureConverter null This happens because the textureConverter is null (as evident from the log message). By code inspection, whe see that when called through the QVideoFrame::toImage/qImageFromVideoFrame functions, the textureConverter will always be null. It is only when called through a QVideoWindow that direct HW transfer is enabled. Therefore it makes sense to mute the warning if we don't have a textureConverter. Fixes: QTBUG-116688 Change-Id: I5e2a1c80f24c04b42ccd5f44b7fdeca3c6ada9e4 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit fd9faa342a0c8656741c4197f8d9b62cc0989858) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 51da96e94590ea4aee3f6a5c32311879fb305b31)
-rw-r--r--src/plugins/multimedia/ffmpeg/qffmpegvideobuffer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpegvideobuffer.cpp b/src/plugins/multimedia/ffmpeg/qffmpegvideobuffer.cpp
index 4fdb80cae..7b72a3cfe 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpegvideobuffer.cpp
+++ b/src/plugins/multimedia/ffmpeg/qffmpegvideobuffer.cpp
@@ -204,12 +204,16 @@ std::unique_ptr<QVideoFrameTextures> QFFmpegVideoBuffer::mapTextures(QRhi *)
return {};
if (!hwFrame)
return {};
+ if (textureConverter.isNull()) {
+ textures = nullptr;
+ return {};
+ }
+
textures.reset(textureConverter.getTextures(hwFrame.get()));
if (!textures) {
static thread_local int lastFormat = 0;
if (std::exchange(lastFormat, hwFrame->format) != hwFrame->format) // prevent logging spam
- qWarning() << " failed to get textures for frame; format:" << hwFrame->format
- << "textureConverter" << (textureConverter.isNull() ? "null" : "not null");
+ qWarning() << " failed to get textures for frame; format:" << hwFrame->format;
}
return {};
}