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

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

Issue 2912813002: Overlay REMB in total bitrate graphs in visualization tool. (Closed)
Patch Set: Created 3 years, 6 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 | webrtc/tools/event_log_visualizer/plot_base.h » ('j') | 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
(...skipping 12 matching lines...) Expand all
23 #include "webrtc/call/audio_receive_stream.h" 23 #include "webrtc/call/audio_receive_stream.h"
24 #include "webrtc/call/audio_send_stream.h" 24 #include "webrtc/call/audio_send_stream.h"
25 #include "webrtc/call/call.h" 25 #include "webrtc/call/call.h"
26 #include "webrtc/common_types.h" 26 #include "webrtc/common_types.h"
27 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" 27 #include "webrtc/modules/congestion_controller/include/congestion_controller.h"
28 #include "webrtc/modules/include/module_common_types.h" 28 #include "webrtc/modules/include/module_common_types.h"
29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" 29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
30 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 30 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h"
32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h"
33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h"
33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" 34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h"
34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" 35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
35 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" 36 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h"
36 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" 37 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
37 #include "webrtc/video_receive_stream.h" 38 #include "webrtc/video_receive_stream.h"
38 #include "webrtc/video_send_stream.h" 39 #include "webrtc/video_send_stream.h"
39 40
40 namespace webrtc { 41 namespace webrtc {
41 namespace plotting { 42 namespace plotting {
42 43
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } else if (header.type() == rtcp::ReceiverReport::kPacketType) { 445 } else if (header.type() == rtcp::ReceiverReport::kPacketType) {
445 std::unique_ptr<rtcp::ReceiverReport> rtcp_packet( 446 std::unique_ptr<rtcp::ReceiverReport> rtcp_packet(
446 new rtcp::ReceiverReport()); 447 new rtcp::ReceiverReport());
447 if (rtcp_packet->Parse(header)) { 448 if (rtcp_packet->Parse(header)) {
448 uint32_t ssrc = rtcp_packet->sender_ssrc(); 449 uint32_t ssrc = rtcp_packet->sender_ssrc();
449 StreamId stream(ssrc, direction); 450 StreamId stream(ssrc, direction);
450 uint64_t timestamp = parsed_log_.GetTimestamp(i); 451 uint64_t timestamp = parsed_log_.GetTimestamp(i);
451 rtcp_packets_[stream].push_back( 452 rtcp_packets_[stream].push_back(
452 LoggedRtcpPacket(timestamp, kRtcpRr, std::move(rtcp_packet))); 453 LoggedRtcpPacket(timestamp, kRtcpRr, std::move(rtcp_packet)));
453 } 454 }
455 } else if (header.type() == rtcp::Remb::kPacketType &&
456 header.fmt() == rtcp::Remb::kFeedbackMessageType) {
457 std::unique_ptr<rtcp::Remb> rtcp_packet(new rtcp::Remb());
tschumi 2017/05/30 14:23:13 make_unique ?
terelius 2017/05/30 15:12:48 Isn't that C++14? I don't think we can use it.
holmer 2017/05/30 15:28:46 rtc::MakeUnique
terelius 2017/06/01 16:02:19 Done.
458 if (rtcp_packet->Parse(header)) {
459 uint32_t ssrc = rtcp_packet->sender_ssrc();
460 StreamId stream(ssrc, direction);
461 uint64_t timestamp = parsed_log_.GetTimestamp(i);
462 rtcp_packets_[stream].push_back(LoggedRtcpPacket(
463 timestamp, kRtcpRemb, std::move(rtcp_packet)));
464 }
454 } 465 }
455 } 466 }
456 break; 467 break;
457 } 468 }
458 case ParsedRtcEventLog::LOG_START: { 469 case ParsedRtcEventLog::LOG_START: {
459 break; 470 break;
460 } 471 }
461 case ParsedRtcEventLog::LOG_END: { 472 case ParsedRtcEventLog::LOG_END: {
462 break; 473 break;
463 } 474 }
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 float y = static_cast<float>(*result.bitrate_bps) / 1000; 983 float y = static_cast<float>(*result.bitrate_bps) / 1000;
973 result_series.points.emplace_back(x, y); 984 result_series.points.emplace_back(x, y);
974 } 985 }
975 } 986 }
976 plot->AppendTimeSeries(std::move(loss_series)); 987 plot->AppendTimeSeries(std::move(loss_series));
977 plot->AppendTimeSeries(std::move(delay_series)); 988 plot->AppendTimeSeries(std::move(delay_series));
978 plot->AppendTimeSeries(std::move(created_series)); 989 plot->AppendTimeSeries(std::move(created_series));
979 plot->AppendTimeSeries(std::move(result_series)); 990 plot->AppendTimeSeries(std::move(result_series));
980 } 991 }
981 992
993 // Overlay the incoming REMB over the outgoing bitrate
994 // and outgoing REMB over incoming bitrate.
995 PacketDirection remb_direction =
996 desired_direction == kOutgoingPacket ? kIncomingPacket : kOutgoingPacket;
997 TimeSeries remb_series("Remb", LINE_STEP_GRAPH);
998 std::multimap<uint64_t, const LoggedRtcpPacket*> remb_packets;
999 for (const auto& kv : rtcp_packets_) {
1000 if (kv.first.GetDirection() == remb_direction) {
1001 for (const LoggedRtcpPacket& rtcp_packet : kv.second) {
1002 if (rtcp_packet.type == kRtcpRemb) {
1003 remb_packets.insert(
1004 std::make_pair(rtcp_packet.timestamp, &rtcp_packet));
1005 }
1006 }
1007 }
1008 }
1009
1010 for (const auto& kv : remb_packets) {
tschumi 2017/05/30 14:23:13 What was the reason to introduce remb_packets. We
terelius 2017/05/30 15:12:48 That would probably work, but in principle we're n
tschumi 2017/05/31 10:49:51 Acknowledged.
1011 const LoggedRtcpPacket* const rtcp = kv.second;
1012 const rtcp::Remb* const remb = static_cast<rtcp::Remb*>(rtcp->packet.get());
1013 float x = static_cast<float>(rtcp->timestamp - begin_time_) / 1000000;
1014 float y = static_cast<float>(remb->bitrate_bps()) / 1000;
1015 remb_series.points.emplace_back(x, y);
1016 }
1017 plot->AppendTimeSeriesIfNotEmpty(std::move(remb_series));
1018
982 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1019 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
983 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); 1020 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin);
984 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { 1021 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) {
985 plot->SetTitle("Incoming RTP bitrate"); 1022 plot->SetTitle("Incoming RTP bitrate");
986 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { 1023 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) {
987 plot->SetTitle("Outgoing RTP bitrate"); 1024 plot->SetTitle("Outgoing RTP bitrate");
988 } 1025 }
989 } 1026 }
990 1027
991 // For each SSRC, plot the bandwidth used by that stream. 1028 // For each SSRC, plot the bandwidth used by that stream.
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 }, 1432 },
1396 audio_network_adaptation_events_, begin_time_, &time_series); 1433 audio_network_adaptation_events_, begin_time_, &time_series);
1397 plot->AppendTimeSeries(std::move(time_series)); 1434 plot->AppendTimeSeries(std::move(time_series));
1398 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1435 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1399 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))", 1436 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))",
1400 kBottomMargin, kTopMargin); 1437 kBottomMargin, kTopMargin);
1401 plot->SetTitle("Reported audio encoder number of channels"); 1438 plot->SetTitle("Reported audio encoder number of channels");
1402 } 1439 }
1403 } // namespace plotting 1440 } // namespace plotting
1404 } // namespace webrtc 1441 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/tools/event_log_visualizer/plot_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698