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

Side by Side Diff: webrtc/tools/event_log_visualizer/analyzer.cc

Issue 2192173002: Register header extensions for rtx streams in the event log analyzer. (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/tools/event_log_visualizer/analyzer.h" 11 #include "webrtc/tools/event_log_visualizer/analyzer.h"
12 12
13 #include <algorithm> 13 #include <algorithm>
14 #include <limits> 14 #include <limits>
15 #include <map> 15 #include <map>
16 #include <sstream> 16 #include <sstream>
17 #include <string> 17 #include <string>
18 #include <utility> 18 #include <utility>
19 19
20 #include "webrtc/audio_receive_stream.h" 20 #include "webrtc/audio_receive_stream.h"
21 #include "webrtc/audio_send_stream.h" 21 #include "webrtc/audio_send_stream.h"
22 #include "webrtc/base/checks.h" 22 #include "webrtc/base/checks.h"
23 #include "webrtc/base/logging.h"
23 #include "webrtc/call.h" 24 #include "webrtc/call.h"
24 #include "webrtc/common_types.h" 25 #include "webrtc/common_types.h"
25 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" 26 #include "webrtc/modules/congestion_controller/include/congestion_controller.h"
26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" 27 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
27 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 28 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
28 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" 29 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
29 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
31 #include "webrtc/video_receive_stream.h" 32 #include "webrtc/video_receive_stream.h"
32 #include "webrtc/video_send_stream.h" 33 #include "webrtc/video_send_stream.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 int64_t min_difference = max_difference - modulus + 1; 73 int64_t min_difference = max_difference - modulus + 1;
73 if (difference > max_difference) { 74 if (difference > max_difference) {
74 difference -= modulus; 75 difference -= modulus;
75 } 76 }
76 if (difference < min_difference) { 77 if (difference < min_difference) {
77 difference += modulus; 78 difference += modulus;
78 } 79 }
79 return difference; 80 return difference;
80 } 81 }
81 82
83 void RegisterHeaderExtensions(
84 const std::vector<webrtc::RtpExtension>& extensions,
85 webrtc::RtpHeaderExtensionMap* extension_map) {
86 extension_map->Erase();
87 for (const webrtc::RtpExtension& extension : extensions) {
88 extension_map->Register(webrtc::StringToRtpExtensionType(extension.uri),
89 extension.id);
90 }
91 }
92
82 const double kXMargin = 1.02; 93 const double kXMargin = 1.02;
83 const double kYMargin = 1.1; 94 const double kYMargin = 1.1;
84 const double kDefaultXMin = -1; 95 const double kDefaultXMin = -1;
85 const double kDefaultYMin = -1; 96 const double kDefaultYMin = -1;
86 97
87 } // namespace 98 } // namespace
88 99
89 namespace webrtc { 100 namespace webrtc {
90 namespace plotting { 101 namespace plotting {
91 102
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 uint64_t timestamp = parsed_log_.GetTimestamp(i); 141 uint64_t timestamp = parsed_log_.GetTimestamp(i);
131 first_timestamp = std::min(first_timestamp, timestamp); 142 first_timestamp = std::min(first_timestamp, timestamp);
132 last_timestamp = std::max(last_timestamp, timestamp); 143 last_timestamp = std::max(last_timestamp, timestamp);
133 } 144 }
134 145
135 switch (parsed_log_.GetEventType(i)) { 146 switch (parsed_log_.GetEventType(i)) {
136 case ParsedRtcEventLog::VIDEO_RECEIVER_CONFIG_EVENT: { 147 case ParsedRtcEventLog::VIDEO_RECEIVER_CONFIG_EVENT: {
137 VideoReceiveStream::Config config(nullptr); 148 VideoReceiveStream::Config config(nullptr);
138 parsed_log_.GetVideoReceiveConfig(i, &config); 149 parsed_log_.GetVideoReceiveConfig(i, &config);
139 StreamId stream(config.rtp.remote_ssrc, kIncomingPacket); 150 StreamId stream(config.rtp.remote_ssrc, kIncomingPacket);
140 extension_maps[stream].Erase(); 151 RegisterHeaderExtensions(config.rtp.extensions,
141 for (size_t j = 0; j < config.rtp.extensions.size(); ++j) { 152 &extension_maps[stream]);
142 const std::string& extension = config.rtp.extensions[j].uri; 153 for (auto kv : config.rtp.rtx) {
143 int id = config.rtp.extensions[j].id; 154 StreamId rtx_stream(kv.second.ssrc, kIncomingPacket);
144 extension_maps[stream].Register(StringToRtpExtensionType(extension), 155 RegisterHeaderExtensions(config.rtp.extensions,
145 id); 156 &extension_maps[rtx_stream]);
146 } 157 }
147 break; 158 break;
148 } 159 }
149 case ParsedRtcEventLog::VIDEO_SENDER_CONFIG_EVENT: { 160 case ParsedRtcEventLog::VIDEO_SENDER_CONFIG_EVENT: {
150 VideoSendStream::Config config(nullptr); 161 VideoSendStream::Config config(nullptr);
151 parsed_log_.GetVideoSendConfig(i, &config); 162 parsed_log_.GetVideoSendConfig(i, &config);
152 for (auto ssrc : config.rtp.ssrcs) { 163 for (auto ssrc : config.rtp.ssrcs) {
153 StreamId stream(ssrc, kOutgoingPacket); 164 StreamId stream(ssrc, kOutgoingPacket);
154 extension_maps[stream].Erase(); 165 RegisterHeaderExtensions(config.rtp.extensions,
155 for (size_t j = 0; j < config.rtp.extensions.size(); ++j) { 166 &extension_maps[stream]);
156 const std::string& extension = config.rtp.extensions[j].uri; 167 }
157 int id = config.rtp.extensions[j].id; 168 for (auto ssrc : config.rtp.rtx.ssrcs) {
158 extension_maps[stream].Register(StringToRtpExtensionType(extension), 169 StreamId stream(ssrc, kOutgoingPacket);
159 id); 170 RegisterHeaderExtensions(config.rtp.extensions,
160 } 171 &extension_maps[stream]);
161 } 172 }
162 break; 173 break;
163 } 174 }
164 case ParsedRtcEventLog::AUDIO_RECEIVER_CONFIG_EVENT: { 175 case ParsedRtcEventLog::AUDIO_RECEIVER_CONFIG_EVENT: {
165 AudioReceiveStream::Config config; 176 AudioReceiveStream::Config config;
166 // TODO(terelius): Parse the audio configs once we have them. 177 // TODO(terelius): Parse the audio configs once we have them.
167 break; 178 break;
168 } 179 }
169 case ParsedRtcEventLog::AUDIO_SENDER_CONFIG_EVENT: { 180 case ParsedRtcEventLog::AUDIO_SENDER_CONFIG_EVENT: {
170 AudioSendStream::Config config(nullptr); 181 AudioSendStream::Config config(nullptr);
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 plot->xaxis_max = (end_time_ - begin_time_) / 1000000 * kXMargin; 847 plot->xaxis_max = (end_time_ - begin_time_) / 1000000 * kXMargin;
837 plot->xaxis_label = "Time (s)"; 848 plot->xaxis_label = "Time (s)";
838 plot->yaxis_min = min_y - (kYMargin - 1) / 2 * (max_y - min_y); 849 plot->yaxis_min = min_y - (kYMargin - 1) / 2 * (max_y - min_y);
839 plot->yaxis_max = max_y + (kYMargin - 1) / 2 * (max_y - min_y); 850 plot->yaxis_max = max_y + (kYMargin - 1) / 2 * (max_y - min_y);
840 plot->yaxis_label = "Bitrate (kbps)"; 851 plot->yaxis_label = "Bitrate (kbps)";
841 plot->title = "BWE"; 852 plot->title = "BWE";
842 } 853 }
843 854
844 } // namespace plotting 855 } // namespace plotting
845 } // namespace webrtc 856 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698