summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2014-03-13 16:35:01 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-17 14:46:53 +0100
commitc24c3b171f61a673d4905aba4bc94c04a22adea3 (patch)
tree67df5847f5b41adea07c1c83350cfcf21349ffd4 /src
parentd204391cc1cf75601a8fb4a5037060508af40585 (diff)
Android: fix QMediaRecorder failing to start in some cases.
Because camera operations are performed in a dedicated thread, starting a recorder was sometimes failing because the camera was not yet ready (unlocking it was not done yet). Camera locking and unlocking are now synchronous operations. Change-Id: I92c3c2f3666b63e7451e4ee1ab89dcbc85ae6c24 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/android/src/wrappers/jcamera.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/android/src/wrappers/jcamera.cpp b/src/plugins/android/src/wrappers/jcamera.cpp
index 23f3e14b4..50a65a779 100644
--- a/src/plugins/android/src/wrappers/jcamera.cpp
+++ b/src/plugins/android/src/wrappers/jcamera.cpp
@@ -306,12 +306,16 @@ int JCamera::cameraId() const
void JCamera::lock()
{
- QMetaObject::invokeMethod(d, "callVoidMethod", Q_ARG(QByteArray, "lock"));
+ QMetaObject::invokeMethod(d, "callVoidMethod",
+ Qt::BlockingQueuedConnection,
+ Q_ARG(QByteArray, "lock"));
}
void JCamera::unlock()
{
- QMetaObject::invokeMethod(d, "callVoidMethod", Q_ARG(QByteArray, "unlock"));
+ QMetaObject::invokeMethod(d, "callVoidMethod",
+ Qt::BlockingQueuedConnection,
+ Q_ARG(QByteArray, "unlock"));
}
void JCamera::reconnect()