OLD | NEW |
1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 """Displays statistics and plots graphs from RTC protobuf dump.""" | 9 """Displays statistics and plots graphs from RTC protobuf dump.""" |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 ])) | 87 ])) |
88 | 88 |
89 def choose_ssrc(self): | 89 def choose_ssrc(self): |
90 """Queries user for SSRC.""" | 90 """Queries user for SSRC.""" |
91 | 91 |
92 if len(self.ssrc_frequencies) == 1: | 92 if len(self.ssrc_frequencies) == 1: |
93 chosen_ssrc = self.ssrc_frequencies[0][-1] | 93 chosen_ssrc = self.ssrc_frequencies[0][-1] |
94 self.print_ssrc_info("", chosen_ssrc) | 94 self.print_ssrc_info("", chosen_ssrc) |
95 return chosen_ssrc | 95 return chosen_ssrc |
96 | 96 |
97 for (i, ssrc) in enumerate(self.ssrc_frequencies): | 97 ssrc_is_incoming = misc.ssrc_directions(self.data_points) |
| 98 incoming = [ssrc for ssrc in ssrc_is_incoming if ssrc_is_incoming[ssrc]] |
| 99 outgoing = [ssrc for ssrc in ssrc_is_incoming if not ssrc_is_incoming[ssrc]] |
| 100 |
| 101 print("\nIncoming:\n") |
| 102 for (i, ssrc) in enumerate(incoming): |
98 self.print_ssrc_info(i, ssrc) | 103 self.print_ssrc_info(i, ssrc) |
99 | 104 |
| 105 print("\nOutgoing:\n") |
| 106 for (i, ssrc) in enumerate(outgoing): |
| 107 self.print_ssrc_info(i + len(incoming), ssrc) |
| 108 |
100 while True: | 109 while True: |
101 chosen_index = int(misc.get_input("choose one> ")) | 110 chosen_index = int(misc.get_input("choose one> ")) |
102 if 0 <= chosen_index < len(self.ssrc_frequencies): | 111 if 0 <= chosen_index < len(self.ssrc_frequencies): |
103 return list(self.ssrc_frequencies)[chosen_index] | 112 return (incoming + outgoing)[chosen_index] |
104 else: | 113 else: |
105 print("Invalid index!") | 114 print("Invalid index!") |
106 | 115 |
107 def filter_ssrc(self, chosen_ssrc): | 116 def filter_ssrc(self, chosen_ssrc): |
108 """Filters and wraps data points. | 117 """Filters and wraps data points. |
109 | 118 |
110 Removes data points with `ssrc != chosen_ssrc`. Unwraps sequence | 119 Removes data points with `ssrc != chosen_ssrc`. Unwraps sequence |
111 numbers and timestamps for the chosen selection. | 120 numbers and timestamps for the chosen selection. |
112 """ | 121 """ |
113 self.data_points = [point for point in self.data_points if | 122 self.data_points = [point for point in self.data_points if |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 print("Statistics:") | 331 print("Statistics:") |
323 rtp_stats.print_sequence_number_statistics() | 332 rtp_stats.print_sequence_number_statistics() |
324 rtp_stats.estimate_frequency(options.query_sample_rate) | 333 rtp_stats.estimate_frequency(options.query_sample_rate) |
325 rtp_stats.print_duration_statistics() | 334 rtp_stats.print_duration_statistics() |
326 rtp_stats.remove_reordered() | 335 rtp_stats.remove_reordered() |
327 rtp_stats.compute_bandwidth() | 336 rtp_stats.compute_bandwidth() |
328 rtp_stats.plot_statistics() | 337 rtp_stats.plot_statistics() |
329 | 338 |
330 if __name__ == "__main__": | 339 if __name__ == "__main__": |
331 main() | 340 main() |
OLD | NEW |