summaryrefslogtreecommitdiff
path: root/src/cam/main.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-05 07:15:53 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-22 17:13:43 +0300
commit4cd0f586fbc7bc8451bd18aaa3b59fbd8d53574e (patch)
tree6147fa3225677933db60aa7b78ba4936120e3894 /src/cam/main.cpp
parent011b3ff288826460b76c59a5899c92ecd8226643 (diff)
cam: Move event loop execution from CameraSession to CamApp
To prepare for multiple concurrent camera sessions, move the event loop exec() call from the CameraSession class to the CamApp class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/cam/main.cpp')
-rw-r--r--src/cam/main.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cam/main.cpp b/src/cam/main.cpp
index a567a7cc..b13230c3 100644
--- a/src/cam/main.cpp
+++ b/src/cam/main.cpp
@@ -371,7 +371,17 @@ int CamApp::run()
if (options_.isSet(OptCapture)) {
CameraSession session(camera_, config_.get());
session.captureDone.connect(this, &CamApp::captureDone);
- return session.run(options_);
+
+ ret = session.start(options_);
+ if (ret) {
+ std::cout << "Failed to start camera session" << std::endl;
+ return ret;
+ }
+
+ loop_.exec();
+
+ session.stop();
+ return 0;
}
if (options_.isSet(OptMonitor)) {