Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: webrtc/tools/event_log_visualizer/analyzer.cc

Issue 2557073002: Add method needed to extract frame capture and arrival timestamps from rtc event logs. (Closed)
Patch Set: Comments addressed. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/tools/event_log_visualizer/analyzer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/tools/event_log_visualizer/analyzer.cc
diff --git a/webrtc/tools/event_log_visualizer/analyzer.cc b/webrtc/tools/event_log_visualizer/analyzer.cc
index b57f89e73f157f4d2b1081371c9a08242aaea90d..89e516a950b59073fa92846780b3cf39c27d6460 100644
--- a/webrtc/tools/event_log_visualizer/analyzer.cc
+++ b/webrtc/tools/event_log_visualizer/analyzer.cc
@@ -1167,5 +1167,33 @@ void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) {
plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin);
plot->SetTitle("Network Delay Change.");
}
+
+std::vector<std::pair<int64_t, int64_t>> EventLogAnalyzer::GetFrameTimestamps()
+ const {
+ std::vector<std::pair<int64_t, int64_t>> timestamps;
+ size_t largest_stream_size = 0;
+ const std::vector<LoggedRtpPacket>* largest_video_stream = nullptr;
+ // Find the incoming video stream with the most number of packets that is
+ // not rtx.
+ for (const auto& kv : rtp_packets_) {
+ if (kv.first.GetDirection() == kIncomingPacket &&
+ video_ssrcs_.find(kv.first) != video_ssrcs_.end() &&
+ rtx_ssrcs_.find(kv.first) == rtx_ssrcs_.end() &&
+ kv.second.size() > largest_stream_size) {
+ largest_stream_size = kv.second.size();
+ largest_video_stream = &kv.second;
+ }
+ }
+ if (largest_video_stream == nullptr) {
+ for (auto& packet : *largest_video_stream) {
+ if (packet.header.markerBit) {
+ int64_t capture_ms = packet.header.timestamp / 90.0;
+ int64_t arrival_ms = packet.timestamp / 1000.0;
+ timestamps.push_back(std::make_pair(capture_ms, arrival_ms));
+ }
+ }
+ }
+ return timestamps;
+}
} // namespace plotting
} // namespace webrtc
« no previous file with comments | « webrtc/tools/event_log_visualizer/analyzer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698