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:53:09 +0000
commit2f4590a9c3503df4ae3ea068d78c058d756df339 (patch)
tree9783c919dcc49adca0d724f3f9fbe5106dd8766e
parent127be51211fba02975e027d04705d0a82f071df1 (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: