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 | 92bcef0192d72a6155492f25bd4b4a08e4f74fa5 (patch) | |
tree | b90eb91151267ea07fcfb1031f88e7219e2a0671 | |
parent | 909fc7187f688c2f8c515a8eb8237ec8f35c924d (diff) | |
download | qtmultimedia-92bcef0192d72a6155492f25bd4b4a08e4f74fa5.tar.gz |
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(); } |