libcamera: camera_manager: Register cameras with the camera manager
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class CameraManager;
|
||||
class DeviceEnumerator;
|
||||
|
||||
class PipelineHandler
|
||||
@@ -22,10 +23,7 @@ class PipelineHandler
|
||||
public:
|
||||
virtual ~PipelineHandler() { };
|
||||
|
||||
virtual bool match(DeviceEnumerator *enumerator) = 0;
|
||||
|
||||
virtual unsigned int count() = 0;
|
||||
virtual Camera *camera(unsigned int id) = 0;
|
||||
virtual bool match(CameraManager *manager, DeviceEnumerator *enumerator) = 0;
|
||||
};
|
||||
|
||||
class PipelineHandlerFactory
|
||||
|
||||
Reference in New Issue
Block a user