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>
This commit is contained in:
Laurent Pinchart 2021-07-05 07:15:53 +03:00
parent 011b3ff288
commit 4cd0f586fb
3 changed files with 34 additions and 27 deletions

View file

@ -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)) {