From 4c30ed47f656d67b619470b9091ebf6661b8a778 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Thu, 21 Jul 2022 01:40:04 +0900 Subject: pipeline: rkisp1: Query the driver for formats Query the driver for the output formats and sizes that it supports, instead of hardcoding them. This allows future-proofing for formats that are supported by some but not all versions of the driver. As the rkisp1 driver currently does not support VIDIOC_ENUM_FRAMESIZES, fallback to the hardcoded list of supported formats and framesizes. This feature will be added to the driver in parallel, though we cannot guarantee that users will have a new enough kernel for it. Signed-off-by: Paul Elder Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rkisp1/rkisp1_path.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libcamera/pipeline/rkisp1/rkisp1_path.h') diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h index f3f1ae39..d88effbb 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include #include @@ -57,14 +58,17 @@ public: Signal &bufferReady() { return video_->bufferReady; } private: + void populateFormats(); + static constexpr unsigned int RKISP1_BUFFER_COUNT = 4; const char *name_; bool running_; const Span formats_; - const Size minResolution_; - const Size maxResolution_; + std::set streamFormats_; + Size minResolution_; + Size maxResolution_; std::unique_ptr resizer_; std::unique_ptr video_; -- cgit v1.2.1