summaryrefslogtreecommitdiffstats
path: root/src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp
diff options
context:
space:
mode:
authorJøger Hansegård <joger.hansegard@qt.io>2024-04-12 09:42:02 +0200
committerJøger Hansegård <joger.hansegard@qt.io>2024-04-16 20:59:39 +0200
commit30eb2b2417c2658fb324452d1fc76043157ada23 (patch)
tree82ea2077bef8a8ff82666c10df9f8a7664d9d03b /src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp
parent36fd680942e73f77523215a4516986508ba953d2 (diff)
Prevent lost D3D11 device with QVideoFrame::toImage() with Qt Quick
This patch ensures that QFFmpeg::TextureConverter is only used to convert frames when the destination QRhi instance is the same as the one it was initialized on. If QVideoFrame::toImage() is called from the main thread while the frame is also being rendered in the Qt Quick render thread, QVideoFrame::toImage() will create its own QRhi instance. In this case we need to disable direct texture transfer of the QFFmpeg textures, and instead fall back to mapping the texture data through CPU memory. Task-number: QTBUG-113627 Pick-to: 6.7 6.5 Change-Id: I3184796d05627fcac1a069400e8a6a5879fcd5bc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Diffstat (limited to 'src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp')
-rw-r--r--src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp
index 88d6d4f0e..81eef89ef 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp
+++ b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp
@@ -154,7 +154,7 @@ class VAAPITextureSet : public TextureSet
{
public:
~VAAPITextureSet();
- qint64 textureHandle(int plane) override {
+ qint64 textureHandle(QRhi *, int plane) override {
return textures[plane];
}