summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline_handler.cpp
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-06-30 21:04:59 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-07-10 16:11:16 +0900
commit5445c7d4b2a07d52a04bedfc1ba351a87bdc7633 (patch)
tree87e4edbcb25a5baaac90bcfb3ed4fc8ed76a5aa8 /src/libcamera/pipeline_handler.cpp
parent10d05404eb5b3941ef34dbdd901c61d302b421e0 (diff)
libcamera: pipeline_handler: Fatal if registering camera without media devices
Pipeline handlers must acquire media devices via PipelineHander::acquireMediaDevice so that the media devices can be registered with the pipeline handler, so that they can be automatically added to the devnum map for the v4l2 compatibility layer to use. Die fatally if any camera trying to be registered has not acquired any media devices via acquireMediaDevice. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline_handler.cpp')
-rw-r--r--src/libcamera/pipeline_handler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index de5ca095..ccd45edc 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -496,6 +496,10 @@ void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera,
cameraData_[camera.get()] = std::move(data);
cameras_.push_back(camera);
+ if (mediaDevices_.empty())
+ LOG(Pipeline, Fatal)
+ << "Registering camera with no media devices!";
+
/*
* Walk the entity list and map the devnums of all capture video nodes
* to the camera.