Extend packet header with frame processing latency

This commit is contained in:
ns6089 authored and Cameron Gutman committed 2023-05-02 23:41:13 -05:00
1 parent 590733b313
commit bd533dc31b
9 files changed
+101 -7

No files matched your search

+11
View File
@@ -11,6 +11,7 @@ extern "C" {
}
#include "display.h"
#include "misc.h"
#include "src/main.h"
#include "src/video.h"
@@ -894,6 +895,12 @@ namespace platf::dxgi {
return capture_e::timeout;
}
std::optional<std::chrono::steady_clock::time_point> frame_timestamp;
if (auto qpc_displayed = std::max(frame_info.LastPresentTime.QuadPart, frame_info.LastMouseUpdateTime.QuadPart)) {
// Translate QueryPerformanceCounter() value to steady_clock time point
frame_timestamp = std::chrono::steady_clock::now() - qpc_time_difference(qpc_counter(), qpc_displayed);
}
if (frame_info.PointerShapeBufferSize > 0) {
DXGI_OUTDUPL_POINTER_SHAPE_INFO shape_info {};
@@ -1239,6 +1246,10 @@ namespace platf::dxgi {
old_surface_delayed_destruction.reset();
}
if (img_out) {
img_out->frame_timestamp = frame_timestamp;
}
return capture_e::ok;
}