mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Tooling to process RtcEventNetEqSetMinimumDelay
This introduce some tooling to display and plot the NetEq SetMinimum delay event. Bug: webrtc:14763 Change-Id: I69b73a51322734ec62e9b99abcdd0ac4e735879f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/287860 Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Lionel Koenig <lionelk@webrtc.org> Reviewed-by: Lionel Koenig <lionelk@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39112}
This commit is contained in:
parent
55ac75f177
commit
6afa92ab20
4 changed files with 45 additions and 1 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include "logging/rtc_event_log/events/rtc_event_generic_packet_sent.h"
|
#include "logging/rtc_event_log/events/rtc_event_generic_packet_sent.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h"
|
#include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h"
|
#include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h"
|
||||||
|
#include "logging/rtc_event_log/events/rtc_event_neteq_set_minimum_delay.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_probe_cluster_created.h"
|
#include "logging/rtc_event_log/events/rtc_event_probe_cluster_created.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_probe_result_failure.h"
|
#include "logging/rtc_event_log/events/rtc_event_probe_result_failure.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_probe_result_success.h"
|
#include "logging/rtc_event_log/events/rtc_event_probe_result_success.h"
|
||||||
|
@ -125,6 +126,14 @@ bool Convert(std::string inputfile,
|
||||||
event.ssrc);
|
event.ssrc);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto neteq_set_minimum_delay_handler =
|
||||||
|
[&](const LoggedNetEqSetMinimumDelayEvent& event) {
|
||||||
|
fprintf(output,
|
||||||
|
"NETEQ_SET_MINIMUM_DELAY %" PRId64
|
||||||
|
" remote_ssrc=%u minimum_delay=%d\n",
|
||||||
|
event.log_time_ms(), event.remote_ssrc, event.minimum_delay_ms);
|
||||||
|
};
|
||||||
|
|
||||||
auto audio_network_adaptation_handler =
|
auto audio_network_adaptation_handler =
|
||||||
[&](const LoggedAudioNetworkAdaptationEvent& event) {
|
[&](const LoggedAudioNetworkAdaptationEvent& event) {
|
||||||
fprintf(output, "AUDIO_NETWORK_ADAPTATION %" PRId64,
|
fprintf(output, "AUDIO_NETWORK_ADAPTATION %" PRId64,
|
||||||
|
@ -449,6 +458,11 @@ bool Convert(std::string inputfile,
|
||||||
for (const auto& kv : parsed_log.audio_playout_events()) {
|
for (const auto& kv : parsed_log.audio_playout_events()) {
|
||||||
processor.AddEvents(kv.second, audio_playout_handler);
|
processor.AddEvents(kv.second, audio_playout_handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const auto& kv : parsed_log.neteq_set_minimum_delay_events()) {
|
||||||
|
processor.AddEvents(kv.second, neteq_set_minimum_delay_handler);
|
||||||
|
}
|
||||||
|
|
||||||
processor.AddEvents(parsed_log.audio_network_adaptation_events(),
|
processor.AddEvents(parsed_log.audio_network_adaptation_events(),
|
||||||
audio_network_adaptation_handler);
|
audio_network_adaptation_handler);
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,6 @@ absl::optional<double> NetworkDelayDiff_CaptureTime(
|
||||||
return delay_change;
|
return delay_change;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
TimeSeries CreateRtcpTypeTimeSeries(const std::vector<T>& rtcp_list,
|
TimeSeries CreateRtcpTypeTimeSeries(const std::vector<T>& rtcp_list,
|
||||||
AnalyzerConfig config,
|
AnalyzerConfig config,
|
||||||
|
@ -617,6 +616,30 @@ void EventLogAnalyzer::CreatePlayoutGraph(Plot* plot) {
|
||||||
plot->SetTitle("Audio playout");
|
plot->SetTitle("Audio playout");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EventLogAnalyzer::CreateNetEqSetMinimumDelay(Plot* plot) {
|
||||||
|
for (const auto& playout_stream :
|
||||||
|
parsed_log_.neteq_set_minimum_delay_events()) {
|
||||||
|
uint32_t ssrc = playout_stream.first;
|
||||||
|
if (!MatchingSsrc(ssrc, desired_ssrc_))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
TimeSeries time_series(SsrcToString(ssrc), LineStyle::kStep,
|
||||||
|
PointStyle::kHighlight);
|
||||||
|
for (const auto& event : playout_stream.second) {
|
||||||
|
float x = config_.GetCallTimeSec(event.log_time());
|
||||||
|
float y = event.minimum_delay_ms;
|
||||||
|
time_series.points.push_back(TimeSeriesPoint(x, y));
|
||||||
|
}
|
||||||
|
plot->AppendTimeSeries(std::move(time_series));
|
||||||
|
}
|
||||||
|
|
||||||
|
plot->SetXAxis(config_.CallBeginTimeSec(), config_.CallEndTimeSec(),
|
||||||
|
"Time (s)", kLeftMargin, kRightMargin);
|
||||||
|
plot->SetSuggestedYAxis(0, 1000, "Minimum Delay (ms)", kBottomMargin,
|
||||||
|
kTopMargin);
|
||||||
|
plot->SetTitle("Set Minimum Delay");
|
||||||
|
}
|
||||||
|
|
||||||
// For audio SSRCs, plot the audio level.
|
// For audio SSRCs, plot the audio level.
|
||||||
void EventLogAnalyzer::CreateAudioLevelGraph(PacketDirection direction,
|
void EventLogAnalyzer::CreateAudioLevelGraph(PacketDirection direction,
|
||||||
Plot* plot) {
|
Plot* plot) {
|
||||||
|
|
|
@ -46,6 +46,8 @@ class EventLogAnalyzer {
|
||||||
|
|
||||||
void CreatePlayoutGraph(Plot* plot);
|
void CreatePlayoutGraph(Plot* plot);
|
||||||
|
|
||||||
|
void CreateNetEqSetMinimumDelay(Plot* plot);
|
||||||
|
|
||||||
void CreateAudioLevelGraph(PacketDirection direction, Plot* plot);
|
void CreateAudioLevelGraph(PacketDirection direction, Plot* plot);
|
||||||
|
|
||||||
void CreateSequenceNumberGraph(Plot* plot);
|
void CreateSequenceNumberGraph(Plot* plot);
|
||||||
|
|
|
@ -322,6 +322,11 @@ int main(int argc, char* argv[]) {
|
||||||
});
|
});
|
||||||
plots.RegisterPlot("audio_playout",
|
plots.RegisterPlot("audio_playout",
|
||||||
[&](Plot* plot) { analyzer.CreatePlayoutGraph(plot); });
|
[&](Plot* plot) { analyzer.CreatePlayoutGraph(plot); });
|
||||||
|
|
||||||
|
plots.RegisterPlot("neteq_set_minimum_delay", [&](Plot* plot) {
|
||||||
|
analyzer.CreateNetEqSetMinimumDelay(plot);
|
||||||
|
});
|
||||||
|
|
||||||
plots.RegisterPlot("incoming_audio_level", [&](Plot* plot) {
|
plots.RegisterPlot("incoming_audio_level", [&](Plot* plot) {
|
||||||
analyzer.CreateAudioLevelGraph(webrtc::kIncomingPacket, plot);
|
analyzer.CreateAudioLevelGraph(webrtc::kIncomingPacket, plot);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue