summaryrefslogtreecommitdiff
path: root/src/qcam/assets
diff options
context:
space:
mode:
authorDaniel Semkowicz <dse@thaumatec.com>2022-06-27 14:28:05 +0200
committerJacopo Mondi <jacopo@jmondi.org>2022-09-02 12:39:44 +0200
commitf71c76ceff7ad13490fd77800059ab2bd2a61498 (patch)
treeb3b7024e39f22e524afdb6abcdd495fe312c6d43 /src/qcam/assets
parent251f0534b74bcb46c777aa0df34b1b4142b664f5 (diff)
cam: Add Rectangle type parsing in capture script
This change is required for AfWindows control from capture script. Parser expects array of arrays of parameters, so it is possible to specify multiple rectangles. Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/qcam/assets')
0 files changed, 0 insertions, 0 deletions
lass CaptureAsyncTest : public V4L2DeviceTest { public: CaptureAsyncTest() : V4L2DeviceTest("vimc", "Raw Capture 0"), frames(0) {} void receiveBuffer(Buffer *buffer) { std::cout << "Received buffer " << buffer->index() << std::endl; frames++; /* Requeue the buffer for further use. */ capture_->queueBuffer(buffer); } protected: int run() { const unsigned int bufferCount = 8; EventDispatcher *dispatcher = CameraManager::instance()->eventDispatcher(); Timer timeout; int ret; pool_.createBuffers(bufferCount); ret = capture_->exportBuffers(&pool_); if (ret) return TestFail; capture_->bufferReady.connect(this, &CaptureAsyncTest::receiveBuffer); /* Queue all the buffers to the device. */ for (Buffer &b : pool_.buffers()) { if (capture_->queueBuffer(&b)) return TestFail; } ret = capture_->streamOn(); if (ret) return TestFail; timeout.start(10000); while (timeout.isRunning()) { dispatcher->processEvents(); if (frames > 30) break; } if (frames < 1) { std::cout << "Failed to capture any frames within timeout." << std::endl; return TestFail; } if (frames < 30) { std::cout << "Failed to capture 30 frames within timeout." << std::endl; return TestFail; } std::cout << "Processed " << frames << " frames" << std::endl; ret = capture_->streamOff(); if (ret) return TestFail; return TestPass; } private: unsigned int frames; }; TEST_REGISTER(CaptureAsyncTest);