diff options
author | Bartlomiej Moskal <bartlomiej.moskal@qt.io> | 2023-02-02 15:02:25 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-07 10:34:06 +0000 |
commit | 654b0d2f00a6b8bea68b89fb20824154395d3c1d (patch) | |
tree | 6d763569f353e50b928641bb0cd32a5cb23dd94f | |
parent | 8242b3d15510f6376bb1c9e0b412cfb8bcfae445 (diff) |
Android: Properly clean AndroidSurfaceTexture before deleting
After commit: d4e02d9efd6e8e41aa1a83c0f3d6534d138e7ae3, deadlock from
QAndroidTextureVideoOutput was removed. Necessary cleanup for m_rhi
member (which was created in thread of AndroidTextureThread) was also
added.
After that, during the clean up, we can still get a crash with log
error:
F libapptestVideo_arm64-v8a.so: Cannot make QOpenGLContext current in a
different thread
F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 28160
(qtMainLoopThrea), pid 28130
To avoid that, we need to be sure, that m_rhi was cleared before
m_surfaceThread was stopped. That is why clearSurfaceTexture is called
as BlockingQueuedConnection.
Fixes: QTBUG-110797
Change-Id: I35aa72c8416a99c5372f93d455bc23963fa182e4
Reviewed-by: Samuel Mira <samuel.mira@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit d3f0b75e3c1e98988eec439bf51945e4047ff2af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/plugins/multimedia/android/common/qandroidvideooutput.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/multimedia/android/common/qandroidvideooutput.cpp b/src/plugins/multimedia/android/common/qandroidvideooutput.cpp index 43f2cd760..8ec0ec9d2 100644 --- a/src/plugins/multimedia/android/common/qandroidvideooutput.cpp +++ b/src/plugins/multimedia/android/common/qandroidvideooutput.cpp @@ -348,7 +348,8 @@ QAndroidTextureVideoOutput::QAndroidTextureVideoOutput(QVideoSink *sink, QObject QAndroidTextureVideoOutput::~QAndroidTextureVideoOutput() { - QMetaObject::invokeMethod(m_surfaceThread.get(), &AndroidTextureThread::clearSurfaceTexture); + QMetaObject::invokeMethod(m_surfaceThread.get(), + &AndroidTextureThread::clearSurfaceTexture, Qt::BlockingQueuedConnection); m_surfaceThread->quit(); m_surfaceThread->wait(); } |