From b2538c80b96df937ff6fa823a489bf4710cee0e2 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 25 Sep 2024 13:52:58 +0300 Subject: apps: cam: Print an error when outputting DNG and DNG support is missing When DNG support is missing, the cam application ignores the .dng suffix of the file pattern and writes raw binary data instead, without notifying the user. This leads to confusion. Fix it by printing an error message. Signed-off-by: Laurent Pinchart Reviewed-by: Milan Zamazal Reviewed-by: Jacopo Mondi --- src/apps/cam/camera_session.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/apps/cam/camera_session.cpp') diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index d24ecbb3..edc49b87 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -256,11 +256,16 @@ int CameraSession::start() #endif if (options_.isSet(OptFile)) { - if (!options_[OptFile].toString().empty()) - sink_ = std::make_unique(camera_.get(), streamNames_, - options_[OptFile]); - else - sink_ = std::make_unique(camera_.get(), streamNames_); + std::unique_ptr sink = + std::make_unique(camera_.get(), streamNames_); + + if (!options_[OptFile].toString().empty()) { + ret = sink->setFilePattern(options_[OptFile]); + if (ret) + return ret; + } + + sink_ = std::move(sink); } if (sink_) { -- cgit v1.2.1