summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ipa/raspberrypi/cam_helper_imx477.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp
index eaa7be16..419f8e77 100644
--- a/src/ipa/raspberrypi/cam_helper_imx477.cpp
+++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp
@@ -37,6 +37,7 @@ public:
CamHelperImx477();
uint32_t GainCode(double gain) const override;
double Gain(uint32_t gain_code) const override;
+ void GetDelays(int &exposure_delay, int &gain_delay) const override;
bool SensorEmbeddedDataPresent() const override;
private:
@@ -62,6 +63,12 @@ double CamHelperImx477::Gain(uint32_t gain_code) const
return 1024.0 / (1024 - gain_code);
}
+void CamHelperImx477::GetDelays(int &exposure_delay, int &gain_delay) const
+{
+ exposure_delay = 2;
+ gain_delay = 2;
+}
+
bool CamHelperImx477::SensorEmbeddedDataPresent() const
{
return true;
hl pps">"libcamera/internal/device_enumerator.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/utils.h" #include "libcamera/internal/v4l2_subdevice.h" #include "test.h" using namespace std; using namespace libcamera; class CameraSensorTest : public Test { protected: int init() { enumerator_ = DeviceEnumerator::create(); if (!enumerator_) { cerr << "Failed to create device enumerator" << endl; return TestFail; } if (enumerator_->enumerate()) { cerr << "Failed to enumerate media devices" << endl; return TestFail; } DeviceMatch dm("vimc"); media_ = enumerator_->search(dm); if (!media_) { cerr << "Unable to find \'vimc\' media device node" << endl; return TestSkip; } MediaEntity *entity = media_->getEntityByName("Sensor A"); if (!entity) { cerr << "Unable to find media entity 'Sensor A'" << endl; return TestFail; } sensor_ = new CameraSensor(entity); if (sensor_->init() < 0) { cerr << "Unable to initialise camera sensor" << endl; return TestFail; } return TestPass; } int run() { if (sensor_->model() != "Sensor A") { cerr << "Incorrect sensor model '" << sensor_->model() << "'" << endl; return TestFail; } const std::vector<unsigned int> &codes = sensor_->mbusCodes(); auto iter = std::find(codes.begin(), codes.end(), MEDIA_BUS_FMT_ARGB8888_1X32); if (iter == codes.end()) { cerr << "Sensor doesn't support ARGB8888_1X32" << endl; return TestFail; } const std::vector<Size> &sizes = sensor_->sizes(); auto iter2 = std::find(sizes.begin(), sizes.end(), Size(4096, 2160)); if (iter2 == sizes.end()) { cerr << "Sensor doesn't support 4096x2160" << endl; return TestFail; } const Size &resolution = sensor_->resolution(); if (resolution != Size(4096, 2160)) { cerr << "Incorrect sensor resolution " << resolution.toString() << endl; return TestFail; } /* Use an invalid format and make sure it's not selected. */ V4L2SubdeviceFormat format = sensor_->getFormat({ 0xdeadbeef, MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_BGR888_1X24 }, Size(1024, 768)); if (format.mbus_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) << ", got " << format.toString() << endl; return TestFail; } return TestPass; } void cleanup() { delete sensor_; } private: std::unique_ptr<DeviceEnumerator> enumerator_; std::shared_ptr<MediaDevice> media_; CameraSensor *sensor_; }; TEST_REGISTER(CameraSensorTest)