{ "rpi.black_level": { "black_level": 1024 }, "rpi.dpc": { }, "rpi.lux": { "reference_shutter_speed": 21663, "reference_gain": 1.0, "reference_aperture": 1.0, "reference_lux": 987, "reference_Y": 8961 }, "rpi.noise": { "reference_constant": 0, "reference_slope": 4.25 }, "rpi.geq": { "offset": 401, "slope": 0.05619 }, "rpi.sdn": { }, "rpi.awb": { "priors": [ { "lux": 0, "prior": [ 2000, 1.0, 3000, 0.0, 13000, 0.0 ] }, { "lux": 800, "prior": [ 2000, 0.0, 6000, 2.0, 13000, 2.0 ] }, { "lux": 1500, "prior": [ 2000, 0.0, 4000, 1.0, 6000, 6.0, 6500, 7.0, 7000, 1.0, 13000, 1.0 ] } ], "modes": { "auto": { "lo": 2500, "hi": 8000 }, "incandescent": { "lo": 2500, "hi": 3000 }, "tungsten": { "lo": 3000, "hi": 3500 }, "fluorescent": { "lo": 4000, "hi": 4700 }, "indoor": { "lo": 3000, "hi": 5000 }, "daylight": { "lo": 5500, "hi": 6500 }, "cloudy": { "lo": 7000, "hi": 8600 } }, "bayes": 1, "ct_curve": [ 2500.0, 1.0289, 0.4503, 2803.0, 0.9428, 0.5108, 2914.0, 0.9406, 0.5127, 3605.0, 0.8261, 0.6249, 4540.0, 0.7331, 0.7533, 5699.0, 0.6715, 0.8627, 8625.0, 0.6081, 1.0012 ], "sensitivity_r": 1.05, "sensitivity_b": 1.05, "transverse_pos": 0.0321, "transverse_neg": 0.04313 }, "rpi.agc": { "metering_modes": { "centre-weighted": { "weights": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ] }, "spot": { "weights": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, "matrix": { "weights": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] } }, "exposure_modes": { "normal": { "shutter": [ 100, 10000, 30000, 60000, 66666 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 6.0 ] }, "short": { "shutter": [ 100, 5000, 10000, 20000, 33333 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 6.0 ] }, "long": { "shutter": [ 100, 10000, 30000, 60000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 6.0 ] } }, "constraint_modes": { "normal": [ { "bound": "LOWER", "q_lo": 0.98, "q_hi": 1.0, "y_target": [ 0, 0.5, 1000, 0.5 ] } ], "highlight": [ { "bound": "LOWER", "q_lo": 0.98, "q_hi": 1.0, "y_target": [ 0, 0.5, 1000, 0.5 ] }, { "bound": "UPPER", "q_lo": 0.98, "q_hi": 1.0, "y_target": [ 0, 0.8, 1000, 0.8 ] } ], "shadows": [ { "bound": "LOWER", "q_lo": 0.0, "q_hi": 0.5, "y_target": [ 0, 0.17, 1000, 0.17 ] } ] }, "y_target": [ 0, 0.16, 1000, 0.165, 10000, 0.17 ], "base_ev": 1.25 }, "rpi.alsc": { "omega": 1.3, "n_iter": 100, "luminance_strength": 0.5, "calibrations_Cr": [ { "ct": 3000, "table": [ 1.105, 1.103, 1.093, 1.083, 1.071, 1.065, 1.065, 1.065, 1.066, 1.069, 1.072, 1.077, 1.084, 1.089, 1.093, 1.093, 1.103, 1.096, 1.084, 1.072, 1.059, 1.051, 1.047, 1.047, 1.051, 1.053, 1.059, 1.067, 1.075, 1.082, 1.085, 1.086, 1.096, 1.084, 1.072, 1.059, 1.051, 1.045, 1.039, 1.038, 1.039, 1.045, 1.049, 1.057, 1.063, 1.072, 1.081, 1.082, 1.092, 1.075, 1.061, 1.052, 1.045, 1.039, 1.036, 1.035, 1.035, 1.039, 1.044, 1.049, 1.056, 1.063, 1.072, 1.081, 1.092, 1.073, 1.058, 1.048, 1.043, 1.038, 1.035, 1.033, 1.033, 1.035, 1.039, 1.044, 1.051, 1.057, 1.069, 1.078, 1.091, 1.068, 1.054, 1.045, 1.041, 1.038, 1.035, 1.032, 1.032, 1.032, 1.036, 1.041, 1.045, 1.055, 1.069, 1.078, 1.091, 1.068, 1.052, 1.043, 1.041, 1.038, 1.035, 1.032, 1.031, 1.032, 1.034, 1.036, 1.043, 1.055, 1.069, 1.078, 1.092, 1.068, 1.052, 1.047, 1.042, 1.041, 1.038, 1.035, 1.032, 1.032, 1.035, 1.039, 1.043, 1.055, 1.071, 1.079, 1.092, 1.073, 1.057, 1.051, 1.047, 1.047, 1.044, 1.041, 1.038, 1.038, 1.039, 1.043, 1.051, 1.059, 1.076, 1.083, 1.092, 1.081, 1.068, 1.058, 1.056, 1.056, 1.053, 1.052, 1.049, 1.048, 1.048, 1.051, 1.059, 1.066, 1.083, 1.085, 1.091, 1.087, 1.081, 1.068, 1.065, 1.064, 1.062, 1.062, 1.061, 1.056, 1.056, 1.056, 1.064, 1.069, 1.084, 1.089, 1.091, 1.089, 1.085, 1.079, 1.069, 1.068, 1.067, 1.067, 1.067, 1.063, 1.061, 1.063, 1.068, 1.069, 1.081, 1.092 ] }, /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C) 2019, Google Inc. * * libcamera V4L2 API tests */ #include <iostream> #include <linux/media-bus-format.h> #include "libcamera/internal/device_enumerator.h" #include "libcamera/internal/media_device.h" #include "v4l2_videodevice_test.h" using namespace std; using namespace libcamera; int V4L2VideoDeviceTest::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(driver_); dm.add(entity_); media_ = enumerator_->search(dm); if (!media_) return TestSkip; MediaEntity *entity = media_->getEntityByName(entity_); if (!entity) return TestSkip; capture_ = new V4L2VideoDevice(entity); if (!capture_) return TestFail; if (!media_->acquire()) return TestFail; int ret = media_->disableLinks(); media_->release(); if (ret) return TestFail; if (capture_->open()) return TestFail; V4L2DeviceFormat format = {}; if (capture_->getFormat(&format)) return TestFail; if (driver_ == "vimc") { sensor_ = new CameraSensor(media_->getEntityByName("Sensor A")); if (sensor_->init()) return TestFail; debayer_ = new V4L2Subdevice(media_->getEntityByName("Debayer A")); if (debayer_->open()) return TestFail; format.fourcc = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8); V4L2SubdeviceFormat subformat = {}; subformat.mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8; subformat.size = format.size; if (sensor_->setFormat(&subformat)) return TestFail; if (debayer_->setFormat(0, &subformat)) return TestFail; } format.size.width = 640; format.size.height = 480; if (capture_->setFormat(&format)) return TestFail; return TestPass; } void V4L2VideoDeviceTest::cleanup() { capture_->streamOff(); capture_->releaseBuffers(); capture_->close(); delete debayer_; delete sensor_; delete capture_; }