Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef RTC_TOOLS_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_ |
| 12 | #define RTC_TOOLS_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_ |
| 13 | |
| 14 | #include <string> |
| 15 | |
| 16 | namespace webrtc { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 17 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 18 | class IncomingRtpReceiveTimeGap { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 19 | public: |
| 20 | IncomingRtpReceiveTimeGap(float time_seconds, int64_t duration) |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 21 | : time_seconds_(time_seconds), duration_(duration) {} |
| 22 | float Time() const { return time_seconds_; } |
| 23 | std::string ToString() const { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 24 | return std::string("No RTP packets received for ") + |
| 25 | std::to_string(duration_) + std::string(" ms"); |
| 26 | } |
| 27 | |
| 28 | private: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 29 | float time_seconds_; |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 30 | int64_t duration_; |
| 31 | }; |
| 32 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 33 | class IncomingRtcpReceiveTimeGap { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 34 | public: |
| 35 | IncomingRtcpReceiveTimeGap(float time_seconds, int64_t duration) |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 36 | : time_seconds_(time_seconds), duration_(duration) {} |
| 37 | float Time() const { return time_seconds_; } |
| 38 | std::string ToString() const { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 39 | return std::string("No RTCP packets received for ") + |
| 40 | std::to_string(duration_) + std::string(" ms"); |
| 41 | } |
| 42 | |
| 43 | private: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 44 | float time_seconds_; |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 45 | int64_t duration_; |
| 46 | }; |
| 47 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 48 | class OutgoingRtpSendTimeGap { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 49 | public: |
| 50 | OutgoingRtpSendTimeGap(float time_seconds, int64_t duration) |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 51 | : time_seconds_(time_seconds), duration_(duration) {} |
| 52 | float Time() const { return time_seconds_; } |
| 53 | std::string ToString() const { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 54 | return std::string("No RTP packets sent for ") + std::to_string(duration_) + |
| 55 | std::string(" ms"); |
| 56 | } |
| 57 | |
| 58 | private: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 59 | float time_seconds_; |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 60 | int64_t duration_; |
| 61 | }; |
| 62 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 63 | class OutgoingRtcpSendTimeGap { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 64 | public: |
| 65 | OutgoingRtcpSendTimeGap(float time_seconds, int64_t duration) |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 66 | : time_seconds_(time_seconds), duration_(duration) {} |
| 67 | float Time() const { return time_seconds_; } |
| 68 | std::string ToString() const { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 69 | return std::string("No RTCP packets sent for ") + |
| 70 | std::to_string(duration_) + std::string(" ms"); |
| 71 | } |
| 72 | |
| 73 | private: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 74 | float time_seconds_; |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 75 | int64_t duration_; |
| 76 | }; |
| 77 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 78 | class IncomingSeqNumJump { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 79 | public: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 80 | IncomingSeqNumJump(float time_seconds, uint32_t ssrc) |
| 81 | : time_seconds_(time_seconds), ssrc_(ssrc) {} |
| 82 | float Time() const { return time_seconds_; } |
| 83 | std::string ToString() const { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 84 | return std::string("Sequence number jumps on incoming SSRC ") + |
| 85 | std::to_string(ssrc_); |
| 86 | } |
| 87 | |
| 88 | private: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 89 | float time_seconds_; |
| 90 | |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 91 | uint32_t ssrc_; |
| 92 | }; |
| 93 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 94 | class IncomingCaptureTimeJump { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 95 | public: |
| 96 | IncomingCaptureTimeJump(float time_seconds, uint32_t ssrc) |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 97 | : time_seconds_(time_seconds), ssrc_(ssrc) {} |
| 98 | float Time() const { return time_seconds_; } |
| 99 | std::string ToString() const { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 100 | return std::string("Capture timestamp jumps on incoming SSRC ") + |
| 101 | std::to_string(ssrc_); |
| 102 | } |
| 103 | |
| 104 | private: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 105 | float time_seconds_; |
| 106 | |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 107 | uint32_t ssrc_; |
| 108 | }; |
| 109 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 110 | class OutgoingSeqNoJump { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 111 | public: |
| 112 | OutgoingSeqNoJump(float time_seconds, uint32_t ssrc) |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 113 | : time_seconds_(time_seconds), ssrc_(ssrc) {} |
| 114 | float Time() const { return time_seconds_; } |
| 115 | std::string ToString() const { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 116 | return std::string("Sequence number jumps on outgoing SSRC ") + |
| 117 | std::to_string(ssrc_); |
| 118 | } |
| 119 | |
| 120 | private: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 121 | float time_seconds_; |
| 122 | |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 123 | uint32_t ssrc_; |
| 124 | }; |
| 125 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 126 | class OutgoingCaptureTimeJump { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 127 | public: |
| 128 | OutgoingCaptureTimeJump(float time_seconds, uint32_t ssrc) |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 129 | : time_seconds_(time_seconds), ssrc_(ssrc) {} |
| 130 | float Time() const { return time_seconds_; } |
| 131 | std::string ToString() const { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 132 | return std::string("Capture timestamp jumps on outgoing SSRC ") + |
| 133 | std::to_string(ssrc_); |
| 134 | } |
| 135 | |
| 136 | private: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 137 | float time_seconds_; |
| 138 | |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 139 | uint32_t ssrc_; |
| 140 | }; |
| 141 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 142 | class OutgoingHighLoss { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 143 | public: |
| 144 | explicit OutgoingHighLoss(double avg_loss_fraction) |
| 145 | : avg_loss_fraction_(avg_loss_fraction) {} |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 146 | std::string ToString() const { |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 147 | return std::string("High average loss (") + |
| 148 | std::to_string(avg_loss_fraction_ * 100) + |
| 149 | std::string("%) across the call."); |
| 150 | } |
| 151 | |
| 152 | private: |
| 153 | double avg_loss_fraction_; |
| 154 | }; |
| 155 | |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 156 | } // namespace webrtc |
| 157 | |
| 158 | #endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_ |