summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mira <samuel.mira@qt.io>2022-04-27 23:11:35 +0300
committerSamuel Mira <samuel.mira@qt.io>2022-04-28 01:58:23 +0300
commit41af1f5d8f8154dec1458eccf93aa5660b6be49e (patch)
treef1222d6985cf34738464e7a6272131ad903fdcd3
parenta4e426b14b3905d2b4e4c2789ae1aea7f9d5bef5 (diff)
Fix Camera Preview on declarative-camera
The example declarative camera showed a black screen in the camera preview until a touch on the screen occurred. It was introduced by 36f110e6c97e2c98ded86945825aa563fd93f2e0 patch. This patch fixes this issue. While working on the issue, the fix uncovered another issue regarding setting a camera format not correctly initialized. That is also fixed on this patch. Task-number: QTBUG-102029 Change-Id: I27adb97be2c2ace5f33818256e5b47ecf9e7210f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> (cherry picked from commit 540ff1496bcc9ef4019eb34978715b79ef0615a4)
-rw-r--r--src/multimedia/platform/android/common/qandroidvideooutput.cpp2
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/multimedia/platform/android/common/qandroidvideooutput.cpp b/src/multimedia/platform/android/common/qandroidvideooutput.cpp
index c1603e0f2..d8e9ca79c 100644
--- a/src/multimedia/platform/android/common/qandroidvideooutput.cpp
+++ b/src/multimedia/platform/android/common/qandroidvideooutput.cpp
@@ -342,7 +342,7 @@ bool QAndroidTextureVideoOutput::renderAndReadbackFrame()
if (moveToOpenGLContextThread()) {
// just moved to another thread, must close the execution of this method
- QMetaObject::invokeMethod(this, "onFrameAvailable", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "onFrameAvailable", Qt::ConnectionType::DirectConnection);
return false;
}
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h b/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h
index fdafe3520..2fdd9d33b 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h
+++ b/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h
@@ -183,7 +183,7 @@ private:
QImageEncoderSettings m_requestedImageSettings;
QImageEncoderSettings m_actualImageSettings;
AndroidCamera::FpsRange m_requestedFpsRange;
- AndroidCamera::ImageFormat m_requestedPixelFromat;
+ AndroidCamera::ImageFormat m_requestedPixelFromat = AndroidCamera::ImageFormat::NV21;
bool m_readyForCapture;
int m_currentImageCaptureId;