summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/agc.hpp
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-07-27 22:46:05 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-05 20:07:13 +0200
commit53d38b19ed5b2650ad419db9cd91cf9d3392c877 (patch)
treea6db884cc85a6eafa1b6f068ff4095d384bd25db /src/ipa/raspberrypi/controller/rpi/agc.hpp
parent75a9aebee593e5fe824a09bd9682c1571aa0e4ab (diff)
libcamera: pipeline: uvcvideo: Generate unique camera names
Generate camera names that are unique and persistent between system resets. The name is constructed from the USB device information as well as the USB controller on the host. Before this change example of camera names: Venus USB2.0 Camera: Venus USB2 Logitech Webcam C930e After this change the same cameras are: \_SB_.PCI0.RP05.PXSX-2.1.1:1.0-0ac8:3420 \_SB_.PCI0.RP05.PXSX-2.4:1.0-046d:0843 On OF-based system: /base/soc/usb@7e980000/usb-port@1-1.2:1.0-0ac8:3420 Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/agc.hpp')
0 files changed, 0 insertions, 0 deletions
ibcamera/base/event_notifier.h> #include <libcamera/base/thread.h> #include <libcamera/base/timer.h> #include "test.h" using namespace libcamera; using namespace std; using namespace std::chrono_literals; class EventTest : public Test { protected: void readReady() { size_ = read(notifier_->fd(), data_, sizeof(data_)); notified_ = true; } int init() { notifier_ = nullptr; return pipe(pipefd_); } int run() { EventDispatcher *dispatcher = Thread::current()->eventDispatcher(); std::string data("H2G2"); Timer timeout; ssize_t ret; notifier_ = new EventNotifier(pipefd_[0], EventNotifier::Read); notifier_->activated.connect(this, &EventTest::readReady); /* Test read notification with data. */ memset(data_, 0, sizeof(data_)); size_ = 0; ret = write(pipefd_[1], data.data(), data.size()); if (ret < 0) { cout << "Pipe write failed" << endl; return TestFail; } timeout.start(100ms); dispatcher->processEvents(); timeout.stop(); if (static_cast<size_t>(size_) != data.size()) { cout << "Event notifier read ready test failed" << endl; return TestFail; } /* Test read notification without data. */ notified_ = false; timeout.start(100ms); dispatcher->processEvents(); timeout.stop(); if (notified_) { cout << "Event notifier read no ready test failed" << endl; return TestFail; } /* Test read notifier disabling. */ notified_ = false; notifier_->setEnabled(false); ret = write(pipefd_[1], data.data(), data.size()); if (ret < 0) { cout << "Pipe write failed" << endl; return TestFail; } timeout.start(100ms); dispatcher->processEvents(); timeout.stop(); if (notified_) { cout << "Event notifier read disabling failed" << endl; return TestFail; } /* Test read notifier enabling. */ notified_ = false; notifier_->setEnabled(true); timeout.start(100ms); dispatcher->processEvents(); timeout.stop(); if (!notified_) { cout << "Event notifier read enabling test failed" << endl; return TestFail; } return TestPass; } void cleanup() { delete notifier_; close(pipefd_[0]); close(pipefd_[1]); } private: int pipefd_[2]; EventNotifier *notifier_; bool notified_; char data_[16]; ssize_t size_; }; TEST_REGISTER(EventTest)