summaryrefslogtreecommitdiff
path: root/test/ipa
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-04-24 12:01:49 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-04-28 22:25:23 +0200
commitfd554f9dba3171b624e584d50c7554f9c5f9cc52 (patch)
tree2c2cdf6a92aeed7de55107333f51be1f2ce3ca78 /test/ipa
parentee4bb92aaeefaed04603d0b0c279d0d4f0be0197 (diff)
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 <jacopo@jmondi.org>
Diffstat (limited to 'test/ipa')
-rw-r--r--test/ipa/ipa_wrappers_test.cpp22
1 files changed, 20 insertions, 2 deletions
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 <libcamera/controls.h>
#include <libipa/ipa_interface_wrapper.h>
+#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<unsigned int, IPAStream> &streamConfig,
+ void configure(const CameraSensorInfo &sensorInfo,
+ const std::map<unsigned int, IPAStream> &streamConfig,
const std::map<unsigned int, const ControlInfoMap &> &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<unsigned int, IPAStream> config{
{ 1, { V4L2_PIX_FMT_YUYV, { 1024, 768 } } },
{ 2, { V4L2_PIX_FMT_NV12, { 800, 600 } } },
};
std::map<unsigned int, const ControlInfoMap &> controlInfo;
controlInfo.emplace(42, subdev_->controls());
- ret = INVOKE(configure, config, controlInfo);
+ ret = INVOKE(configure, sensorInfo, config, controlInfo);
if (ret == TestFail)
return TestFail;