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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2022-04-06 18:12:54 +03:00
parent 1a9587b8f2
commit e2d00fbcbb
2 changed files with 15 additions and 0 deletions

View file

@ -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<Rep, Period> &d)
* \brief Construct a Duration by converting an arbitrary std::chrono::duration