[fix] use proper std::chrono clock

This commit is contained in:
dijunkun
2024-08-09 10:23:21 +08:00
parent a308094fbd
commit 911f209fda
10 changed files with 47 additions and 39 deletions

View File

@@ -18,11 +18,11 @@
#include "nvcuvid.h"
#define START_TIMER auto start = std::chrono::high_resolution_clock::now();
#define START_TIMER auto start = std::chrono::steady_clock::now();
#define STOP_TIMER(print_message) \
std::cout << print_message \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \
std::chrono::high_resolution_clock::now() - start) \
std::chrono::steady_clock::now() - start) \
.count() \
<< " ms " << std::endl;

View File

@@ -177,7 +177,7 @@ int OpenH264Encoder::Encode(
raw_frame_.iPicHeight = frame_height_;
raw_frame_.iColorFormat = EVideoFormatType::videoFormatI420;
raw_frame_.uiTimeStamp =
std::chrono::high_resolution_clock::now().time_since_epoch().count();
std::chrono::system_clock::now().time_since_epoch().count();
raw_frame_.iStride[0] = frame_width_;
raw_frame_.iStride[1] = frame_width_ >> 1;