libcamera: camera: Handle camera objects through shared pointers
The Camera class is explicitly reference-counted to manage the lifetime of camera objects. Replace this open-coded implementation with usage of the std::shared_ptr<> class. This API change prevents pipeline handlers from subclassing the Camera class. This isn't deemed to be an issue. Mark the class final to make this explicit. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -30,7 +30,7 @@ protected:
|
||||
{
|
||||
unsigned int count = 0;
|
||||
|
||||
for (Camera *camera : cm->cameras()) {
|
||||
for (const std::shared_ptr<Camera> &camera : cm->cameras()) {
|
||||
cout << "- " << camera->name() << endl;
|
||||
count++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user