Add IDR info in timings csv

This commit is contained in:
Patrick Nicolas
2023-12-16 14:16:46 +01:00
committed by Guillaume Meunier
parent df786362e7
commit 7e22b3fa92
4 changed files with 25 additions and 13 deletions
+5 -3
View File
@@ -92,7 +92,9 @@ void VideoEncoder::Encode(wivrn_session & cnx,
{
this->cnx = &cnx;
auto target_timestamp = std::chrono::steady_clock::time_point(std::chrono::nanoseconds(view_info.display_time));
cnx.dump_time("encode_begin", frame_index, os_monotonic_get_ns(), stream_idx);
bool idr = sync_needed.exchange(false);
const char* extra = idr ? ",idr" : ",p";
cnx.dump_time("encode_begin", frame_index, os_monotonic_get_ns(), stream_idx, extra);
// Prepare the video shard template
shard.stream_item_idx = stream_idx;
@@ -100,8 +102,8 @@ void VideoEncoder::Encode(wivrn_session & cnx,
shard.shard_idx = 0;
shard.view_info = view_info;
Encode(index, sync_needed.exchange(false), target_timestamp);
cnx.dump_time("encode_end", frame_index, os_monotonic_get_ns(), stream_idx);
Encode(index, idr, target_timestamp);
cnx.dump_time("encode_end", frame_index, os_monotonic_get_ns(), stream_idx, extra);
}
void VideoEncoder::SendData(std::span<uint8_t> data, bool end_of_frame)
+2 -2
View File
@@ -277,11 +277,11 @@ std::array<to_headset::video_stream_description::foveation_parameter, 2> wivrn_s
return hmd->get_foveation_parameters();
}
void wivrn_session::dump_time(const std::string & event, uint64_t frame, uint64_t time, uint8_t stream)
void wivrn_session::dump_time(const std::string & event, uint64_t frame, uint64_t time, uint8_t stream, const char* extra)
{
if (feedback_csv)
{
std::lock_guard lock(csv_mutex);
feedback_csv << std::quoted(event) << "," << frame << "," << time << "," << (int)stream << std::endl;
feedback_csv << std::quoted(event) << "," << frame << "," << time << "," << (int)stream << extra << std::endl;
}
}
+1 -1
View File
@@ -99,7 +99,7 @@ public:
std::array<to_headset::video_stream_description::foveation_parameter, 2> get_foveation_parameters();
void dump_time(const std::string & event, uint64_t frame, uint64_t time, uint8_t stream = -1);
void dump_time(const std::string & event, uint64_t frame, uint64_t time, uint8_t stream = -1, const char* extra = "");
private:
static void run(std::weak_ptr<wivrn_session>);