From f3695e9b09ce4a88d6e0480d9e5058673af34a49 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 3 Jan 2019 13:10:37 +0200 Subject: libcamera: camera_manager: Register cameras with the camera manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cameras are listed through a double indirection, first iterating over all available pipeline handlers, and then listing the cameras they each support. To simplify the API make the pipeline handlers register the cameras with the camera manager directly, which lets the camera manager easily expose the list of all available cameras. The PipelineHandler API gets simplified as the handlers don't need to expose the list of cameras they have created. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline_handler.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src/libcamera/pipeline_handler.cpp') diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index c19ab94f..f2e08a6a 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -35,13 +35,15 @@ namespace libcamera { /** * \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 enumerator passed as an argument. It - * shall acquire from the \a enumerator all the media devices it needs for a - * single pipeline and create one or multiple Camera instances. + * 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. * * 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 @@ -62,19 +64,6 @@ namespace libcamera { * created, or false otherwise */ -/** - * \fn PipelineHandler::count() - * \brief Retrieve the number of cameras handled by this pipeline handler - * \return the number of cameras that were created by the match() function - */ - -/** - * \fn PipelineHandler::camera(unsigned int id) - * \brief Retrieve one of the cameras handled by this pipeline handler - * \param[in] id the camera index - * \return a pointer to the Camera identified by \a id - */ - /** * \class PipelineHandlerFactory * \brief Registration of PipelineHandler classes and creation of instances -- cgit v1.2.1