From fd554f9dba3171b624e584d50c7554f9c5f9cc52 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 24 Apr 2020 12:01:49 +0200 Subject: libcamera: ipa: Add support for CameraSensorInfo Add support for camera sensor information in the libcamera IPA protocol. Define a new 'struct ipa_sensor_info' structure in the IPA context and use it to perform translation between the C and the C++ API. Update the IPAInterface::configure() operation to accept a new CameraSensorInfo parameter and port all users of that function to the new interface. Signed-off-by: Jacopo Mondi --- test/ipa/ipa_wrappers_test.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'test/ipa') diff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp index 21bf51a2..4de13212 100644 --- a/test/ipa/ipa_wrappers_test.cpp +++ b/test/ipa/ipa_wrappers_test.cpp @@ -15,6 +15,7 @@ #include #include +#include "camera_sensor.h" #include "device_enumerator.h" #include "ipa_context_wrapper.h" #include "media_device.h" @@ -66,9 +67,17 @@ public: report(Op_stop, TestPass); } - void configure(const std::map &streamConfig, + void configure(const CameraSensorInfo &sensorInfo, + const std::map &streamConfig, const std::map &entityControls) override { + /* Verify sensorInfo. */ + if (sensorInfo.outputSize.width != 2560 || + sensorInfo.outputSize.height != 1940) { + cerr << "configure(): Invalid sensor info size " + << sensorInfo.outputSize.toString(); + } + /* Verify streamConfig. */ if (streamConfig.size() != 2) { cerr << "configure(): Invalid number of streams " @@ -293,13 +302,22 @@ protected: int ret; /* Test configure(). */ + CameraSensorInfo sensorInfo{ + .model = "sensor", + .bitsPerPixel = 8, + .activeAreaSize = { 2576, 1956 }, + .analogCrop = { 8, 8, 2560, 1940 }, + .outputSize = { 2560, 1940 }, + .pixelRate = 96000000, + .lineLength = 2918, + }; std::map config{ { 1, { V4L2_PIX_FMT_YUYV, { 1024, 768 } } }, { 2, { V4L2_PIX_FMT_NV12, { 800, 600 } } }, }; std::map controlInfo; controlInfo.emplace(42, subdev_->controls()); - ret = INVOKE(configure, config, controlInfo); + ret = INVOKE(configure, sensorInfo, config, controlInfo); if (ret == TestFail) return TestFail; -- cgit v1.2.1