From a1ef71f6225c4ddd8c9f0af9772fb60c4ab22de9 Mon Sep 17 00:00:00 2001 From: michaelt Date: Mon, 10 Apr 2017 08:31:26 -0700 Subject: [PATCH] Add parser to visualise the ana dump BUG=webrtc:7160 Review-Url: https://codereview.webrtc.org/2696133003 Cr-Commit-Position: refs/heads/master@{#17622} --- .../audio_network_adaptor/parse_ana_dump.py | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100755 webrtc/modules/audio_coding/audio_network_adaptor/parse_ana_dump.py diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/parse_ana_dump.py b/webrtc/modules/audio_coding/audio_network_adaptor/parse_ana_dump.py new file mode 100755 index 0000000000..a52b065f12 --- /dev/null +++ b/webrtc/modules/audio_coding/audio_network_adaptor/parse_ana_dump.py @@ -0,0 +1,147 @@ +#!/usr/bin/python2 +# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +# To run this script please copy "out///pyproto/webrtc/modules/ +# audio_coding/audio_network_adaptor/debug_dump_pb2.py" to this folder. +# The you can run this script with: +# "python parse_ana_dump.py -m uplink_bandwidth_bps -f dump_file.dat" +# You can add as may metrics or decisions to the plot as you like. +# form more information call: +# "python parse_ana_dump.py --help" + +import struct +from optparse import OptionParser + +import matplotlib.pyplot as plt + +import debug_dump_pb2 + + +def GetNextMessageSize(file_to_parse): + data = file_to_parse.read(4) + if data == '': + return 0 + return struct.unpack('