summaryrefslogtreecommitdiff
path: root/test/camera-sensor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/camera-sensor.cpp')
-rw-r--r--test/camera-sensor.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp
index d3dcb510..9503d775 100644
--- a/test/camera-sensor.cpp
+++ b/test/camera-sensor.cpp
@@ -12,6 +12,7 @@
#include <libcamera/base/utils.h>
+#include "libcamera/internal/camera_lens.h"
#include "libcamera/internal/camera_sensor.h"
#include "libcamera/internal/device_enumerator.h"
#include "libcamera/internal/media_device.h"
@@ -57,6 +58,10 @@ protected:
return TestFail;
}
+ lens_ = sensor_->focusLens();
+ if (lens_)
+ cout << "Found lens controller" << endl;
+
return TestPass;
}
@@ -95,7 +100,7 @@ protected:
MEDIA_BUS_FMT_SBGGR10_1X10,
MEDIA_BUS_FMT_BGR888_1X24 },
Size(1024, 768));
- if (format.mbus_code != MEDIA_BUS_FMT_SBGGR10_1X10 ||
+ if (format.code != MEDIA_BUS_FMT_SBGGR10_1X10 ||
format.size != Size(4096, 2160)) {
cerr << "Failed to get a suitable format, expected 4096x2160-0x"
<< utils::hex(MEDIA_BUS_FMT_SBGGR10_1X10)
@@ -103,6 +108,11 @@ protected:
return TestFail;
}
+ if (lens_ && lens_->setFocusPosition(10)) {
+ cerr << "Failed to set lens focus position" << endl;
+ return TestFail;
+ }
+
return TestPass;
}
@@ -115,6 +125,7 @@ private:
std::unique_ptr<DeviceEnumerator> enumerator_;
std::shared_ptr<MediaDevice> media_;
CameraSensor *sensor_;
+ CameraLens *lens_;
};
TEST_REGISTER(CameraSensorTest)