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>
This commit is contained in:
parent
d15f979ead
commit
00eb88f893
1 changed files with 6 additions and 6 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue