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 eab4dcf798623e75c2a1e80d27c865915a9108fb..d1a68ed743e74259c6082a790495e4104f74cc38 100644 |
--- a/webrtc/tools/event_log_visualizer/analyzer.cc |
+++ b/webrtc/tools/event_log_visualizer/analyzer.cc |
@@ -98,6 +98,15 @@ void RegisterHeaderExtensions( |
extension_map->Register(webrtc::StringToRtpExtensionType(extension.uri), |
extension.id); |
} |
+ // Add default values for audio header extensions, since these are not stored |
+ // in the eventlog. |
+ // TODO(ivoc): Remove this once this is stored in the event log. |
hlundin-webrtc
2016/09/21 08:51:13
Do we have a tracking bug for this work? If not, p
ivoc
2016/09/21 11:50:04
I have a CL up to include this information in the
|
+ extension_map->Register( |
terelius
2016/09/21 09:44:32
Could you do this for audio streams only please.
ivoc
2016/09/21 11:50:04
I moved this to a seperate function, which returns
|
+ webrtc::StringToRtpExtensionType(webrtc::RtpExtension::kAudioLevelUri), |
+ webrtc::RtpExtension::kAudioLevelDefaultId); |
+ extension_map->Register( |
+ webrtc::StringToRtpExtensionType(webrtc::RtpExtension::kAbsSendTimeUri), |
+ webrtc::RtpExtension::kAbsSendTimeDefaultId); |
} |
constexpr float kLeftMargin = 0.01f; |
@@ -352,6 +361,12 @@ EventLogAnalyzer::EventLogAnalyzer(const ParsedRtcEventLog& log) |
if (extension_maps.count(stream) == 1) { |
RtpHeaderExtensionMap* extension_map = &extension_maps[stream]; |
rtp_parser.Parse(&parsed_header, extension_map); |
+ } else { |
+ // Make a default extension map. |
+ RtpHeaderExtensionMap extension_map; |
+ std::vector<webrtc::RtpExtension> extensions; |
+ RegisterHeaderExtensions(extensions, &extension_map); |
terelius
2016/09/21 09:44:32
Mark this with a TODO. We don't want to reregister
ivoc
2016/09/21 11:50:04
Good point, I moved the creation of the extension
|
+ rtp_parser.Parse(&parsed_header, &extension_map); |
} |
uint64_t timestamp = parsed_log_.GetTimestamp(i); |
rtp_packets_[stream].push_back( |
@@ -482,6 +497,11 @@ std::string EventLogAnalyzer::GetStreamName(StreamId stream_id) const { |
} |
if (IsRtxSsrc(stream_id)) |
name << "RTX "; |
+ if (stream_id.GetDirection() == kIncomingPacket) { |
+ name << "(In) "; |
+ } else { |
+ name << "(Out) "; |
+ } |
name << SsrcToString(stream_id.GetSsrc()); |
return name.str(); |
} |
@@ -600,6 +620,36 @@ void EventLogAnalyzer::CreatePlayoutGraph(Plot* plot) { |
plot->SetTitle("Audio playout"); |
} |
+// For audio SSRCs, plot the audio level. |
+void EventLogAnalyzer::CreateAudioLevelGraph(Plot* plot) { |
+ std::map<StreamId, TimeSeries> time_series; |
+ |
+ for (auto& kv : rtp_packets_) { |
+ StreamId stream_id = kv.first; |
+ const std::vector<LoggedRtpPacket>& packet_stream = kv.second; |
terelius
2016/09/21 10:00:14
In the future, you should only search the packets
ivoc
2016/09/21 11:50:04
Good point, added.
|
+ for (auto& packet : packet_stream) { |
+ if (packet.header.extension.hasAudioLevel) { |
+ float x = static_cast<float>(packet.timestamp - begin_time_) / 1000000; |
+ // The audio level is stored in -dBov (so e.g. -10 dBov is stored as 10) |
+ // Here we convert it to dBov. |
+ float y = static_cast<float>(-packet.header.extension.audioLevel); |
+ time_series[stream_id].points.emplace_back(TimeSeriesPoint(x, y)); |
+ } |
+ } |
+ } |
+ |
+ for (auto& series : time_series) { |
+ series.second.label = GetStreamName(series.first); |
+ series.second.style = LINE_GRAPH; |
+ plot->series_list_.push_back(std::move(series.second)); |
+ } |
+ |
+ plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
+ plot->SetYAxis(-127, 0, "Audio playout level (dBov)", kBottomMargin, |
+ kTopMargin); |
+ plot->SetTitle("Audio level"); |
+} |
+ |
// For each SSRC, plot the time between the consecutive playouts. |
void EventLogAnalyzer::CreateSequenceNumberGraph(Plot* plot) { |
for (auto& kv : rtp_packets_) { |