summaryrefslogtreecommitdiff
path: root/Documentation/index.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/index.rst')
0 files changed, 0 insertions, 0 deletions
r-later */ /* * Copyright (C) 2019, Google Inc. * * camera-sensor.cpp - Camera sensor tests */ #include <algorithm> #include <iostream> #include <linux/media-bus-format.h> #include "camera_sensor.h" #include "device_enumerator.h" #include "media_device.h" #include "utils.h" #include "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();