summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-01-27 01:48:49 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-01-30 12:58:38 +0100
commit5745bd3df519ed3064b2e8d308b90834272504b8 (patch)
treeea077cb3b6857b42aeb570f6551b76dfe31d5964
parent3f82f502275c3a1760c11a277b9303355de1fd21 (diff)
libcamera: pipeline: uvcvideo: add error if no default video device is found
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 <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline/uvcvideo.cpp6
1 files changed, 6 insertions, 0 deletions
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 <libcamera/camera.h>
#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;
}