[libcamera-devel] [PATCH v2 2/3] libcamera: pipeline: rkisp1: Use parameterized StreamConfiguration
Kaaira Gupta
kgupta at es.iitr.ac.in
Tue Mar 24 18:56:42 CET 2020
Replace default constructor StreamConfiguration() by its parameterized
counterpart by using StreamFormats in generateConfiguration() in
rkisp1.
Signed-off-by: Kaaira Gupta <kgupta at es.iitr.ac.in>
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/libcamera/pipeline/rkisp1/rkisp1.cpp | 39 ++++++++++++++++--------
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 04b0ed3..cfbfc9e 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -218,6 +218,21 @@ private:
Camera *activeCamera_;
};
+namespace {
+
+static const std::array<PixelFormat, 8> formats{
+ PixelFormat(DRM_FORMAT_YUYV),
+ PixelFormat(DRM_FORMAT_YVYU),
+ PixelFormat(DRM_FORMAT_VYUY),
+ PixelFormat(DRM_FORMAT_NV16),
+ PixelFormat(DRM_FORMAT_NV61),
+ PixelFormat(DRM_FORMAT_NV21),
+ PixelFormat(DRM_FORMAT_NV12),
+ /* \todo Add support for 8-bit greyscale to DRM formats */
+};
+
+} /* namespace */
+
RkISP1Frames::RkISP1Frames(PipelineHandler *pipe)
: pipe_(dynamic_cast<PipelineHandlerRkISP1 *>(pipe))
{
@@ -430,17 +445,6 @@ RkISP1CameraConfiguration::RkISP1CameraConfiguration(Camera *camera,
CameraConfiguration::Status RkISP1CameraConfiguration::validate()
{
- static const std::array<PixelFormat, 8> formats{
- PixelFormat(DRM_FORMAT_YUYV),
- PixelFormat(DRM_FORMAT_YVYU),
- PixelFormat(DRM_FORMAT_VYUY),
- PixelFormat(DRM_FORMAT_NV16),
- PixelFormat(DRM_FORMAT_NV61),
- PixelFormat(DRM_FORMAT_NV21),
- PixelFormat(DRM_FORMAT_NV12),
- /* \todo Add support for 8-bit greyscale to DRM formats */
- };
-
const CameraSensor *sensor = data_->sensor_;
Status status = Valid;
@@ -541,7 +545,18 @@ CameraConfiguration *PipelineHandlerRkISP1::generateConfiguration(Camera *camera
if (roles.empty())
return config;
- StreamConfiguration cfg{};
+ std::map<PixelFormat, std::vector<SizeRange>> pixelformats;
+ for (PixelFormat pixelformat : formats) {
+ std::vector<SizeRange> sizes{
+ /* Minimum and maximum capabilities of ISP output */
+ SizeRange{ { 32, 16 }, { 4416, 3312 } }
+ };
+ pixelformats[pixelformat] = sizes;
+ }
+
+ StreamFormats format(pixelformats);
+ StreamConfiguration cfg(format);
+
cfg.pixelFormat = PixelFormat(DRM_FORMAT_NV12);
cfg.size = data->sensor_->resolution();
--
2.17.1
More information about the libcamera-devel
mailing list