libcamera: camera: Take span of StreamRole instead of vector
Change the parameter type of `generateConfiguration()` from `const std::vector&`
to `libcamera::Span`. A span is almost always preferable to a const vector ref
because it does not force dynamic allocation when none are needed, and it allows
any contiguous container to be used.
A new overload is added that accepts an initializer list so that
cam->generateConfiguration({ ... })
keeps working.
There is no API break since a span can be constructed from a vector
and the initializer list overload takes care of the initializer lists,
but this change causes an ABI break.
Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[Kieran: Apply checkstyle fixups]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
Kieran Bingham
parent
8da938b007
commit
86fa7300fa
@@ -316,7 +316,7 @@ public:
|
||||
SimplePipelineHandler(CameraManager *manager);
|
||||
|
||||
std::unique_ptr<CameraConfiguration> generateConfiguration(Camera *camera,
|
||||
const StreamRoles &roles) override;
|
||||
Span<const StreamRole> roles) override;
|
||||
int configure(Camera *camera, CameraConfiguration *config) override;
|
||||
|
||||
int exportFrameBuffers(Camera *camera, Stream *stream,
|
||||
@@ -1044,7 +1044,7 @@ SimplePipelineHandler::SimplePipelineHandler(CameraManager *manager)
|
||||
}
|
||||
|
||||
std::unique_ptr<CameraConfiguration>
|
||||
SimplePipelineHandler::generateConfiguration(Camera *camera, const StreamRoles &roles)
|
||||
SimplePipelineHandler::generateConfiguration(Camera *camera, Span<const StreamRole> roles)
|
||||
{
|
||||
SimpleCameraData *data = cameraData(camera);
|
||||
std::unique_ptr<CameraConfiguration> config =
|
||||
|
||||
Reference in New Issue
Block a user