summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mira <samuel.mira@qt.io>2022-01-11 17:58:56 +0000
committerSamuel Mira <samuel.mira@qt.io>2022-01-18 10:52:56 +0000
commit04236072332ade26467ccb4ff8c1e0b2ad7f1959 (patch)
treeeea09a8b66de109ef6dca7c4acd59c876909e877
parent98a3819749feddbc8543b25f72937aa82205190a (diff)
Fix Android sending a single video frame
Android was not sending video frames automatically, and it had to readback frame for the next frame to be available. This patch forces the emit of the frameAvailable. Fixes: QTBUG-99650 Change-Id: I7559c65b734724d4e21bbb9b2e7f3a3ae8de97d2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 372349a1b4f01e4ad5470ed2403fb20d4a0b0214)
-rw-r--r--src/multimedia/platform/android/common/qandroidvideooutput.cpp5
-rw-r--r--tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp6
2 files changed, 5 insertions, 6 deletions
diff --git a/src/multimedia/platform/android/common/qandroidvideooutput.cpp b/src/multimedia/platform/android/common/qandroidvideooutput.cpp
index 6f62e2412..6c15e8324 100644
--- a/src/multimedia/platform/android/common/qandroidvideooutput.cpp
+++ b/src/multimedia/platform/android/common/qandroidvideooutput.cpp
@@ -270,6 +270,11 @@ void QAndroidTextureVideoOutput::onFrameAvailable()
: QVideoFrameFormat::Format_RGBA8888;
QVideoFrame frame(buffer, QVideoFrameFormat(m_nativeSize, format));
m_sink->platformVideoSink()->setVideoFrame(frame);
+
+ QMetaObject::invokeMethod(m_surfaceTexture
+ , "frameAvailable"
+ , Qt::QueuedConnection
+ );
}
static const float g_quad[] = {
diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
index 058183c6d..0cbee4ba8 100644
--- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
+++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
@@ -118,12 +118,6 @@ public Q_SLOTS:
if (m_storeFrames)
m_frameList.append(frame);
++m_totalFrames;
-
-#ifdef Q_OS_ANDROID
- // in android it is necessary call the frame map for the
- // AndroidTextureVideoBuffer to updateReadbackFrame
- static_cast<QVideoFrame>(frame).map(QVideoFrame::ReadOnly);
-#endif
}
public: