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

Unified Diff: webrtc/tools/py_event_log_analyzer/rtp_analyzer.py

Issue 2291473003: Bugfixes for rtp_analyzer.py tool. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 months 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 | « no previous file | webrtc/tools/py_event_log_analyzer/rtp_analyzer.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/tools/py_event_log_analyzer/rtp_analyzer.py
diff --git a/webrtc/tools/py_event_log_analyzer/rtp_analyzer.py b/webrtc/tools/py_event_log_analyzer/rtp_analyzer.py
index 1f7b3f84d94c1d6642bb91457164f2d6b5f6fd41..1a9b695c3a7bf7dd282f9a17c244c3cddb01549a 100644
--- a/webrtc/tools/py_event_log_analyzer/rtp_analyzer.py
+++ b/webrtc/tools/py_event_log_analyzer/rtp_analyzer.py
@@ -13,6 +13,7 @@ from __future__ import print_function
import collections
import optparse
+import os
import sys
import matplotlib.pyplot as plt
@@ -275,9 +276,9 @@ def calculate_delay(start, stop, step, points):
for point in points:
grouped_delays[rounded_value_index(point.real_send_time_ms)
].append(point.absdelay)
- regularized_delays = [numpy.average(arr) if arr else None for arr in
+ regularized_delays = [numpy.average(arr) if arr else -1 for arr in
grouped_delays]
- return numpy.ma.masked_values(regularized_delays, None)
+ return numpy.ma.masked_values(regularized_delays, -1)
aleloi 2016/08/29 11:37:33 masked_values(array, x) marks all positions |i| in
kwiberg-webrtc 2016/08/29 11:49:44 Acknowledged.
def main():
@@ -290,13 +291,22 @@ def main():
default=False, action="store_true",
help="always query user for real sample rate")
+ parser.add_option("--working_directory",
+ default=None, action="store",
+ help="directory in which to search for relative paths")
+
(options, args) = parser.parse_args()
if len(args) < 1:
parser.print_help()
sys.exit(0)
- data_points = pb_parse.parse_protobuf(args[0])
+ input_file = args[0]
+
+ if options.working_directory and not os.path.isabs(input_file):
+ input_file = os.path.join(options.working_directory, input_file)
+
+ data_points = pb_parse.parse_protobuf(input_file)
aleloi 2016/08/29 11:37:33 Previously, you had to specify a log file with an
kwiberg-webrtc 2016/08/29 11:49:44 Acknowledged.
rtp_stats = RTPStatistics(data_points)
if options.dump_header_to_stdout:
« no previous file with comments | « no previous file | webrtc/tools/py_event_log_analyzer/rtp_analyzer.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698