summaryrefslogtreecommitdiff
path: root/src/qcam/qt_event_dispatcher.cpp
AgeCommit message (Collapse)Author
2019-10-17qcam: Support Qt versions earlier than 5.9Laurent Pinchart
The QtEventDispatcher timers implementation depends on Qt 5.9 or newer due to the use of QObject::startTimer(std::chrono::milliseconds). Support earlier Qt versions by using the QObject::startTimer(int) version instead. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-07libcamera: timer: Remove the interval() methodLaurent Pinchart
The libcamera timers are single-shot timers. They are started with a duration, but fire once only, not based on an interval. Remove the interval concept by removing the interval() method, and rename other occurences of interval to duration. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-01qcam: Fix timers not emitting timeout signalNiklas Söderlund
The timer signal was never emitted in QtEventDispatcher::timerEvent(), this results in timers not working as designed running under the Qt event loop. Fix this by emitting the signal on timeout. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-01qcam: Stop timer on timeoutNiklas Söderlund
Stopping the timer will reset the Timer::deadline_ field to 0 fixing potential bugs and call QtEventDispatcher::unregisterTimer() which will take care of the cleanup. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-09-27qcam: Fix unregister of not registered timerNiklas Söderlund
If an unregistered timer is given to QtEventDispatcher::unregisterTimer() an error is printed and Qt gets confused and locks up. Fix this by following the libcamera documentation that passing a unregistered timer is a no-op. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-03-29qcam: Add Qt-based GUI applicationLaurent Pinchart
qcam is a sample camera GUI application based on Qt. It demonstrates integration of the Qt event loop with libcamera. The application lets the user select a camera through the GUI, and then captures a single stream from the camera and displays it in a window. Only streams in YUYV formats are supported for now. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>