summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline_handler.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-23 21:53:17 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-24 22:24:02 +0200
commite597598abf19e4e0372240f9819df559c62f97d2 (patch)
treed167f355cbd01bf8ec8384a64760a143f759273a /src/libcamera/pipeline_handler.cpp
parenteb1ecc92ce2fac649f7cbaecd58be29d23602713 (diff)
libcamera: pipeline_handler: Store the camera manager pointer
Instead of passing the camera manager pointer to the match() function, and later to more PipelineHandler functions, store it in the PipelineHandler::manager_ member variable at construction time and access it from there. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/pipeline_handler.cpp')
-rw-r--r--src/libcamera/pipeline_handler.cpp36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index c24feeaf..45788487 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -35,17 +35,29 @@ LOG_DEFINE_CATEGORY(Pipeline)
*/
/**
+ * \brief Construct a PipelineHandler instance
+ * \param[in] manager The camera manager
+ */
+PipelineHandler::PipelineHandler(CameraManager *manager)
+ : manager_(manager)
+{
+}
+
+PipelineHandler::~PipelineHandler()
+{
+}
+
+/**
* \fn PipelineHandler::match(DeviceEnumerator *enumerator)
* \brief Match media devices and create camera instances
- * \param manager The camera manager
* \param enumerator The enumerator providing all media devices found in the
* system
*
* This function is the main entry point of the pipeline handler. It is called
- * by the camera manager with the \a manager and \a enumerator passed as
- * arguments. It shall acquire from the \a enumerator all the media devices it
- * needs for a single pipeline, create one or multiple Camera instances and
- * register them with the \a manager.
+ * by the camera manager with the \a enumerator passed as an argument. It shall
+ * acquire from the \a enumerator all the media devices it needs for a single
+ * pipeline, create one or multiple Camera instances and register them with the
+ * camera manager.
*
* If all media devices needed by the pipeline handler are found, they must all
* be acquired by a call to MediaDevice::acquire(). This function shall then
@@ -67,6 +79,15 @@ LOG_DEFINE_CATEGORY(Pipeline)
*/
/**
+ * \var PipelineHandler::manager_
+ * \brief The Camera manager associated with the pipeline handler
+ *
+ * The camera manager pointer is stored in the pipeline handler for the
+ * convenience of pipeline handler implementations. It remains valid and
+ * constant for the whole lifetime of the pipeline handler.
+ */
+
+/**
* \class PipelineHandlerFactory
* \brief Registration of PipelineHandler classes and creation of instances
*
@@ -96,8 +117,11 @@ PipelineHandlerFactory::PipelineHandlerFactory(const char *name)
/**
* \fn PipelineHandlerFactory::create()
* \brief Create an instance of the PipelineHandler corresponding to the factory
+ * \param[in] manager The camera manager
*
- * This virtual function is implemented by the REGISTER_PIPELINE_HANDLER() macro.
+ * This virtual function is implemented by the REGISTER_PIPELINE_HANDLER()
+ * macro. It creates a pipeline handler instance associated with the camera
+ * \a manager.
*
* \return a pointer to a newly constructed instance of the PipelineHandler
* subclass corresponding to the factory