summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2021-11-26 15:35:37 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-11-29 14:42:19 +0000
commit762f38811b696cdf7b43f580f18f9c98c209f5ff (patch)
treee5095006bffb9aad9a1474872119d8e5cb544d4b /src
parentcb1de3990787c2e4e3b4a214758157b2869482cc (diff)
pipeline: raspberrypi: Split out device enumeration and camera registration
Split out PipelineHandlerRPi::match() so that media device enumeration and acquisition is separated from camera registration. The former logic remains in PipelineHandlerRPi::match(), whereas the latter logic is moved into a new PipelineHandlerRPi::registerCamera() member function. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index ad526a8b..5a6dfa4e 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -314,6 +314,7 @@ private:
return static_cast<RPiCameraData *>(camera->_d());
}
+ bool registerCamera();
int queueAllBuffers(Camera *camera);
int prepareBuffers(Camera *camera);
void freeBuffers(Camera *camera);
@@ -1013,6 +1014,11 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
if (!isp_)
return false;
+ return registerCamera();
+}
+
+bool PipelineHandlerRPi::registerCamera()
+{
std::unique_ptr<RPiCameraData> data = std::make_unique<RPiCameraData>(this);
if (!data->dmaHeap_.isValid())
return false;
@@ -1173,7 +1179,7 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
const std::string &id = data->sensor_->id();
std::shared_ptr<Camera> camera =
Camera::create(std::move(data), id, streams);
- registerCamera(std::move(camera));
+ PipelineHandler::registerCamera(std::move(camera));
return true;
}