aboutsummaryrefslogtreecommitdiff
path: root/rtc_tools/rtc_event_log_visualizer/triage_notifications.h
blob: 23b31ece421129382a716b4904d192e6846aed93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/*
 *  Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_
#define RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_

#include <string>

namespace webrtc {

class IncomingRtpReceiveTimeGap {
 public:
  IncomingRtpReceiveTimeGap(float time_seconds, int64_t duration)
      : time_seconds_(time_seconds), duration_(duration) {}
  float Time() const { return time_seconds_; }
  std::string ToString() const {
    return std::string("No RTP packets received for ") +
           std::to_string(duration_) + std::string(" ms");
  }

 private:
  float time_seconds_;
  int64_t duration_;
};

class IncomingRtcpReceiveTimeGap {
 public:
  IncomingRtcpReceiveTimeGap(float time_seconds, int64_t duration)
      : time_seconds_(time_seconds), duration_(duration) {}
  float Time() const { return time_seconds_; }
  std::string ToString() const {
    return std::string("No RTCP packets received for ") +
           std::to_string(duration_) + std::string(" ms");
  }

 private:
  float time_seconds_;
  int64_t duration_;
};

class OutgoingRtpSendTimeGap {
 public:
  OutgoingRtpSendTimeGap(float time_seconds, int64_t duration)
      : time_seconds_(time_seconds), duration_(duration) {}
  float Time() const { return time_seconds_; }
  std::string ToString() const {
    return std::string("No RTP packets sent for ") + std::to_string(duration_) +
           std::string(" ms");
  }

 private:
  float time_seconds_;
  int64_t duration_;
};

class OutgoingRtcpSendTimeGap {
 public:
  OutgoingRtcpSendTimeGap(float time_seconds, int64_t duration)
      : time_seconds_(time_seconds), duration_(duration) {}
  float Time() const { return time_seconds_; }
  std::string ToString() const {
    return std::string("No RTCP packets sent for ") +
           std::to_string(duration_) + std::string(" ms");
  }

 private:
  float time_seconds_;
  int64_t duration_;
};

class IncomingSeqNumJump {
 public:
  IncomingSeqNumJump(float time_seconds, uint32_t ssrc)
      : time_seconds_(time_seconds), ssrc_(ssrc) {}
  float Time() const { return time_seconds_; }
  std::string ToString() const {
    return std::string("Sequence number jumps on incoming SSRC ") +
           std::to_string(ssrc_);
  }

 private:
  float time_seconds_;

  uint32_t ssrc_;
};

class IncomingCaptureTimeJump {
 public:
  IncomingCaptureTimeJump(float time_seconds, uint32_t ssrc)
      : time_seconds_(time_seconds), ssrc_(ssrc) {}
  float Time() const { return time_seconds_; }
  std::string ToString() const {
    return std::string("Capture timestamp jumps on incoming SSRC ") +
           std::to_string(ssrc_);
  }

 private:
  float time_seconds_;

  uint32_t ssrc_;
};

class OutgoingSeqNoJump {
 public:
  OutgoingSeqNoJump(float time_seconds, uint32_t ssrc)
      : time_seconds_(time_seconds), ssrc_(ssrc) {}
  float Time() const { return time_seconds_; }
  std::string ToString() const {
    return std::string("Sequence number jumps on outgoing SSRC ") +
           std::to_string(ssrc_);
  }

 private:
  float time_seconds_;

  uint32_t ssrc_;
};

class OutgoingCaptureTimeJump {
 public:
  OutgoingCaptureTimeJump(float time_seconds, uint32_t ssrc)
      : time_seconds_(time_seconds), ssrc_(ssrc) {}
  float Time() const { return time_seconds_; }
  std::string ToString() const {
    return std::string("Capture timestamp jumps on outgoing SSRC ") +
           std::to_string(ssrc_);
  }

 private:
  float time_seconds_;

  uint32_t ssrc_;
};

class OutgoingHighLoss {
 public:
  explicit OutgoingHighLoss(double avg_loss_fraction)
      : avg_loss_fraction_(avg_loss_fraction) {}
  std::string ToString() const {
    return std::string("High average loss (") +
           std::to_string(avg_loss_fraction_ * 100) +
           std::string("%) across the call.");
  }

 private:
  double avg_loss_fraction_;
};

}  // namespace webrtc

#endif  // RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_