summaryrefslogtreecommitdiff
path: root/src/cam/main.h
AgeCommit message (Collapse)Author
2021-05-06cam: Add option to print the Request metadataJacopo Mondi
Add the "--metadata" option to the cam tool, which will be used to print the metadata associated with a completed capture request. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-03cam: Add --monitor optionUmang Jain
Add --monitor to monitor new hotplug and unplug camera events from the CameraManager. Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-27cam: Add option to disallow adjusting of requested formatsNiklas Söderlund
Add a '--strict-formats' option which fails the camera configuration step if the format is adjusted, Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-26cam: Add an option to list camera controlsLaurent Pinchart
Add a new --list-controls option to print information about all the controls supported by a camera. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-26cam: Rename OptProps to OptListPropertiesLaurent Pinchart
The name OptProps is not very clear, spell it out fully. The command line options are not changed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-06cam: Add option to list camera propertiesJacopo Mondi
Add the '-p'|'--list-properties' option to the cam application to list the properties of a camera. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-06-19cam: Add --info option to print information about stream(s)Niklas Söderlund
Add a new option to the cam tool that prints information about the configuration supplied by the user. If the option is specified, information about the configuration is printed after the configuration has been verified and possibly adjusted by the camera. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-05-25cam: capture: Break out capture to a new classNiklas Söderlund
Reduce the complexity of main.cpp by compartmentalising the capture logic into its own class. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
l opt">: public Test { protected: int init(); int run(); void cleanup(); private: CameraManager *cameraManager_; unsigned int sensors_; }; int IPU3PipelineTest::init() { unique_ptr<DeviceEnumerator> 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 imgu_dm("ipu3-imgu"); DeviceMatch cio2_dm("ipu3-cio2"); if (!enumerator->search(imgu_dm)) { cerr << "Failed to find IPU3 IMGU: test skip" << endl; return TestSkip; } std::shared_ptr<MediaDevice> cio2 = enumerator->search(cio2_dm); if (!cio2) { cerr << "Failed to find IPU3 CIO2: test skip" << endl; return TestSkip; } /* * Camera sensor are connected to the CIO2 unit. * Count how many sensors are connected in the system * and later verify this matches the number of registered * cameras. */ int ret = cio2->populate(); if (ret) { cerr << "Failed to populate media device " << cio2->deviceNode() << endl; return TestFail; } sensors_ = 0; const vector<MediaEntity *> &entities = cio2->entities(); for (MediaEntity *entity : entities) { if (entity->function() == MEDIA_ENT_F_CAM_SENSOR) sensors_++; } enumerator.reset(nullptr); cameraManager_ = new CameraManager(); ret = cameraManager_->start(); if (ret) { cerr << "Failed to start the CameraManager" << endl; return TestFail; } return 0; } int IPU3PipelineTest::run() { auto cameras = cameraManager_->cameras(); for (const std::shared_ptr<Camera> &cam : cameras) cout << "Found camera '" << cam->id() << "'" << endl; if (cameras.size() != sensors_) { cerr << cameras.size() << " cameras registered, but " << sensors_ << " were expected" << endl; return TestFail; } return TestPass; } void IPU3PipelineTest::cleanup() { cameraManager_->stop(); delete cameraManager_; } TEST_REGISTER(IPU3PipelineTest)