From e2d00fbcbb1a9b2da50fa2e280817a0de1a7d286 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 6 Apr 2022 18:12:54 +0300 Subject: libcamera: base: utils: Add missing constructor for Duration The Duration class is missing the equivalent to the std::chrono::duration constructor that takes a number of ticks expressed as a scalar. Fix it, which allows initializing a Duration instance to 0 or 0.0. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Kieran Bingham --- src/libcamera/base/utils.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/libcamera/base/utils.cpp b/src/libcamera/base/utils.cpp index 8cf8a5b2..6a307940 100644 --- a/src/libcamera/base/utils.cpp +++ b/src/libcamera/base/utils.cpp @@ -406,6 +406,15 @@ std::string toAscii(const std::string &str) * duration in nanoseconds with double precision */ +/** + * \fn Duration::Duration(const Rep &r) + * \brief Construct a Duration with \a r ticks + * \param[in] r The number of ticks + * + * The constructed \a Duration object is internally represented in double + * precision with \a r nanoseconds ticks. + */ + /** * \fn Duration::Duration(const std::chrono::duration &d) * \brief Construct a Duration by converting an arbitrary std::chrono::duration -- cgit v1.2.1