diff options
Diffstat (limited to 'src/apps/cam/camera_session.cpp')
-rw-r--r-- | src/apps/cam/camera_session.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index d24ecbb3..6e9890cc 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -160,10 +160,13 @@ void CameraSession::listControls() const { for (const auto &[id, info] : camera_->controls()) { if (info.values().empty()) { - std::cout << "Control: " << id->name() << ": " + std::cout << "Control: " + << id->vendor() << "::" << id->name() << ": " << info.toString() << std::endl; } else { - std::cout << "Control: " << id->name() << ":" << std::endl; + std::cout << "Control: " + << id->vendor() << "::" << id->name() << ":" + << std::endl; for (const auto &value : info.values()) { int32_t val = value.get<int32_t>(); const auto &it = id->enumerators().find(val); @@ -256,11 +259,16 @@ int CameraSession::start() #endif if (options_.isSet(OptFile)) { - if (!options_[OptFile].toString().empty()) - sink_ = std::make_unique<FileSink>(camera_.get(), streamNames_, - options_[OptFile]); - else - sink_ = std::make_unique<FileSink>(camera_.get(), streamNames_); + std::unique_ptr<FileSink> sink = + std::make_unique<FileSink>(camera_.get(), streamNames_); + + if (!options_[OptFile].toString().empty()) { + ret = sink->setFilePattern(options_[OptFile]); + if (ret) + return ret; + } + + sink_ = std::move(sink); } if (sink_) { |