blob: 641e2ae6b0eb5f554392ed357030df6d3cdd03c2 [file] [log] [blame]
Bjorn Terelius2eb31882017-11-30 15:15:25 +01001/*
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
16namespace webrtc {
Björn Tereliusff612732018-04-25 14:23:01 +000017namespace plotting {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010018
Björn Tereliusff612732018-04-25 14:23:01 +000019class TriageNotification {
20 public:
21 TriageNotification() : time_seconds_() {}
22 explicit TriageNotification(float time_seconds)
23 : time_seconds_(time_seconds) {}
24 virtual ~TriageNotification() = default;
25 virtual std::string ToString() = 0;
26 rtc::Optional<float> Time() { return time_seconds_; }
27
28 private:
29 rtc::Optional<float> time_seconds_;
30};
31
32class IncomingRtpReceiveTimeGap : public TriageNotification {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010033 public:
34 IncomingRtpReceiveTimeGap(float time_seconds, int64_t duration)
Björn Tereliusff612732018-04-25 14:23:01 +000035 : TriageNotification(time_seconds), duration_(duration) {}
36 std::string ToString() {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010037 return std::string("No RTP packets received for ") +
38 std::to_string(duration_) + std::string(" ms");
39 }
40
41 private:
42 int64_t duration_;
43};
44
Björn Tereliusff612732018-04-25 14:23:01 +000045class IncomingRtcpReceiveTimeGap : public TriageNotification {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010046 public:
47 IncomingRtcpReceiveTimeGap(float time_seconds, int64_t duration)
Björn Tereliusff612732018-04-25 14:23:01 +000048 : TriageNotification(time_seconds), duration_(duration) {}
49 std::string ToString() {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010050 return std::string("No RTCP packets received for ") +
51 std::to_string(duration_) + std::string(" ms");
52 }
53
54 private:
55 int64_t duration_;
56};
57
Björn Tereliusff612732018-04-25 14:23:01 +000058class OutgoingRtpSendTimeGap : public TriageNotification {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010059 public:
60 OutgoingRtpSendTimeGap(float time_seconds, int64_t duration)
Björn Tereliusff612732018-04-25 14:23:01 +000061 : TriageNotification(time_seconds), duration_(duration) {}
62 std::string ToString() {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010063 return std::string("No RTP packets sent for ") + std::to_string(duration_) +
64 std::string(" ms");
65 }
66
67 private:
68 int64_t duration_;
69};
70
Björn Tereliusff612732018-04-25 14:23:01 +000071class OutgoingRtcpSendTimeGap : public TriageNotification {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010072 public:
73 OutgoingRtcpSendTimeGap(float time_seconds, int64_t duration)
Björn Tereliusff612732018-04-25 14:23:01 +000074 : TriageNotification(time_seconds), duration_(duration) {}
75 std::string ToString() {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010076 return std::string("No RTCP packets sent for ") +
77 std::to_string(duration_) + std::string(" ms");
78 }
79
80 private:
81 int64_t duration_;
82};
83
Björn Tereliusff612732018-04-25 14:23:01 +000084class IncomingSeqNoJump : public TriageNotification {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010085 public:
Björn Tereliusff612732018-04-25 14:23:01 +000086 IncomingSeqNoJump(float time_seconds, uint32_t ssrc)
87 : TriageNotification(time_seconds), ssrc_(ssrc) {}
88 std::string ToString() {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010089 return std::string("Sequence number jumps on incoming SSRC ") +
90 std::to_string(ssrc_);
91 }
92
93 private:
94 uint32_t ssrc_;
95};
96
Björn Tereliusff612732018-04-25 14:23:01 +000097class IncomingCaptureTimeJump : public TriageNotification {
Bjorn Terelius2eb31882017-11-30 15:15:25 +010098 public:
99 IncomingCaptureTimeJump(float time_seconds, uint32_t ssrc)
Björn Tereliusff612732018-04-25 14:23:01 +0000100 : TriageNotification(time_seconds), ssrc_(ssrc) {}
101 std::string ToString() {
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100102 return std::string("Capture timestamp jumps on incoming SSRC ") +
103 std::to_string(ssrc_);
104 }
105
106 private:
107 uint32_t ssrc_;
108};
109
Björn Tereliusff612732018-04-25 14:23:01 +0000110class OutgoingSeqNoJump : public TriageNotification {
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100111 public:
112 OutgoingSeqNoJump(float time_seconds, uint32_t ssrc)
Björn Tereliusff612732018-04-25 14:23:01 +0000113 : TriageNotification(time_seconds), ssrc_(ssrc) {}
114 std::string ToString() {
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100115 return std::string("Sequence number jumps on outgoing SSRC ") +
116 std::to_string(ssrc_);
117 }
118
119 private:
120 uint32_t ssrc_;
121};
122
Björn Tereliusff612732018-04-25 14:23:01 +0000123class OutgoingCaptureTimeJump : public TriageNotification {
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100124 public:
125 OutgoingCaptureTimeJump(float time_seconds, uint32_t ssrc)
Björn Tereliusff612732018-04-25 14:23:01 +0000126 : TriageNotification(time_seconds), ssrc_(ssrc) {}
127 std::string ToString() {
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100128 return std::string("Capture timestamp jumps on outgoing SSRC ") +
129 std::to_string(ssrc_);
130 }
131
132 private:
133 uint32_t ssrc_;
134};
135
Björn Tereliusff612732018-04-25 14:23:01 +0000136class OutgoingHighLoss : public TriageNotification {
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100137 public:
138 explicit OutgoingHighLoss(double avg_loss_fraction)
139 : avg_loss_fraction_(avg_loss_fraction) {}
Björn Tereliusff612732018-04-25 14:23:01 +0000140 std::string ToString() {
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100141 return std::string("High average loss (") +
142 std::to_string(avg_loss_fraction_ * 100) +
143 std::string("%) across the call.");
144 }
145
146 private:
147 double avg_loss_fraction_;
148};
149
Björn Tereliusff612732018-04-25 14:23:01 +0000150} // namespace plotting
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100151} // namespace webrtc
152
153#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_