Intel® Collaboration Suite for WebRTC  version 4.3.1
Open WebRTC Toolkit (OWT) Client SDK for Windows*
connectionstats.h
1 // Copyright (C) <2018> Intel Corporation
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 #ifndef OWT_BASE_CONNECTIONSTATS_H_
5 #define OWT_BASE_CONNECTIONSTATS_H_
6 #include <chrono>
7 #include <memory>
8 #include <string>
9 #include <vector>
10 #include "owt/base/commontypes.h"
11 #include "owt/base/network.h"
12 namespace owt {
13 namespace base {
16  AudioSenderReport(int64_t bytes_sent, int32_t packets_sent,
17  int32_t packets_lost, int64_t round_trip_time, std::string codec_name)
21  int64_t bytes_sent;
23  int32_t packets_sent;
25  int32_t packets_lost;
27  int64_t round_trip_time;
29  std::string codec_name;
30 };
34  int32_t packets_lost, int32_t estimated_delay, std::string codec_name)
38  int64_t bytes_rcvd;
40  int32_t packets_rcvd;
42  int32_t packets_lost;
44  int32_t estimated_delay;
46  std::string codec_name;
47 };
50  VideoSenderReport(int64_t bytes_sent, int32_t packets_sent, int32_t packets_lost,
51  int32_t fir_count, int32_t pli_count, int32_t nack_count, int32_t sent_frame_height,
52  int32_t sent_frame_width, int32_t framerate_sent, int32_t last_adapt_reason,
53  int32_t adapt_changes, int64_t round_trip_time, std::string codec_name)
55  , fir_count(fir_count), pli_count(pli_count), nack_count(nack_count), frame_resolution_sent(Resolution(sent_frame_width, sent_frame_height))
59  enum class AdaptReason : int32_t {
60  kUnknown = 0,
62  kCpuLimitation = 1,
66  kViewLimitation = 4,
67  };
69  int64_t bytes_sent;
71  int32_t packets_sent;
73  int32_t packets_lost;
75  int32_t fir_count;
77  int32_t pli_count;
79  int32_t nack_count;
83  int32_t framerate_sent;
87  int32_t adapt_changes;
89  int64_t round_trip_time;
91  std::string codec_name;
92 };
95  VideoReceiverReport(int64_t bytes_rcvd, int32_t packets_rcvd, int32_t packets_lost,
96  int32_t fir_count, int32_t pli_count, int32_t nack_count, int32_t rcvd_frame_height,
97  int32_t rcvd_frame_width, int32_t framerate_rcvd, int32_t framerate_output,
98  int32_t delay, std::string codec_name, int32_t jitter)
101  , frame_resolution_rcvd(Resolution(rcvd_frame_width, rcvd_frame_height)), framerate_output(framerate_output)
104  int64_t bytes_rcvd;
106  int32_t packets_rcvd;
108  int32_t packets_lost;
110  int32_t fir_count;
112  int32_t pli_count;
114  int32_t nack_count;
118  int32_t framerate_rcvd;
122  int32_t delay;
124  std::string codec_name;
126  int32_t jitter;
127 };
145 };
148  IceCandidateReport(const std::string& id,
149  const std::string& ip,
150  const uint16_t port,
151  TransportProtocolType protocol,
152  IceCandidateType candidate_type,
153  int32_t priority)
154  : id(id),
155  ip(ip),
156  port(port),
159  priority(priority) {}
160  virtual ~IceCandidateReport() {}
162  std::string id;
164  std::string ip;
166  uint16_t port;
168  TransportProtocolType protocol;
170  IceCandidateType candidate_type;
172  int32_t priority;
173 };
177  const std::string& id,
178  const bool is_active,
179  std::shared_ptr<IceCandidateReport> local_ice_candidate,
180  std::shared_ptr<IceCandidateReport> remote_ice_candidate)
181  : id(id),
186  std::string id;
188  bool is_active;
190  std::shared_ptr<IceCandidateReport> local_ice_candidate;
192  std::shared_ptr<IceCandidateReport> remote_ice_candidate;
193 };
194 typedef std::unique_ptr<AudioSenderReport> AudioSenderReportPtr;
195 typedef std::vector<AudioSenderReportPtr> AudioSenderReports;
196 typedef std::unique_ptr<AudioReceiverReport> AudioReceiverReportPtr;
197 typedef std::vector<AudioReceiverReportPtr> AudioReceiverReports;
198 typedef std::unique_ptr<VideoSenderReport> VideoSenderReportPtr;
199 typedef std::vector<VideoSenderReportPtr> VideoSenderReports;
200 typedef std::unique_ptr<VideoReceiverReport> VideoReceiverReportPtr;
201 typedef std::vector<VideoReceiverReportPtr> VideoReceiverReports;
202 typedef std::shared_ptr<IceCandidateReport> IceCandidateReportPtr;
203 typedef std::vector<IceCandidateReportPtr> IceCandidateReports;
204 typedef std::shared_ptr<IceCandidatePairReport> IceCandidatePairPtr;
205 typedef std::vector<IceCandidatePairPtr> IceCandidatePairReports;
208  ConnectionStats() {}
210  std::chrono::system_clock::time_point time_stamp = std::chrono::system_clock::now();
214  AudioSenderReports audio_sender_reports;
216  AudioReceiverReports audio_receiver_reports;
218  VideoSenderReports video_sender_reports;
220  VideoReceiverReports video_receiver_reports;
222  IceCandidateReports local_ice_candidate_reports;
224  IceCandidateReports remote_ice_candidate_reports;
226  IceCandidatePairReports ice_candidate_pair_reports;
227 };
228 } // namespace base
229 } // namespace owt
230 #endif // OWT_BASE_CONNECTIONSTATS_H_
IceCandidatePairReports ice_candidate_pair_reports
ICE candidate pair reports.
Definition: connectionstats.h:226
IceCandidateType candidate_type
Candidate type.
Definition: connectionstats.h:170
int32_t estimated_delay
Audio delay estimated with unit of millisecond.
Definition: connectionstats.h:44
IceCandidateReports remote_ice_candidate_reports
Remote ICE candidate reports.
Definition: connectionstats.h:224
int32_t target_encoding_bitrate
Target encoding bitrate, unit: bps.
Definition: connectionstats.h:142
Connection statistoms.
Definition: connectionstats.h:207
Define ICE candidate pair report.
Definition: connectionstats.h:175
int32_t actual_encoding_bitrate
Actual encoding bitrate, unit: bps.
Definition: connectionstats.h:144
int32_t delay
Current video delay with unit of millisecond.
Definition: connectionstats.h:122
TransportProtocolType protocol
Transport protocol.
Definition: connectionstats.h:168
int32_t packets_rcvd
Audio packets received.
Definition: connectionstats.h:40
int64_t bytes_rcvd
Audio bytes received.
Definition: connectionstats.h:38
AdaptReason
Define adapt reason.
Definition: connectionstats.h:59
std::shared_ptr< IceCandidateReport > local_ice_candidate
Local candidate of this pair.
Definition: connectionstats.h:190
std::shared_ptr< IceCandidateReport > remote_ice_candidate
Remote candidate of this pair.
Definition: connectionstats.h:192
Resolution frame_resolution_sent
Video frame resolution sent.
Definition: connectionstats.h:81
int32_t packets_lost
Video packets lost during sending.
Definition: connectionstats.h:73
Define ICE candidate report.
Definition: connectionstats.h:147
int32_t jitter
Packet Jitter measured in milliseconds.
Definition: connectionstats.h:126
Define video receiver report.
Definition: connectionstats.h:94
int32_t framerate_output
Video framerate output.
Definition: connectionstats.h:120
int32_t packets_sent
Audio packets sent.
Definition: connectionstats.h:23
int64_t bytes_sent
Audio bytes sent.
Definition: connectionstats.h:21
IceCandidateReports local_ice_candidate_reports
Local ICE candidate reports.
Definition: connectionstats.h:222
std::string codec_name
Audio codec name for sending.
Definition: connectionstats.h:29
std::string ip
The IP address of the candidate.
Definition: connectionstats.h:164
Define video sender report.
Definition: connectionstats.h:49
int64_t bytes_rcvd
Video bytes received.
Definition: connectionstats.h:104
Definition: audioplayerinterface.h:8
int32_t pli_count
Number of PLI sent.
Definition: connectionstats.h:112
int32_t pli_count
Number of PLI received.
Definition: connectionstats.h:77
std::chrono::system_clock::time_point time_stamp
Time stamp of connection statistowt generation.
Definition: connectionstats.h:210
VideoBandwidthStats video_bandwidth_stats
Video bandwidth statistoms.
Definition: connectionstats.h:212
VideoReceiverReports video_receiver_reports
Video receiver reports.
Definition: connectionstats.h:220
int32_t adapt_changes
Video adapt changes.
Definition: connectionstats.h:87
Define audio receiver report.
Definition: connectionstats.h:32
int32_t nack_count
Number of NACK received.
Definition: connectionstats.h:79
int32_t packets_lost
Audio packets lost during sending.
Definition: connectionstats.h:25
int64_t round_trip_time
RTT for video sending with unit of millisecond.
Definition: connectionstats.h:89
VideoSenderReports video_sender_reports
Video sender reports.
Definition: connectionstats.h:218
int32_t fir_count
Number of FIR sent.
Definition: connectionstats.h:110
AudioSenderReports audio_sender_reports
Audio sender reports.
Definition: connectionstats.h:214
std::string codec_name
Audio codec name for receiving.
Definition: connectionstats.h:46
int32_t priority
Calculated as defined in RFC5245.
Definition: connectionstats.h:172
int32_t packets_rcvd
Video packets received.
Definition: connectionstats.h:106
int32_t last_adapt_reason
Video adapt reason.
Definition: connectionstats.h:85
int32_t packets_lost
Video packets lost during receiving.
Definition: connectionstats.h:108
int32_t framerate_sent
Video framerate sent.
Definition: connectionstats.h:83
Resolution frame_resolution_rcvd
Video frame resolution received.
Definition: connectionstats.h:116
uint16_t port
The port number of the candidate.
Definition: connectionstats.h:166
std::string id
The ID of this report.
Definition: connectionstats.h:162
int64_t bytes_sent
Video bytes sent.
Definition: connectionstats.h:69
int32_t transmit_bitrate
Video bitrate of transmit, unit: bps.
Definition: connectionstats.h:138
This class represents a resolution value.
Definition: commontypes.h:40
int32_t framerate_rcvd
Video framerate received.
Definition: connectionstats.h:118
std::string codec_name
Video codec name for receiving.
Definition: connectionstats.h:124
int64_t round_trip_time
RTT for audio sending with unit of millisecond.
Definition: connectionstats.h:27
Define audio sender report.
Definition: connectionstats.h:15
int32_t available_receive_bandwidth
Available video bandwidth for receiving, unit: bps.
Definition: connectionstats.h:136
bool is_active
Indicate whether transport is active.
Definition: connectionstats.h:188
std::string id
The ID of this report.
Definition: connectionstats.h:186
Define video bandwidth statistoms.
Definition: connectionstats.h:129
int32_t fir_count
Number of FIR received.
Definition: connectionstats.h:75
int32_t packets_sent
Video packets sent.
Definition: connectionstats.h:71
int32_t nack_count
Number of PLI sent.
Definition: connectionstats.h:114
std::string codec_name
Video codec name for sending.
Definition: connectionstats.h:91
int32_t retransmit_bitrate
Video bitrate of retransmit, unit: bps.
Definition: connectionstats.h:140
AudioReceiverReports audio_receiver_reports
Audio receiver reports.
Definition: connectionstats.h:216
int32_t available_send_bandwidth
Available video bandwidth for sending, unit: bps.
Definition: connectionstats.h:134
int32_t packets_lost
Audio packets lost during receiving.
Definition: connectionstats.h:42