diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-03-22 22:32:55 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-03-25 13:11:12 +0200 |
commit | 54398c1583f18ef9daf1a9227691b14c3b7f4212 (patch) | |
tree | a172cf3f6ebc881f5b0ac9e7235e140c4ddebe1f /test/hotplug-cameras.cpp | |
parent | 074fa98ac4ea903049ba9d7386cdb2f050ea3b48 (diff) |
libcamera: base: timer: Drop start() overload with int argument
The start(unsigned int msec) overload is error-prone, as the argument
unit can easily be mistaken in callers. Drop it and update all callers
to use the start(std::chrono::milliseconds) overload instead.
The callers now need to use std::chrono_literals. The using statement
could be added to timer.h for convenience, but "using" is discouraged in
header files to avoid namespace pollution. Update the callers instead,
and while at it, sort the "using" statements alphabetically in tests.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'test/hotplug-cameras.cpp')
-rw-r--r-- | test/hotplug-cameras.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp index df560403..5d9260a2 100644 --- a/test/hotplug-cameras.cpp +++ b/test/hotplug-cameras.cpp @@ -22,6 +22,7 @@ #include "test.h" using namespace libcamera; +using namespace std::chrono_literals; class HotplugTest : public Test { @@ -88,7 +89,7 @@ protected: std::ofstream(uvcDriverDir_ + "unbind", std::ios::binary) << uvcDeviceDir; Timer timer; - timer.start(1000); + timer.start(1000ms); while (timer.isRunning() && !cameraRemoved_) Thread::current()->eventDispatcher()->processEvents(); if (!cameraRemoved_) { @@ -99,7 +100,7 @@ protected: /* Bind the camera again and process events. */ std::ofstream(uvcDriverDir_ + "bind", std::ios::binary) << uvcDeviceDir; - timer.start(1000); + timer.start(1000ms); while (timer.isRunning() && !cameraAdded_) Thread::current()->eventDispatcher()->processEvents(); if (!cameraAdded_) { |