| 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 API_STATS_RTCSTATS_OBJECTS_H_ |
| 12 | #define API_STATS_RTCSTATS_OBJECTS_H_ |
| 13 |
| 14 | #include <stdint.h> |
| 15 |
| 16 | #include <map> |
| 17 | #include <memory> |
| 18 | #include <string> |
| 19 | #include <vector> |
| 20 |
| 21 | #include "absl/types/optional.h" |
| 22 | #include "api/stats/rtc_stats.h" |
| 23 | #include "rtc_base/system/rtc_export.h" |
| 24 |
| 25 | namespace webrtc { |
| 26 |
| 27 | // https://w3c.github.io/webrtc-stats/#certificatestats-dict* |
| 28 | class RTC_EXPORT RTCCertificateStats final : public RTCStats { |
| 29 | public: |
| 30 | WEBRTC_RTCSTATS_DECL(); |
| 31 | RTCCertificateStats(std::string id, Timestamp timestamp); |
| 32 | ~RTCCertificateStats() override; |
| 33 |
| 34 | absl::optional<std::string> fingerprint; |
| 35 | absl::optional<std::string> fingerprint_algorithm; |
| 36 | absl::optional<std::string> base64_certificate; |
| 37 | absl::optional<std::string> issuer_certificate_id; |
| 38 | }; |
| 39 |
| 40 | // https://w3c.github.io/webrtc-stats/#codec-dict* |
| 41 | class RTC_EXPORT RTCCodecStats final : public RTCStats { |
| 42 | public: |
| 43 | WEBRTC_RTCSTATS_DECL(); |
| 44 | RTCCodecStats(std::string id, Timestamp timestamp); |
| 45 | ~RTCCodecStats() override; |
| 46 |
| 47 | absl::optional<std::string> transport_id; |
| 48 | absl::optional<uint32_t> payload_type; |
| 49 | absl::optional<std::string> mime_type; |
| 50 | absl::optional<uint32_t> clock_rate; |
| 51 | absl::optional<uint32_t> channels; |
| 52 | absl::optional<std::string> sdp_fmtp_line; |
| 53 | }; |
| 54 |
| 55 | // https://w3c.github.io/webrtc-stats/#dcstats-dict* |
| 56 | class RTC_EXPORT RTCDataChannelStats final : public RTCStats { |
| 57 | public: |
| 58 | WEBRTC_RTCSTATS_DECL(); |
| 59 | RTCDataChannelStats(std::string id, Timestamp timestamp); |
| 60 | ~RTCDataChannelStats() override; |
| 61 |
| 62 | absl::optional<std::string> label; |
| 63 | absl::optional<std::string> protocol; |
| 64 | absl::optional<int32_t> data_channel_identifier; |
| 65 | absl::optional<std::string> state; |
| 66 | absl::optional<uint32_t> messages_sent; |
| 67 | absl::optional<uint64_t> bytes_sent; |
| 68 | absl::optional<uint32_t> messages_received; |
| 69 | absl::optional<uint64_t> bytes_received; |
| 70 | }; |
| 71 |
| 72 | // https://w3c.github.io/webrtc-stats/#candidatepair-dict* |
| 73 | class RTC_EXPORT RTCIceCandidatePairStats final : public RTCStats { |
| 74 | public: |
| 75 | WEBRTC_RTCSTATS_DECL(); |
| 76 | RTCIceCandidatePairStats(std::string id, Timestamp timestamp); |
| 77 | ~RTCIceCandidatePairStats() override; |
| 78 |
| 79 | absl::optional<std::string> transport_id; |
| 80 | absl::optional<std::string> local_candidate_id; |
| 81 | absl::optional<std::string> remote_candidate_id; |
| 82 | absl::optional<std::string> state; |
| 83 | // Obsolete: priority |
| 84 | absl::optional<uint64_t> priority; |
| 85 | absl::optional<bool> nominated; |
| 86 | // `writable` does not exist in the spec and old comments suggest it used to |
| 87 | // exist but was incorrectly implemented. |
| 88 | // TODO(https://crbug.com/webrtc/14171): Standardize and/or modify |
| 89 | // implementation. |
| 90 | absl::optional<bool> writable; |
| 91 | absl::optional<uint64_t> packets_sent; |
| 92 | absl::optional<uint64_t> packets_received; |
| 93 | absl::optional<uint64_t> bytes_sent; |
| 94 | absl::optional<uint64_t> bytes_received; |
| 95 | absl::optional<double> total_round_trip_time; |
| 96 | absl::optional<double> current_round_trip_time; |
| 97 | absl::optional<double> available_outgoing_bitrate; |
| 98 | absl::optional<double> available_incoming_bitrate; |
| 99 | absl::optional<uint64_t> requests_received; |
| 100 | absl::optional<uint64_t> requests_sent; |
| 101 | absl::optional<uint64_t> responses_received; |
| 102 | absl::optional<uint64_t> responses_sent; |
| 103 | absl::optional<uint64_t> consent_requests_sent; |
| 104 | absl::optional<uint64_t> packets_discarded_on_send; |
| 105 | absl::optional<uint64_t> bytes_discarded_on_send; |
| 106 | absl::optional<double> last_packet_received_timestamp; |
| 107 | absl::optional<double> last_packet_sent_timestamp; |
| 108 | }; |
| 109 |
| 110 | // https://w3c.github.io/webrtc-stats/#icecandidate-dict* |
| 111 | class RTC_EXPORT RTCIceCandidateStats : public RTCStats { |
| 112 | public: |
| 113 | WEBRTC_RTCSTATS_DECL(); |
| 114 | ~RTCIceCandidateStats() override; |
| 115 |
| 116 | absl::optional<std::string> transport_id; |
| 117 | // Obsolete: is_remote |
| 118 | absl::optional<bool> is_remote; |
| 119 | absl::optional<std::string> network_type; |
| 120 | absl::optional<std::string> ip; |
| 121 | absl::optional<std::string> address; |
| 122 | absl::optional<int32_t> port; |
| 123 | absl::optional<std::string> protocol; |
| 124 | absl::optional<std::string> relay_protocol; |
| 125 | absl::optional<std::string> candidate_type; |
| 126 | absl::optional<int32_t> priority; |
| 127 | absl::optional<std::string> url; |
| 128 | absl::optional<std::string> foundation; |
| 129 | absl::optional<std::string> related_address; |
| 130 | absl::optional<int32_t> related_port; |
| 131 | absl::optional<std::string> username_fragment; |
| 132 | absl::optional<std::string> tcp_type; |
| 133 |
| 134 | // The following metrics are NOT exposed to JavaScript. We should consider |
| 135 | // standardizing or removing them. |
| 136 | absl::optional<bool> vpn; |
| 137 | absl::optional<std::string> network_adapter_type; |
| 138 |
| 139 | protected: |
| 140 | RTCIceCandidateStats(std::string id, Timestamp timestamp, bool is_remote); |
| 141 | }; |
| 142 |
| 143 | // In the spec both local and remote varieties are of type RTCIceCandidateStats. |
| 144 | // But here we define them as subclasses of `RTCIceCandidateStats` because the |
| 145 | // `kType` need to be different ("RTCStatsType type") in the local/remote case. |
| 146 | // https://w3c.github.io/webrtc-stats/#rtcstatstype-str* |
| 147 | // This forces us to have to override copy() and type(). |
| 148 | class RTC_EXPORT RTCLocalIceCandidateStats final : public RTCIceCandidateStats { |
| 149 | public: |
| 150 | static const char kType[]; |
| 151 | RTCLocalIceCandidateStats(std::string id, Timestamp timestamp); |
| 152 | std::unique_ptr<RTCStats> copy() const override; |
| 153 | const char* type() const override; |
| 154 | }; |
| 155 |
| 156 | class RTC_EXPORT RTCRemoteIceCandidateStats final |
| 157 | : public RTCIceCandidateStats { |
| 158 | public: |
| 159 | static const char kType[]; |
| 160 | RTCRemoteIceCandidateStats(std::string id, Timestamp timestamp); |
| 161 | std::unique_ptr<RTCStats> copy() const override; |
| 162 | const char* type() const override; |
| 163 | }; |
| 164 |
| 165 | // https://w3c.github.io/webrtc-stats/#pcstats-dict* |
| 166 | class RTC_EXPORT RTCPeerConnectionStats final : public RTCStats { |
| 167 | public: |
| 168 | WEBRTC_RTCSTATS_DECL(); |
| 169 | RTCPeerConnectionStats(std::string id, Timestamp timestamp); |
| 170 | ~RTCPeerConnectionStats() override; |
| 171 |
| 172 | absl::optional<uint32_t> data_channels_opened; |
| 173 | absl::optional<uint32_t> data_channels_closed; |
| 174 | }; |
| 175 |
| 176 | // https://w3c.github.io/webrtc-stats/#streamstats-dict* |
| 177 | class RTC_EXPORT RTCRtpStreamStats : public RTCStats { |
| 178 | public: |
| 179 | WEBRTC_RTCSTATS_DECL(); |
| 180 | ~RTCRtpStreamStats() override; |
| 181 |
| 182 | absl::optional<uint32_t> ssrc; |
| 183 | absl::optional<std::string> kind; |
| 184 | absl::optional<std::string> transport_id; |
| 185 | absl::optional<std::string> codec_id; |
| 186 |
| 187 | protected: |
| 188 | RTCRtpStreamStats(std::string id, Timestamp timestamp); |
| 189 | }; |
| 190 |
| 191 | // https://www.w3.org/TR/webrtc-stats/#receivedrtpstats-dict* |
| 192 | class RTC_EXPORT RTCReceivedRtpStreamStats : public RTCRtpStreamStats { |
| 193 | public: |
| 194 | WEBRTC_RTCSTATS_DECL(); |
| 195 | ~RTCReceivedRtpStreamStats() override; |
| 196 |
| 197 | absl::optional<double> jitter; |
| 198 | absl::optional<int32_t> packets_lost; // Signed per RFC 3550 |
| 199 |
| 200 | protected: |
| 201 | RTCReceivedRtpStreamStats(std::string id, Timestamp timestamp); |
| 202 | }; |
| 203 |
| 204 | // https://www.w3.org/TR/webrtc-stats/#sentrtpstats-dict* |
| 205 | class RTC_EXPORT RTCSentRtpStreamStats : public RTCRtpStreamStats { |
| 206 | public: |
| 207 | WEBRTC_RTCSTATS_DECL(); |
| 208 | ~RTCSentRtpStreamStats() override; |
| 209 |
| 210 | absl::optional<uint64_t> packets_sent; |
| 211 | absl::optional<uint64_t> bytes_sent; |
| 212 |
| 213 | protected: |
| 214 | RTCSentRtpStreamStats(std::string id, Timestamp timestamp); |
| 215 | }; |
| 216 |
| 217 | // https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict* |
| 218 | class RTC_EXPORT RTCInboundRtpStreamStats final |
| 219 | : public RTCReceivedRtpStreamStats { |
| 220 | public: |
| 221 | WEBRTC_RTCSTATS_DECL(); |
| 222 | RTCInboundRtpStreamStats(std::string id, Timestamp timestamp); |
| 223 | ~RTCInboundRtpStreamStats() override; |
| 224 |
| 225 | absl::optional<std::string> playout_id; |
| 226 | absl::optional<std::string> track_identifier; |
| 227 | absl::optional<std::string> mid; |
| 228 | absl::optional<std::string> remote_id; |
| 229 | absl::optional<uint32_t> packets_received; |
| 230 | absl::optional<uint64_t> packets_discarded; |
| 231 | absl::optional<uint64_t> fec_packets_received; |
| 232 | absl::optional<uint64_t> fec_bytes_received; |
| 233 | absl::optional<uint64_t> fec_packets_discarded; |
| 234 | // Inbound FEC SSRC. Only present if a mechanism like FlexFEC is negotiated. |
| 235 | absl::optional<uint32_t> fec_ssrc; |
| 236 | absl::optional<uint64_t> bytes_received; |
| 237 | absl::optional<uint64_t> header_bytes_received; |
| 238 | // Inbound RTX stats. Only defined when RTX is used and it is therefore |
| 239 | // possible to distinguish retransmissions. |
| 240 | absl::optional<uint64_t> retransmitted_packets_received; |
| 241 | absl::optional<uint64_t> retransmitted_bytes_received; |
| 242 | absl::optional<uint32_t> rtx_ssrc; |
| 243 |
| 244 | absl::optional<double> last_packet_received_timestamp; |
| 245 | absl::optional<double> jitter_buffer_delay; |
| 246 | absl::optional<double> jitter_buffer_target_delay; |
| 247 | absl::optional<double> jitter_buffer_minimum_delay; |
| 248 | absl::optional<uint64_t> jitter_buffer_emitted_count; |
| 249 | absl::optional<uint64_t> total_samples_received; |
| 250 | absl::optional<uint64_t> concealed_samples; |
| 251 | absl::optional<uint64_t> silent_concealed_samples; |
| 252 | absl::optional<uint64_t> concealment_events; |
| 253 | absl::optional<uint64_t> inserted_samples_for_deceleration; |
| 254 | absl::optional<uint64_t> removed_samples_for_acceleration; |
| 255 | absl::optional<double> audio_level; |
| 256 | absl::optional<double> total_audio_energy; |
| 257 | absl::optional<double> total_samples_duration; |
| 258 | // Stats below are only implemented or defined for video. |
| 259 | absl::optional<uint32_t> frames_received; |
| 260 | absl::optional<uint32_t> frame_width; |
| 261 | absl::optional<uint32_t> frame_height; |
| 262 | absl::optional<double> frames_per_second; |
| 263 | absl::optional<uint32_t> frames_decoded; |
| 264 | absl::optional<uint32_t> key_frames_decoded; |
| 265 | absl::optional<uint32_t> frames_dropped; |
| 266 | absl::optional<double> total_decode_time; |
| 267 | absl::optional<double> total_processing_delay; |
| 268 | absl::optional<double> total_assembly_time; |
| 269 | absl::optional<uint32_t> frames_assembled_from_multiple_packets; |
| 270 | // TODO(https://crbug.com/webrtc/15600): Implement framesRendered, which is |
| 271 | // incremented at the same time that totalInterFrameDelay and |
| 272 | // totalSquaredInterFrameDelay is incremented. (Dividing inter-frame delay by |
| 273 | // framesDecoded is slightly wrong.) |
| 274 | // https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-framesrendered |
| 275 | // |
| 276 | // TODO(https://crbug.com/webrtc/15601): Inter-frame, pause and freeze metrics |
| 277 | // all related to when the frame is rendered, but our implementation measures |
| 278 | // at delivery to sink, not at actual render time. When we have an actual |
| 279 | // frame rendered callback, move the calculating of these metrics to there in |
| 280 | // order to make them more accurate. |
| 281 | absl::optional<double> total_inter_frame_delay; |
| 282 | absl::optional<double> total_squared_inter_frame_delay; |
| 283 | absl::optional<uint32_t> pause_count; |
| 284 | absl::optional<double> total_pauses_duration; |
| 285 | absl::optional<uint32_t> freeze_count; |
| 286 | absl::optional<double> total_freezes_duration; |
| 287 | // https://w3c.github.io/webrtc-provisional-stats/#dom-rtcinboundrtpstreamstats-contenttype |
| 288 | absl::optional<std::string> content_type; |
| 289 | // Only populated if audio/video sync is enabled. |
| 290 | // TODO(https://crbug.com/webrtc/14177): Expose even if A/V sync is off? |
| 291 | absl::optional<double> estimated_playout_timestamp; |
| 292 | // Only defined for video. |
| 293 | // In JavaScript, this is only exposed if HW exposure is allowed. |
| 294 | absl::optional<std::string> decoder_implementation; |
| 295 | // FIR and PLI counts are only defined for |kind == "video"|. |
| 296 | absl::optional<uint32_t> fir_count; |
| 297 | absl::optional<uint32_t> pli_count; |
| 298 | absl::optional<uint32_t> nack_count; |
| 299 | absl::optional<uint64_t> qp_sum; |
| 300 | // This is a remnant of the legacy getStats() API. When the "video-timing" |
| 301 | // header extension is used, |
| 302 | // https://webrtc.github.io/webrtc-org/experiments/rtp-hdrext/video-timing/, |
| 303 | // `googTimingFrameInfo` is exposed with the value of |
| 304 | // TimingFrameInfo::ToString(). |
| 305 | // TODO(https://crbug.com/webrtc/14586): Unship or standardize this metric. |
| 306 | absl::optional<std::string> goog_timing_frame_info; |
| 307 | // In JavaScript, this is only exposed if HW exposure is allowed. |
| 308 | absl::optional<bool> power_efficient_decoder; |
| 309 |
| 310 | // The following metrics are NOT exposed to JavaScript. We should consider |
| 311 | // standardizing or removing them. |
| 312 | absl::optional<uint64_t> jitter_buffer_flushes; |
| 313 | absl::optional<uint64_t> delayed_packet_outage_samples; |
| 314 | absl::optional<double> relative_packet_arrival_delay; |
| 315 | absl::optional<uint32_t> interruption_count; |
| 316 | absl::optional<double> total_interruption_duration; |
| 317 | absl::optional<double> min_playout_delay; |
| 318 | }; |
| 319 |
| 320 | // https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict* |
| 321 | class RTC_EXPORT RTCOutboundRtpStreamStats final |
| 322 | : public RTCSentRtpStreamStats { |
| 323 | public: |
| 324 | WEBRTC_RTCSTATS_DECL(); |
| 325 | RTCOutboundRtpStreamStats(std::string id, Timestamp timestamp); |
| 326 | ~RTCOutboundRtpStreamStats() override; |
| 327 |
| 328 | absl::optional<std::string> media_source_id; |
| 329 | absl::optional<std::string> remote_id; |
| 330 | absl::optional<std::string> mid; |
| 331 | absl::optional<std::string> rid; |
| 332 | absl::optional<uint64_t> retransmitted_packets_sent; |
| 333 | absl::optional<uint64_t> header_bytes_sent; |
| 334 | absl::optional<uint64_t> retransmitted_bytes_sent; |
| 335 | absl::optional<double> target_bitrate; |
| 336 | absl::optional<uint32_t> frames_encoded; |
| 337 | absl::optional<uint32_t> key_frames_encoded; |
| 338 | absl::optional<double> total_encode_time; |
| 339 | absl::optional<uint64_t> total_encoded_bytes_target; |
| 340 | absl::optional<uint32_t> frame_width; |
| 341 | absl::optional<uint32_t> frame_height; |
| 342 | absl::optional<double> frames_per_second; |
| 343 | absl::optional<uint32_t> frames_sent; |
| 344 | absl::optional<uint32_t> huge_frames_sent; |
| 345 | absl::optional<double> total_packet_send_delay; |
| 346 | absl::optional<std::string> quality_limitation_reason; |
| 347 | absl::optional<std::map<std::string, double>> quality_limitation_durations; |
| 348 | // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qualitylimitationresolutionchanges |
| 349 | absl::optional<uint32_t> quality_limitation_resolution_changes; |
| 350 | // https://w3c.github.io/webrtc-provisional-stats/#dom-rtcoutboundrtpstreamstats-contenttype |
| 351 | absl::optional<std::string> content_type; |
| 352 | // In JavaScript, this is only exposed if HW exposure is allowed. |
| 353 | // Only implemented for video. |
| 354 | // TODO(https://crbug.com/webrtc/14178): Implement for audio as well. |
| 355 | absl::optional<std::string> encoder_implementation; |
| 356 | // FIR and PLI counts are only defined for |kind == "video"|. |
| 357 | absl::optional<uint32_t> fir_count; |
| 358 | absl::optional<uint32_t> pli_count; |
| 359 | absl::optional<uint32_t> nack_count; |
| 360 | absl::optional<uint64_t> qp_sum; |
| 361 | absl::optional<bool> active; |
| 362 | // In JavaScript, this is only exposed if HW exposure is allowed. |
| 363 | absl::optional<bool> power_efficient_encoder; |
| 364 | absl::optional<std::string> scalability_mode; |
| 365 |
| 366 | // RTX ssrc. Only present if RTX is negotiated. |
| 367 | absl::optional<uint32_t> rtx_ssrc; |
| 368 | }; |
| 369 |
| 370 | // https://w3c.github.io/webrtc-stats/#remoteinboundrtpstats-dict* |
| 371 | class RTC_EXPORT RTCRemoteInboundRtpStreamStats final |
| 372 | : public RTCReceivedRtpStreamStats { |
| 373 | public: |
| 374 | WEBRTC_RTCSTATS_DECL(); |
| 375 | RTCRemoteInboundRtpStreamStats(std::string id, Timestamp timestamp); |
| 376 | ~RTCRemoteInboundRtpStreamStats() override; |
| 377 |
| 378 | absl::optional<std::string> local_id; |
| 379 | absl::optional<double> round_trip_time; |
| 380 | absl::optional<double> fraction_lost; |
| 381 | absl::optional<double> total_round_trip_time; |
| 382 | absl::optional<int32_t> round_trip_time_measurements; |
| 383 | }; |
| 384 |
| 385 | // https://w3c.github.io/webrtc-stats/#remoteoutboundrtpstats-dict* |
| 386 | class RTC_EXPORT RTCRemoteOutboundRtpStreamStats final |
| 387 | : public RTCSentRtpStreamStats { |
| 388 | public: |
| 389 | WEBRTC_RTCSTATS_DECL(); |
| 390 | RTCRemoteOutboundRtpStreamStats(std::string id, Timestamp timestamp); |
| 391 | ~RTCRemoteOutboundRtpStreamStats() override; |
| 392 |
| 393 | absl::optional<std::string> local_id; |
| 394 | absl::optional<double> remote_timestamp; |
| 395 | absl::optional<uint64_t> reports_sent; |
| 396 | absl::optional<double> round_trip_time; |
| 397 | absl::optional<uint64_t> round_trip_time_measurements; |
| 398 | absl::optional<double> total_round_trip_time; |
| 399 | }; |
| 400 |
| 401 | // https://w3c.github.io/webrtc-stats/#dom-rtcmediasourcestats |
| 402 | class RTC_EXPORT RTCMediaSourceStats : public RTCStats { |
| 403 | public: |
| 404 | WEBRTC_RTCSTATS_DECL(); |
| 405 | ~RTCMediaSourceStats() override; |
| 406 |
| 407 | absl::optional<std::string> track_identifier; |
| 408 | absl::optional<std::string> kind; |
| 409 |
| 410 | protected: |
| 411 | RTCMediaSourceStats(std::string id, Timestamp timestamp); |
| 412 | }; |
| 413 |
| 414 | // https://w3c.github.io/webrtc-stats/#dom-rtcaudiosourcestats |
| 415 | class RTC_EXPORT RTCAudioSourceStats final : public RTCMediaSourceStats { |
| 416 | public: |
| 417 | WEBRTC_RTCSTATS_DECL(); |
| 418 | RTCAudioSourceStats(std::string id, Timestamp timestamp); |
| 419 | ~RTCAudioSourceStats() override; |
| 420 |
| 421 | absl::optional<double> audio_level; |
| 422 | absl::optional<double> total_audio_energy; |
| 423 | absl::optional<double> total_samples_duration; |
| 424 | absl::optional<double> echo_return_loss; |
| 425 | absl::optional<double> echo_return_loss_enhancement; |
| 426 | }; |
| 427 |
| 428 | // https://w3c.github.io/webrtc-stats/#dom-rtcvideosourcestats |
| 429 | class RTC_EXPORT RTCVideoSourceStats final : public RTCMediaSourceStats { |
| 430 | public: |
| 431 | WEBRTC_RTCSTATS_DECL(); |
| 432 | RTCVideoSourceStats(std::string id, Timestamp timestamp); |
| 433 | ~RTCVideoSourceStats() override; |
| 434 |
| 435 | absl::optional<uint32_t> width; |
| 436 | absl::optional<uint32_t> height; |
| 437 | absl::optional<uint32_t> frames; |
| 438 | absl::optional<double> frames_per_second; |
| 439 | }; |
| 440 |
| 441 | // https://w3c.github.io/webrtc-stats/#transportstats-dict* |
| 442 | class RTC_EXPORT RTCTransportStats final : public RTCStats { |
| 443 | public: |
| 444 | WEBRTC_RTCSTATS_DECL(); |
| 445 | RTCTransportStats(std::string id, Timestamp timestamp); |
| 446 | ~RTCTransportStats() override; |
| 447 |
| 448 | absl::optional<uint64_t> bytes_sent; |
| 449 | absl::optional<uint64_t> packets_sent; |
| 450 | absl::optional<uint64_t> bytes_received; |
| 451 | absl::optional<uint64_t> packets_received; |
| 452 | absl::optional<std::string> rtcp_transport_stats_id; |
| 453 | absl::optional<std::string> dtls_state; |
| 454 | absl::optional<std::string> selected_candidate_pair_id; |
| 455 | absl::optional<std::string> local_certificate_id; |
| 456 | absl::optional<std::string> remote_certificate_id; |
| 457 | absl::optional<std::string> tls_version; |
| 458 | absl::optional<std::string> dtls_cipher; |
| 459 | absl::optional<std::string> dtls_role; |
| 460 | absl::optional<std::string> srtp_cipher; |
| 461 | absl::optional<uint32_t> selected_candidate_pair_changes; |
| 462 | absl::optional<std::string> ice_role; |
| 463 | absl::optional<std::string> ice_local_username_fragment; |
| 464 | absl::optional<std::string> ice_state; |
| 465 | }; |
| 466 |
| 467 | // https://w3c.github.io/webrtc-stats/#playoutstats-dict* |
| 468 | class RTC_EXPORT RTCAudioPlayoutStats final : public RTCStats { |
| 469 | public: |
| 470 | WEBRTC_RTCSTATS_DECL(); |
| 471 | RTCAudioPlayoutStats(const std::string& id, Timestamp timestamp); |
| 472 | ~RTCAudioPlayoutStats() override; |
| 473 |
| 474 | absl::optional<std::string> kind; |
| 475 | absl::optional<double> synthesized_samples_duration; |
| 476 | absl::optional<uint64_t> synthesized_samples_events; |
| 477 | absl::optional<double> total_samples_duration; |
| 478 | absl::optional<double> total_playout_delay; |
| 479 | absl::optional<uint64_t> total_samples_count; |
| 480 | }; |
| 481 |
| 482 | } // namespace webrtc |
| 483 |
| 484 | #endif // API_STATS_RTCSTATS_OBJECTS_H_ |
| 485 |