From 00eb88f893010c4e6efeb2e15f5181d4dfc7d199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Mon, 16 Mar 2020 02:35:44 +0100 Subject: cam: Create stream names after configuring the camera MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stream in the stream configuration is not filled in before we configure the camera, move the generating and caching of names after the configuration. Without this fix writing multiple streams to disk overwrites the frames as the filenames are not unique. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/cam/capture.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp index 7d970f99..6cbdc98c 100644 --- a/src/cam/capture.cpp +++ b/src/cam/capture.cpp @@ -30,18 +30,18 @@ int Capture::run(EventLoop *loop, const OptionsParser::Options &options) return -ENODEV; } - streamName_.clear(); - for (unsigned int index = 0; index < config_->size(); ++index) { - StreamConfiguration &cfg = config_->at(index); - streamName_[cfg.stream()] = "stream" + std::to_string(index); - } - ret = camera_->configure(config_); if (ret < 0) { std::cout << "Failed to configure camera" << std::endl; return ret; } + streamName_.clear(); + for (unsigned int index = 0; index < config_->size(); ++index) { + StreamConfiguration &cfg = config_->at(index); + streamName_[cfg.stream()] = "stream" + std::to_string(index); + } + camera_->requestCompleted.connect(this, &Capture::requestComplete); if (options.isSet(OptFile)) { -- cgit v1.2.1