Tune pacer

now compute the time from present to display that passes 99.5% of the
frames, add 1ms.
This commit is contained in:
Patrick Nicolas
2024-11-17 00:11:59 +01:00
parent 148ea1433b
commit c2fca9aa31
3 changed files with 27 additions and 57 deletions
+7 -9
View File
@@ -55,24 +55,22 @@ private:
int64_t last_wake_up_ns = 0;
// Client wait time for each decoder
struct stream_data
struct frame_time
{
// server present to client decoded
std::vector<int64_t> times;
size_t next_times_index = 0;
int64_t frame_id = -1;
XrTime present = 0;
XrTime decoded = 0;
};
std::vector<stream_data> streams;
std::vector<frame_time> frame_times;
std::array<frame_info, 4> in_flight_frames;
public:
wivrn_pacer(uint64_t frame_duration) :
frame_duration_ns(frame_duration)
frame_duration_ns(frame_duration),
frame_times(5000)
{}
void set_stream_count(size_t count);
void predict(
int64_t & out_frame_id,
int64_t & out_wake_up_time_ns,