From 5745bd3df519ed3064b2e8d308b90834272504b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Sun, 27 Jan 2019 01:48:49 +0100 Subject: libcamera: pipeline: uvcvideo: add error if no default video device is found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If for any reason a default video device is not found in the media graph the creation of the UVC pipeline silently failed. This is not optimal when debugging problems with the pipeline, add an error to notify the user of the issue. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/uvcvideo.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index c51e8bc1..2ebdb2b9 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -8,12 +8,15 @@ #include #include "device_enumerator.h" +#include "log.h" #include "media_device.h" #include "pipeline_handler.h" #include "v4l2_device.h" namespace libcamera { +LOG_DEFINE_CATEGORY(UVC) + class PipelineHandlerUVC : public PipelineHandler { public: @@ -60,6 +63,9 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator) } if (!video_ || video_->open()) { + if (!video_) + LOG(UVC, Error) << "Could not find a default video device"; + media_->release(); return false; } -- cgit v1.2.1