summaryrefslogtreecommitdiff
path: root/Documentation/guides/pipeline-handler.rst
diff options
context:
space:
mode:
authorBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2024-12-09 17:59:03 +0100
committerBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-05-02 17:25:30 +0200
commit12007759863a59b8434a20d822b6496d0383623d (patch)
treeb27d8cb9e89941555e088675a89861f3e0e23d5d /Documentation/guides/pipeline-handler.rst
parentb03992e66f19c640879c79225bfa19c81fdd0441 (diff)
Documentation: guides: pipeline-handler: Query pixel formats onceHEADmaster
There is no reason to create an entire new copy of the same thing, so use the already existing `formats` object. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'Documentation/guides/pipeline-handler.rst')
-rw-r--r--Documentation/guides/pipeline-handler.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst
index 554b3d27..fe752975 100644
--- a/Documentation/guides/pipeline-handler.rst
+++ b/Documentation/guides/pipeline-handler.rst
@@ -932,9 +932,9 @@ Add the following function implementation to your file:
StreamConfiguration &cfg = config_[0];
- const std::vector<libcamera::PixelFormat> formats = cfg.formats().pixelformats();
+ const std::vector<libcamera::PixelFormat> &formats = cfg.formats().pixelformats();
if (std::find(formats.begin(), formats.end(), cfg.pixelFormat) == formats.end()) {
- cfg.pixelFormat = cfg.formats().pixelformats()[0];
+ cfg.pixelFormat = formats[0];
LOG(VIVID, Debug) << "Adjusting format to " << cfg.pixelFormat.toString();
status = Adjusted;
}