Use a separate packet for refresh rate change

This commit is contained in:
Patrick Nicolas
2025-01-07 23:42:11 +01:00
parent d6649b0052
commit a434094055
10 changed files with 70 additions and 56 deletions
+7 -3
View File
@@ -734,9 +734,7 @@ static xrt_result_t comp_wivrn_request_refresh_rate(struct comp_target * ct, flo
if (refresh_rate_hz == 0.0f)
refresh_rate_hz = cn->cnx.get_info().preferred_refresh_rate;
cn->desc.fps = refresh_rate_hz;
cn->pacer.set_frame_duration(U_TIME_1S_IN_NS / refresh_rate_hz);
cn->cnx.send_control(to_headset::video_stream_description{cn->desc});
cn->cnx.send_control(to_headset::refresh_rate_change{.fps = refresh_rate_hz});
return XRT_SUCCESS;
}
@@ -799,6 +797,12 @@ void wivrn_comp_target::render_dynamic_foveation(std::array<to_headset::foveatio
}
}
void wivrn_comp_target::set_refresh_rate(float refresh_rate_hz)
{
desc.fps = refresh_rate_hz;
pacer.set_frame_duration(U_TIME_1S_IN_NS / refresh_rate_hz);
}
wivrn_comp_target::wivrn_comp_target(wivrn::wivrn_session & cnx, struct comp_compositor * c) :
comp_target{
.c = c,