summaryrefslogtreecommitdiff
path: root/src/qcam/assets/feathericons/battery-charging.svg
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2022-01-04 12:57:08 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-01-06 12:28:24 +0000
commit8400cb07117f1ebc51db2a66d9f62211a764a096 (patch)
tree9831db37a689b35f3f36c050bfa4c16a35a71263 /src/qcam/assets/feathericons/battery-charging.svg
parentcd7863503ae91f477bbd883f35d9845172840349 (diff)
pipeline: raspberrypi: Move sensor entity detection out of registerCamera()
Enumerate the sensor device entities in PipelineHandlerRPi::match() and loop over PipelineHandlerRPi::registerCamera() for each sensor found. This will allow the pipeline handler to register multiple cameras attached to a single Unicam instance with a Video Mux device. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam/assets/feathericons/battery-charging.svg')
0 files changed, 0 insertions, 0 deletions
an class="hl com"> */ /** * \brief Construct a semaphore with \a n resources * \param[in] n The resource count */ Semaphore::Semaphore(unsigned int n) : available_(n) { } /** * \brief Retrieve the number of available resources * \return The number of available resources */ unsigned int Semaphore::available() { MutexLocker locker(mutex_); return available_; } /** * \brief Acquire \a n resources * \param[in] n The resource count * * This method attempts to acquire \a n resources. If \a n is higher than the * number of available resources, the call will block until enough resources * become available. */ void Semaphore::acquire(unsigned int n) { MutexLocker locker(mutex_); cv_.wait(locker, [&] { return available_ >= n; }); available_ -= n; } /** * \brief Try to acquire \a n resources without blocking * \param[in] n The resource count * * This method attempts to acquire \a n resources. If \a n is higher than the * number of available resources, it returns false immediately without * acquiring any resource. Otherwise it acquires the resources and returns * true. * * \return True if the resources have been acquired, false otherwise */ bool Semaphore::tryAcquire(unsigned int n) { MutexLocker locker(mutex_); if (available_ < n) return false; available_ -= n; return true; } /** * \brief Release \a n resources * \param[in] n The resource count * * This method releases \a n resources, increasing the available resource count * by \a n. If the number of available resources becomes large enough for any * consumer blocked on an acquire() call, those consumers get woken up. */ void Semaphore::release(unsigned int n) { { MutexLocker locker(mutex_); available_ += n; } cv_.notify_all(); } } /* namespace libcamera */