diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2023-05-09 23:07:57 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2023-07-04 22:48:30 +0100 |
commit | 86fa7300fa915060e25257b41d8ebb514dd55435 (patch) | |
tree | 99db5664e01c34fd03d6d0498c7c994f5040b510 /src/libcamera/pipeline/rpi/common/pipeline_base.cpp | |
parent | 8da938b00705c7bdc188174f45ee485d0880ee1e (diff) |
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>
Diffstat (limited to 'src/libcamera/pipeline/rpi/common/pipeline_base.cpp')
-rw-r--r-- | src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index df748292..d438bdb6 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -381,7 +381,7 @@ V4L2DeviceFormat PipelineHandlerBase::toV4L2DeviceFormat(const V4L2VideoDevice * } std::unique_ptr<CameraConfiguration> -PipelineHandlerBase::generateConfiguration(Camera *camera, const StreamRoles &roles) +PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole> roles) { CameraData *data = cameraData(camera); std::unique_ptr<CameraConfiguration> config = |