libcamera: Switch to the std::chrono API

Replace the clock_gettime()-based API with durations expressed as
integers with the std::chrono API.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2019-09-14 03:40:47 +03:00
parent 98dff063f2
commit cecfeed61e
9 changed files with 67 additions and 75 deletions

View File

@@ -7,8 +7,11 @@
#ifndef __LIBCAMERA_LOG_H__
#define __LIBCAMERA_LOG_H__
#include <chrono>
#include <sstream>
#include "utils.h"
namespace libcamera {
enum LogSeverity {
@@ -60,7 +63,7 @@ public:
std::ostream &stream() { return msgStream_; }
const struct timespec &timestamp() const { return timestamp_; }
const utils::time_point &timestamp() const { return timestamp_; }
LogSeverity severity() const { return severity_; }
const LogCategory &category() const { return category_; }
const std::string &fileInfo() const { return fileInfo_; }
@@ -72,7 +75,7 @@ private:
std::ostringstream msgStream_;
const LogCategory &category_;
LogSeverity severity_;
struct timespec timestamp_;
utils::time_point timestamp_;
std::string fileInfo_;
};