From 325dc1e4d2456b56b88a3241cb552f7a23db5cb5 Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Sun, 9 Sep 2012 17:57:23 +0300 Subject: [PATCH] Stop the pipeline if the camera becomes idle and our window is not active --- qml/main.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qml/main.qml b/qml/main.qml index 28ca75a..f50729c 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -72,13 +72,19 @@ PageStackWindow { cam.start(); } else { - // TODO: only stop if idle. + // This is a noop if camera is not idle so calling it will not hurt cam.stop(); } } } Camera { + onIdleChanged: { + if (idle && !platformWindow.active) { + stop(); + } + } + onDeviceIdChanged: { if (platformWindow.active) { cam.start(); -- 2.34.1