OLD | NEW |
---|---|
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 |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 case ParsedRtcEventLog::BWE_PACKET_LOSS_EVENT: { | 438 case ParsedRtcEventLog::BWE_PACKET_LOSS_EVENT: { |
439 BwePacketLossEvent bwe_update; | 439 BwePacketLossEvent bwe_update; |
440 bwe_update.timestamp = parsed_log_.GetTimestamp(i); | 440 bwe_update.timestamp = parsed_log_.GetTimestamp(i); |
441 parsed_log_.GetBwePacketLossEvent(i, &bwe_update.new_bitrate, | 441 parsed_log_.GetBwePacketLossEvent(i, &bwe_update.new_bitrate, |
442 &bwe_update.fraction_loss, | 442 &bwe_update.fraction_loss, |
443 &bwe_update.expected_packets); | 443 &bwe_update.expected_packets); |
444 bwe_loss_updates_.push_back(bwe_update); | 444 bwe_loss_updates_.push_back(bwe_update); |
445 break; | 445 break; |
446 } | 446 } |
447 case ParsedRtcEventLog::AUDIO_NETWORK_ADAPTATION_EVENT: { | 447 case ParsedRtcEventLog::AUDIO_NETWORK_ADAPTATION_EVENT: { |
448 AudioNetworkAdaptationEvent ana_event; | |
449 ana_event.timestamp = parsed_log_.GetTimestamp(i); | |
450 parsed_log_.GetAudioNetworkAdaptation(i, &ana_event.config); | |
451 audio_network_adaptation_events_.push_back(ana_event); | |
448 break; | 452 break; |
449 } | 453 } |
450 case ParsedRtcEventLog::BWE_PACKET_DELAY_EVENT: { | 454 case ParsedRtcEventLog::BWE_PACKET_DELAY_EVENT: { |
451 break; | 455 break; |
452 } | 456 } |
453 case ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT: { | 457 case ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT: { |
454 break; | 458 break; |
455 } | 459 } |
456 case ParsedRtcEventLog::UNKNOWN_EVENT: { | 460 case ParsedRtcEventLog::UNKNOWN_EVENT: { |
457 break; | 461 break; |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1267 } | 1271 } |
1268 plot->series_list_.push_back(std::move(timestamp_data)); | 1272 plot->series_list_.push_back(std::move(timestamp_data)); |
1269 } | 1273 } |
1270 } | 1274 } |
1271 } | 1275 } |
1272 | 1276 |
1273 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1277 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1274 plot->SetSuggestedYAxis(0, 1, "Timestamp (90khz)", kBottomMargin, kTopMargin); | 1278 plot->SetSuggestedYAxis(0, 1, "Timestamp (90khz)", kBottomMargin, kTopMargin); |
1275 plot->SetTitle("Timestamps"); | 1279 plot->SetTitle("Timestamps"); |
1276 } | 1280 } |
1281 | |
1282 void EventLogAnalyzer::CreateAudioEncoderTargetBitrateGraph(Plot* plot) { | |
1283 plot->series_list_.push_back(TimeSeries()); | |
1284 for (auto& ana_event : audio_network_adaptation_events_) { | |
minyue-webrtc
2017/02/14 17:04:22
looks like there is a lot of code redundancy. Do w
michaelt
2017/02/15 08:06:45
Rigth, but it seams not to easy to reduce the redu
| |
1285 if (ana_event.config.bitrate_bps) { | |
1286 float x = static_cast<float>(ana_event.timestamp - begin_time_) / 1000000; | |
1287 float y = static_cast<float>(*ana_event.config.bitrate_bps); | |
1288 plot->series_list_.back().points.emplace_back(x, y); | |
1289 } | |
1290 } | |
1291 plot->series_list_.back().label = "Audio encoder target bitrate"; | |
1292 plot->series_list_.back().style = LINE_DOT_GRAPH; | |
1293 | |
1294 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | |
1295 plot->SetSuggestedYAxis(0, 1, "Bitrate (bps)", kBottomMargin, kTopMargin); | |
1296 plot->SetTitle("Reported audio encoder target bitrate"); | |
1297 } | |
1298 | |
1299 void EventLogAnalyzer::CreateAudioEncoderFrameLengthGraph(Plot* plot) { | |
1300 plot->series_list_.push_back(TimeSeries()); | |
1301 for (auto& ana_event : audio_network_adaptation_events_) { | |
1302 if (ana_event.config.frame_length_ms) { | |
1303 float x = static_cast<float>(ana_event.timestamp - begin_time_) / 1000000; | |
1304 float y = static_cast<float>(*ana_event.config.frame_length_ms); | |
1305 plot->series_list_.back().points.emplace_back(x, y); | |
1306 } | |
1307 } | |
1308 plot->series_list_.back().label = "Audio encoder frame length"; | |
1309 plot->series_list_.back().style = LINE_DOT_GRAPH; | |
1310 | |
1311 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | |
1312 plot->SetSuggestedYAxis(0, 1, "Frame length (ms)", kBottomMargin, kTopMargin); | |
1313 plot->SetTitle("Reported audio encoder frame length"); | |
1314 } | |
1315 | |
1316 void EventLogAnalyzer::CreateAudioEncoderUplinkPacketLossFractionGraph( | |
1317 Plot* plot) { | |
1318 plot->series_list_.push_back(TimeSeries()); | |
1319 for (auto& ana_event : audio_network_adaptation_events_) { | |
1320 if (ana_event.config.uplink_packet_loss_fraction) { | |
1321 float x = static_cast<float>(ana_event.timestamp - begin_time_) / 1000000; | |
1322 float y = | |
1323 static_cast<float>(*ana_event.config.uplink_packet_loss_fraction); | |
1324 plot->series_list_.back().points.emplace_back(x, y); | |
1325 } | |
1326 } | |
1327 plot->series_list_.back().label = "Audio encoder uplink packet loss fraction"; | |
1328 plot->series_list_.back().style = LINE_DOT_GRAPH; | |
1329 | |
1330 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | |
1331 plot->SetSuggestedYAxis(0, 10, "Percent lost packets", kBottomMargin, | |
1332 kTopMargin); | |
1333 plot->SetTitle("Reported audio encoder lost packets"); | |
1334 } | |
1335 | |
1336 void EventLogAnalyzer::CreateAudioEncoderEnableFecGraph(Plot* plot) { | |
1337 plot->series_list_.push_back(TimeSeries()); | |
1338 for (auto& ana_event : audio_network_adaptation_events_) { | |
1339 if (ana_event.config.enable_fec) { | |
1340 float x = static_cast<float>(ana_event.timestamp - begin_time_) / 1000000; | |
1341 float y = static_cast<float>(*ana_event.config.enable_fec); | |
1342 plot->series_list_.back().points.emplace_back(x, y); | |
1343 } | |
1344 } | |
1345 plot->series_list_.back().label = "Audio encoder enable FEC"; | |
1346 plot->series_list_.back().style = LINE_DOT_GRAPH; | |
1347 | |
1348 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | |
1349 plot->SetSuggestedYAxis(0, 1, "Enable FEC (false/true)", kBottomMargin, | |
1350 kTopMargin); | |
1351 plot->SetTitle("Reported audio encoder enable FEC"); | |
1352 } | |
1353 | |
1354 void EventLogAnalyzer::CreateAudioEncoderEnableDtxGraph(Plot* plot) { | |
1355 plot->series_list_.push_back(TimeSeries()); | |
1356 for (auto& ana_event : audio_network_adaptation_events_) { | |
1357 if (ana_event.config.enable_dtx) { | |
1358 float x = static_cast<float>(ana_event.timestamp - begin_time_) / 1000000; | |
1359 float y = static_cast<float>(*ana_event.config.enable_dtx); | |
1360 plot->series_list_.back().points.emplace_back(x, y); | |
1361 } | |
1362 } | |
1363 plot->series_list_.back().label = "Audio encoder enable DTX"; | |
1364 plot->series_list_.back().style = LINE_DOT_GRAPH; | |
1365 | |
1366 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | |
1367 plot->SetSuggestedYAxis(0, 1, "Enable DTX (false/true)", kBottomMargin, | |
1368 kTopMargin); | |
1369 plot->SetTitle("Reported audio encoder enable DTX"); | |
1370 } | |
1371 | |
1372 void EventLogAnalyzer::CreateAudioEncoderNumChannelsGraph(Plot* plot) { | |
1373 plot->series_list_.push_back(TimeSeries()); | |
1374 for (auto& ana_event : audio_network_adaptation_events_) { | |
1375 if (ana_event.config.num_channels) { | |
1376 float x = static_cast<float>(ana_event.timestamp - begin_time_) / 1000000; | |
1377 float y = static_cast<float>(*ana_event.config.num_channels); | |
1378 plot->series_list_.back().points.emplace_back(x, y); | |
1379 } | |
1380 } | |
1381 plot->series_list_.back().label = "Audio encoder number of channels"; | |
1382 plot->series_list_.back().style = LINE_DOT_GRAPH; | |
1383 | |
1384 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | |
1385 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))", | |
1386 kBottomMargin, kTopMargin); | |
1387 plot->SetTitle("Reported audio encoder number of channels"); | |
1388 } | |
1277 } // namespace plotting | 1389 } // namespace plotting |
1278 } // namespace webrtc | 1390 } // namespace webrtc |
OLD | NEW |