diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-03-16 02:35:44 +0100 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-03-18 04:19:02 +0100 |
commit | 00eb88f893010c4e6efeb2e15f5181d4dfc7d199 (patch) | |
tree | 53c8538d6ba01480ddff2f1f42424bb07b66f62b /src/cam | |
parent | d15f979ead99fd0b2acc7cbe5bd1375d7c6df706 (diff) |
cam: Create stream names after configuring the camera
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 <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/cam')
-rw-r--r-- | src/cam/capture.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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)) { |