diff options
author | Umang Jain <email@uajain.com> | 2020-06-16 19:45:34 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-06-17 00:27:47 +0300 |
commit | c6f8ec7d8afdf6352fdbf6363052d7fa8370d1da (patch) | |
tree | d7da295c49d99662a0a13ce8b5468c5942d0ca33 | |
parent | e34d3a4f278ec8491ce3b710e989fb2083af92f3 (diff) |
libcamera: camera_manager: Refactor pipelines creation into separate function
This commit introduces no functional changes.
Split pipelines creation code into a separate function,
so that the function can be re-used for upcoming hotplug
functionality in subsequent commits.
Also, fixup correct tag for \todo.
Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | src/libcamera/camera_manager.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index dbdc78e7..de6d5d82 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -55,6 +55,7 @@ protected: private: int init(); + void createPipelineHandlers(); void cleanup(); CameraManager *cm_; @@ -123,12 +124,20 @@ int CameraManager::Private::init() if (!enumerator_ || enumerator_->enumerate()) return -ENODEV; + createPipelineHandlers(); + + return 0; +} + +void CameraManager::Private::createPipelineHandlers() +{ /* - * TODO: Try to read handlers and order from configuration + * \todo Try to read handlers and order from configuration * file and only fallback on all handlers if there is no * configuration file. */ - std::vector<PipelineHandlerFactory *> &factories = PipelineHandlerFactory::factories(); + std::vector<PipelineHandlerFactory *> &factories = + PipelineHandlerFactory::factories(); for (PipelineHandlerFactory *factory : factories) { /* @@ -146,14 +155,12 @@ int CameraManager::Private::init() } } - /* TODO: register hot-plug callback here */ - - return 0; + /* \todo Register hot-plug callback here */ } void CameraManager::Private::cleanup() { - /* TODO: unregister hot-plug callback here */ + /* \todo Unregister hot-plug callback here */ /* * Release all references to cameras to ensure they all get destroyed |