| 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 |
| 11 #ifndef WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ | 11 #ifndef WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ |
| 12 #define WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ | 12 #define WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ |
| 13 | 13 |
| 14 #include <vector> | 14 #include <vector> |
| 15 #include <map> | 15 #include <map> |
| 16 #include <memory> | 16 #include <memory> |
| 17 #include <set> | 17 #include <set> |
| 18 #include <utility> | 18 #include <utility> |
| 19 | 19 |
| 20 #include "webrtc/call/rtc_event_log_parser.h" | 20 #include "webrtc/call/rtc_event_log_parser.h" |
| 21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 22 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" |
| 23 #include "webrtc/tools/event_log_visualizer/plot_base.h" | 23 #include "webrtc/tools/event_log_visualizer/plot_base.h" |
| 24 | 24 |
| 25 namespace webrtc { | 25 namespace webrtc { |
| 26 namespace plotting { | 26 namespace plotting { |
| 27 | 27 |
| 28 struct LoggedRtpPacket { |
| 29 LoggedRtpPacket(uint64_t timestamp, RTPHeader header, size_t total_length) |
| 30 : timestamp(timestamp), header(header), total_length(total_length) {} |
| 31 uint64_t timestamp; |
| 32 RTPHeader header; |
| 33 size_t total_length; |
| 34 }; |
| 35 |
| 36 struct LoggedRtcpPacket { |
| 37 LoggedRtcpPacket(uint64_t timestamp, |
| 38 RTCPPacketType rtcp_type, |
| 39 std::unique_ptr<rtcp::RtcpPacket> rtcp_packet) |
| 40 : timestamp(timestamp), type(rtcp_type), packet(std::move(rtcp_packet)) {} |
| 41 uint64_t timestamp; |
| 42 RTCPPacketType type; |
| 43 std::unique_ptr<rtcp::RtcpPacket> packet; |
| 44 }; |
| 45 |
| 46 struct BwePacketLossEvent { |
| 47 uint64_t timestamp; |
| 48 int32_t new_bitrate; |
| 49 uint8_t fraction_loss; |
| 50 int32_t expected_packets; |
| 51 }; |
| 52 |
| 28 class EventLogAnalyzer { | 53 class EventLogAnalyzer { |
| 29 public: | 54 public: |
| 30 // The EventLogAnalyzer keeps a reference to the ParsedRtcEventLog for the | 55 // The EventLogAnalyzer keeps a reference to the ParsedRtcEventLog for the |
| 31 // duration of its lifetime. The ParsedRtcEventLog must not be destroyed or | 56 // duration of its lifetime. The ParsedRtcEventLog must not be destroyed or |
| 32 // modified while the EventLogAnalyzer is being used. | 57 // modified while the EventLogAnalyzer is being used. |
| 33 explicit EventLogAnalyzer(const ParsedRtcEventLog& log); | 58 explicit EventLogAnalyzer(const ParsedRtcEventLog& log); |
| 34 | 59 |
| 35 void CreatePacketGraph(PacketDirection desired_direction, Plot* plot); | 60 void CreatePacketGraph(PacketDirection desired_direction, Plot* plot); |
| 36 | 61 |
| 37 void CreatePlayoutGraph(Plot* plot); | 62 void CreatePlayoutGraph(Plot* plot); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 66 std::tie(other.ssrc_, other.direction_); | 91 std::tie(other.ssrc_, other.direction_); |
| 67 } | 92 } |
| 68 uint32_t GetSsrc() const { return ssrc_; } | 93 uint32_t GetSsrc() const { return ssrc_; } |
| 69 webrtc::PacketDirection GetDirection() const { return direction_; } | 94 webrtc::PacketDirection GetDirection() const { return direction_; } |
| 70 | 95 |
| 71 private: | 96 private: |
| 72 uint32_t ssrc_; | 97 uint32_t ssrc_; |
| 73 webrtc::PacketDirection direction_; | 98 webrtc::PacketDirection direction_; |
| 74 }; | 99 }; |
| 75 | 100 |
| 76 struct LoggedRtpPacket { | |
| 77 LoggedRtpPacket(uint64_t timestamp, RTPHeader header, size_t total_length) | |
| 78 : timestamp(timestamp), header(header), total_length(total_length) {} | |
| 79 uint64_t timestamp; | |
| 80 RTPHeader header; | |
| 81 size_t total_length; | |
| 82 }; | |
| 83 | |
| 84 struct LoggedRtcpPacket { | |
| 85 LoggedRtcpPacket(uint64_t timestamp, | |
| 86 RTCPPacketType rtcp_type, | |
| 87 std::unique_ptr<rtcp::RtcpPacket> rtcp_packet) | |
| 88 : timestamp(timestamp), | |
| 89 type(rtcp_type), | |
| 90 packet(std::move(rtcp_packet)) {} | |
| 91 uint64_t timestamp; | |
| 92 RTCPPacketType type; | |
| 93 std::unique_ptr<rtcp::RtcpPacket> packet; | |
| 94 }; | |
| 95 | |
| 96 struct BwePacketLossEvent { | |
| 97 uint64_t timestamp; | |
| 98 int32_t new_bitrate; | |
| 99 uint8_t fraction_loss; | |
| 100 int32_t expected_packets; | |
| 101 }; | |
| 102 | |
| 103 bool IsRtxSsrc(StreamId stream_id); | 101 bool IsRtxSsrc(StreamId stream_id); |
| 104 | 102 |
| 105 bool IsVideoSsrc(StreamId stream_id); | 103 bool IsVideoSsrc(StreamId stream_id); |
| 106 | 104 |
| 107 bool IsAudioSsrc(StreamId stream_id); | 105 bool IsAudioSsrc(StreamId stream_id); |
| 108 | 106 |
| 109 const ParsedRtcEventLog& parsed_log_; | 107 const ParsedRtcEventLog& parsed_log_; |
| 110 | 108 |
| 111 // A list of SSRCs we are interested in analysing. | 109 // A list of SSRCs we are interested in analysing. |
| 112 // If left empty, all SSRCs will be considered relevant. | 110 // If left empty, all SSRCs will be considered relevant. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 143 uint64_t end_time_; | 141 uint64_t end_time_; |
| 144 | 142 |
| 145 // Duration (in seconds) of log file. | 143 // Duration (in seconds) of log file. |
| 146 float call_duration_s_; | 144 float call_duration_s_; |
| 147 }; | 145 }; |
| 148 | 146 |
| 149 } // namespace plotting | 147 } // namespace plotting |
| 150 } // namespace webrtc | 148 } // namespace webrtc |
| 151 | 149 |
| 152 #endif // WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ | 150 #endif // WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ |
| OLD | NEW |