Add code to generate python visualization to neteq_rtpplay

This adds a command line flag to generate a python visualization script from neteq_rtpplay.

Bug: webrtc:8614
Change-Id: Ia6f10d7ff0abac6fdbe9302e7f97a8a12a5bb65b
Reviewed-on: https://webrtc-review.googlesource.com/29940
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21116}
This commit is contained in:
Ivo Creusen
2017-12-06 10:48:10 +01:00
committed by Commit Bot
parent 7dc26b7b32
commit d1d8dfb5c3
3 changed files with 97 additions and 1 deletions

View File

@ -125,6 +125,9 @@ DEFINE_int(transport_seq_no, 5, "Extension ID for transport sequence number");
DEFINE_bool(matlabplot,
false,
"Generates a matlab script for plotting the delay profile");
DEFINE_bool(pythonplot,
false,
"Generates a python script for plotting the delay profile");
DEFINE_bool(help, false, "Prints this message");
// Maps a codec type to a printable name string.
@ -614,7 +617,7 @@ int RunTest(int argc, char* argv[]) {
NetEqTest::Callbacks callbacks;
std::unique_ptr<NetEqDelayAnalyzer> delay_analyzer;
if (FLAG_matlabplot) {
if (FLAG_matlabplot || FLAG_pythonplot) {
delay_analyzer.reset(new NetEqDelayAnalyzer);
}
@ -637,6 +640,14 @@ int RunTest(int argc, char* argv[]) {
<< std::endl;
delay_analyzer->CreateMatlabScript(matlab_script_name + ".m");
}
if (FLAG_pythonplot) {
auto python_script_name = output_file_name;
std::replace(python_script_name.begin(), python_script_name.end(), '.',
'_');
std::cout << "Creating Python plot script " << python_script_name + ".py"
<< std::endl;
delay_analyzer->CreatePythonScript(python_script_name + ".py");
}
printf("Simulation statistics:\n");
printf(" output duration: %" PRId64 " ms\n", test_duration_ms);