From 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:47:29 +0200 Subject: Adding upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/api/stats/rtcstats_objects.h | 722 +++++++++++++++++++++ 1 file changed, 722 insertions(+) create mode 100644 third_party/libwebrtc/api/stats/rtcstats_objects.h (limited to 'third_party/libwebrtc/api/stats/rtcstats_objects.h') diff --git a/third_party/libwebrtc/api/stats/rtcstats_objects.h b/third_party/libwebrtc/api/stats/rtcstats_objects.h new file mode 100644 index 0000000000..e5de2100bb --- /dev/null +++ b/third_party/libwebrtc/api/stats/rtcstats_objects.h @@ -0,0 +1,722 @@ +/* + * Copyright 2016 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 API_STATS_RTCSTATS_OBJECTS_H_ +#define API_STATS_RTCSTATS_OBJECTS_H_ + +#include + +#include +#include +#include +#include + +#include "api/stats/rtc_stats.h" +#include "rtc_base/system/rtc_export.h" + +namespace webrtc { + +// https://w3c.github.io/webrtc-pc/#idl-def-rtcdatachannelstate +struct RTCDataChannelState { + static const char* const kConnecting; + static const char* const kOpen; + static const char* const kClosing; + static const char* const kClosed; +}; + +// https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate +struct RTCStatsIceCandidatePairState { + static const char* const kFrozen; + static const char* const kWaiting; + static const char* const kInProgress; + static const char* const kFailed; + static const char* const kSucceeded; +}; + +// https://w3c.github.io/webrtc-pc/#rtcicecandidatetype-enum +struct RTCIceCandidateType { + static const char* const kHost; + static const char* const kSrflx; + static const char* const kPrflx; + static const char* const kRelay; +}; + +// https://w3c.github.io/webrtc-pc/#idl-def-rtcdtlstransportstate +struct RTCDtlsTransportState { + static const char* const kNew; + static const char* const kConnecting; + static const char* const kConnected; + static const char* const kClosed; + static const char* const kFailed; +}; + +// `RTCMediaStreamTrackStats::kind` is not an enum in the spec but the only +// valid values are "audio" and "video". +// https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-kind +struct RTCMediaStreamTrackKind { + static const char* const kAudio; + static const char* const kVideo; +}; + +// https://w3c.github.io/webrtc-stats/#dom-rtcnetworktype +struct RTCNetworkType { + static const char* const kBluetooth; + static const char* const kCellular; + static const char* const kEthernet; + static const char* const kWifi; + static const char* const kWimax; + static const char* const kVpn; + static const char* const kUnknown; +}; + +// https://w3c.github.io/webrtc-stats/#dom-rtcqualitylimitationreason +struct RTCQualityLimitationReason { + static const char* const kNone; + static const char* const kCpu; + static const char* const kBandwidth; + static const char* const kOther; +}; + +// https://webrtc.org/experiments/rtp-hdrext/video-content-type/ +struct RTCContentType { + static const char* const kUnspecified; + static const char* const kScreenshare; +}; + +// https://w3c.github.io/webrtc-stats/#dom-rtcdtlsrole +struct RTCDtlsRole { + static const char* const kUnknown; + static const char* const kClient; + static const char* const kServer; +}; + +// https://www.w3.org/TR/webrtc/#rtcicerole +struct RTCIceRole { + static const char* const kUnknown; + static const char* const kControlled; + static const char* const kControlling; +}; + +// https://www.w3.org/TR/webrtc/#dom-rtcicetransportstate +struct RTCIceTransportState { + static const char* const kNew; + static const char* const kChecking; + static const char* const kConnected; + static const char* const kCompleted; + static const char* const kDisconnected; + static const char* const kFailed; + static const char* const kClosed; +}; + +// https://w3c.github.io/webrtc-stats/#certificatestats-dict* +class RTC_EXPORT RTCCertificateStats final : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCCertificateStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCCertificateStats(std::string id, int64_t timestamp_us); + RTCCertificateStats(const RTCCertificateStats& other); + ~RTCCertificateStats() override; + + RTCStatsMember fingerprint; + RTCStatsMember fingerprint_algorithm; + RTCStatsMember base64_certificate; + RTCStatsMember issuer_certificate_id; +}; + +// Non standard extension mapping to rtc::AdapterType +struct RTCNetworkAdapterType { + static constexpr char kUnknown[] = "unknown"; + static constexpr char kEthernet[] = "ethernet"; + static constexpr char kWifi[] = "wifi"; + static constexpr char kCellular[] = "cellular"; + static constexpr char kLoopback[] = "loopback"; + static constexpr char kAny[] = "any"; + static constexpr char kCellular2g[] = "cellular2g"; + static constexpr char kCellular3g[] = "cellular3g"; + static constexpr char kCellular4g[] = "cellular4g"; + static constexpr char kCellular5g[] = "cellular5g"; +}; + +// https://w3c.github.io/webrtc-stats/#codec-dict* +class RTC_EXPORT RTCCodecStats final : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCCodecStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCCodecStats(std::string id, int64_t timestamp_us); + RTCCodecStats(const RTCCodecStats& other); + ~RTCCodecStats() override; + + RTCStatsMember transport_id; + RTCStatsMember payload_type; + RTCStatsMember mime_type; + RTCStatsMember clock_rate; + RTCStatsMember channels; + RTCStatsMember sdp_fmtp_line; +}; + +// https://w3c.github.io/webrtc-stats/#dcstats-dict* +class RTC_EXPORT RTCDataChannelStats final : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCDataChannelStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCDataChannelStats(std::string id, int64_t timestamp_us); + RTCDataChannelStats(const RTCDataChannelStats& other); + ~RTCDataChannelStats() override; + + RTCStatsMember label; + RTCStatsMember protocol; + RTCStatsMember data_channel_identifier; + // Enum type RTCDataChannelState. + RTCStatsMember state; + RTCStatsMember messages_sent; + RTCStatsMember bytes_sent; + RTCStatsMember messages_received; + RTCStatsMember bytes_received; +}; + +// https://w3c.github.io/webrtc-stats/#candidatepair-dict* +class RTC_EXPORT RTCIceCandidatePairStats final : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCIceCandidatePairStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCIceCandidatePairStats(std::string id, int64_t timestamp_us); + RTCIceCandidatePairStats(const RTCIceCandidatePairStats& other); + ~RTCIceCandidatePairStats() override; + + RTCStatsMember transport_id; + RTCStatsMember local_candidate_id; + RTCStatsMember remote_candidate_id; + // Enum type RTCStatsIceCandidatePairState. + RTCStatsMember state; + // Obsolete: priority + RTCStatsMember priority; + RTCStatsMember nominated; + // `writable` does not exist in the spec and old comments suggest it used to + // exist but was incorrectly implemented. + // TODO(https://crbug.com/webrtc/14171): Standardize and/or modify + // implementation. + RTCStatsMember writable; + RTCStatsMember packets_sent; + RTCStatsMember packets_received; + RTCStatsMember bytes_sent; + RTCStatsMember bytes_received; + RTCStatsMember total_round_trip_time; + RTCStatsMember current_round_trip_time; + RTCStatsMember available_outgoing_bitrate; + RTCStatsMember available_incoming_bitrate; + RTCStatsMember requests_received; + RTCStatsMember requests_sent; + RTCStatsMember responses_received; + RTCStatsMember responses_sent; + RTCStatsMember consent_requests_sent; + RTCStatsMember packets_discarded_on_send; + RTCStatsMember bytes_discarded_on_send; + RTCStatsMember last_packet_received_timestamp; + RTCStatsMember last_packet_sent_timestamp; +}; + +// https://w3c.github.io/webrtc-stats/#icecandidate-dict* +class RTC_EXPORT RTCIceCandidateStats : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCIceCandidateStats(const RTCIceCandidateStats& other); + ~RTCIceCandidateStats() override; + + RTCStatsMember transport_id; + // Obsolete: is_remote + RTCStatsMember is_remote; + RTCStatsMember network_type; + RTCStatsMember ip; + RTCStatsMember address; + RTCStatsMember port; + RTCStatsMember protocol; + RTCStatsMember relay_protocol; + // Enum type RTCIceCandidateType. + RTCStatsMember candidate_type; + RTCStatsMember priority; + RTCStatsMember url; + RTCStatsMember foundation; + RTCStatsMember related_address; + RTCStatsMember related_port; + RTCStatsMember username_fragment; + // Enum type RTCIceTcpCandidateType. + RTCStatsMember tcp_type; + + RTCNonStandardStatsMember vpn; + RTCNonStandardStatsMember network_adapter_type; + + protected: + RTCIceCandidateStats(std::string id, Timestamp timestamp, bool is_remote); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCIceCandidateStats(std::string id, int64_t timestamp_us, bool is_remote); +}; + +// In the spec both local and remote varieties are of type RTCIceCandidateStats. +// But here we define them as subclasses of `RTCIceCandidateStats` because the +// `kType` need to be different ("RTCStatsType type") in the local/remote case. +// https://w3c.github.io/webrtc-stats/#rtcstatstype-str* +// This forces us to have to override copy() and type(). +class RTC_EXPORT RTCLocalIceCandidateStats final : public RTCIceCandidateStats { + public: + static const char kType[]; + RTCLocalIceCandidateStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCLocalIceCandidateStats(std::string id, int64_t timestamp_us); + std::unique_ptr copy() const override; + const char* type() const override; +}; + +class RTC_EXPORT RTCRemoteIceCandidateStats final + : public RTCIceCandidateStats { + public: + static const char kType[]; + RTCRemoteIceCandidateStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCRemoteIceCandidateStats(std::string id, int64_t timestamp_us); + std::unique_ptr copy() const override; + const char* type() const override; +}; + +// TODO(https://crbug.com/webrtc/14419): Delete this class, it's deprecated. +class RTC_EXPORT DEPRECATED_RTCMediaStreamStats final : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + DEPRECATED_RTCMediaStreamStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + DEPRECATED_RTCMediaStreamStats(std::string id, int64_t timestamp_us); + DEPRECATED_RTCMediaStreamStats(const DEPRECATED_RTCMediaStreamStats& other); + ~DEPRECATED_RTCMediaStreamStats() override; + + RTCStatsMember stream_identifier; + RTCStatsMember> track_ids; +}; +using RTCMediaStreamStats [[deprecated("bugs.webrtc.org/14419")]] = + DEPRECATED_RTCMediaStreamStats; + +// TODO(https://crbug.com/webrtc/14175): Delete this class, it's deprecated. +class RTC_EXPORT DEPRECATED_RTCMediaStreamTrackStats final : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + DEPRECATED_RTCMediaStreamTrackStats(std::string id, + Timestamp timestamp, + const char* kind); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + DEPRECATED_RTCMediaStreamTrackStats(std::string id, + int64_t timestamp_us, + const char* kind); + DEPRECATED_RTCMediaStreamTrackStats( + const DEPRECATED_RTCMediaStreamTrackStats& other); + ~DEPRECATED_RTCMediaStreamTrackStats() override; + + RTCStatsMember track_identifier; + RTCStatsMember media_source_id; + RTCStatsMember remote_source; + RTCStatsMember ended; + // TODO(https://crbug.com/webrtc/14173): Remove this obsolete metric. + RTCStatsMember detached; + // Enum type RTCMediaStreamTrackKind. + RTCStatsMember kind; + RTCStatsMember jitter_buffer_delay; + RTCStatsMember jitter_buffer_emitted_count; + // Video-only members + RTCStatsMember frame_width; + RTCStatsMember frame_height; + RTCStatsMember frames_sent; + RTCStatsMember huge_frames_sent; + RTCStatsMember frames_received; + RTCStatsMember frames_decoded; + RTCStatsMember frames_dropped; + // Audio-only members + RTCStatsMember audio_level; // Receive-only + RTCStatsMember total_audio_energy; // Receive-only + RTCStatsMember echo_return_loss; + RTCStatsMember echo_return_loss_enhancement; + RTCStatsMember total_samples_received; + RTCStatsMember total_samples_duration; // Receive-only + RTCStatsMember concealed_samples; + RTCStatsMember silent_concealed_samples; + RTCStatsMember concealment_events; + RTCStatsMember inserted_samples_for_deceleration; + RTCStatsMember removed_samples_for_acceleration; +}; +using RTCMediaStreamTrackStats [[deprecated("bugs.webrtc.org/14175")]] = + DEPRECATED_RTCMediaStreamTrackStats; + +// https://w3c.github.io/webrtc-stats/#pcstats-dict* +class RTC_EXPORT RTCPeerConnectionStats final : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCPeerConnectionStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCPeerConnectionStats(std::string id, int64_t timestamp_us); + RTCPeerConnectionStats(const RTCPeerConnectionStats& other); + ~RTCPeerConnectionStats() override; + + RTCStatsMember data_channels_opened; + RTCStatsMember data_channels_closed; +}; + +// https://w3c.github.io/webrtc-stats/#streamstats-dict* +class RTC_EXPORT RTCRTPStreamStats : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCRTPStreamStats(const RTCRTPStreamStats& other); + ~RTCRTPStreamStats() override; + + RTCStatsMember ssrc; + RTCStatsMember kind; + // Obsolete: track_id + RTCStatsMember track_id; + RTCStatsMember transport_id; + RTCStatsMember codec_id; + + // Obsolete + RTCStatsMember media_type; // renamed to kind. + + protected: + RTCRTPStreamStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCRTPStreamStats(std::string id, int64_t timestamp_us); +}; + +// https://www.w3.org/TR/webrtc-stats/#receivedrtpstats-dict* +class RTC_EXPORT RTCReceivedRtpStreamStats : public RTCRTPStreamStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCReceivedRtpStreamStats(const RTCReceivedRtpStreamStats& other); + ~RTCReceivedRtpStreamStats() override; + + RTCStatsMember jitter; + RTCStatsMember packets_lost; // Signed per RFC 3550 + + protected: + RTCReceivedRtpStreamStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCReceivedRtpStreamStats(std::string id, int64_t timestamp_us); +}; + +// https://www.w3.org/TR/webrtc-stats/#sentrtpstats-dict* +class RTC_EXPORT RTCSentRtpStreamStats : public RTCRTPStreamStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCSentRtpStreamStats(const RTCSentRtpStreamStats& other); + ~RTCSentRtpStreamStats() override; + + RTCStatsMember packets_sent; + RTCStatsMember bytes_sent; + + protected: + RTCSentRtpStreamStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCSentRtpStreamStats(std::string id, int64_t timestamp_us); +}; + +// https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict* +class RTC_EXPORT RTCInboundRTPStreamStats final + : public RTCReceivedRtpStreamStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCInboundRTPStreamStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCInboundRTPStreamStats(std::string id, int64_t timestamp_us); + RTCInboundRTPStreamStats(const RTCInboundRTPStreamStats& other); + ~RTCInboundRTPStreamStats() override; + + // TODO(https://crbug.com/webrtc/14174): Implement trackIdentifier and kind. + + RTCStatsMember playout_id; + RTCStatsMember track_identifier; + RTCStatsMember mid; + RTCStatsMember remote_id; + RTCStatsMember packets_received; + RTCStatsMember packets_discarded; + RTCStatsMember fec_packets_received; + RTCStatsMember fec_packets_discarded; + RTCStatsMember bytes_received; + RTCStatsMember header_bytes_received; + RTCStatsMember last_packet_received_timestamp; + RTCStatsMember jitter_buffer_delay; + RTCStatsMember jitter_buffer_target_delay; + RTCStatsMember jitter_buffer_minimum_delay; + RTCStatsMember jitter_buffer_emitted_count; + RTCStatsMember total_samples_received; + RTCStatsMember concealed_samples; + RTCStatsMember silent_concealed_samples; + RTCStatsMember concealment_events; + RTCStatsMember inserted_samples_for_deceleration; + RTCStatsMember removed_samples_for_acceleration; + RTCStatsMember audio_level; + RTCStatsMember total_audio_energy; + RTCStatsMember total_samples_duration; + // Stats below are only implemented or defined for video. + RTCStatsMember frames_received; + RTCStatsMember frame_width; + RTCStatsMember frame_height; + RTCStatsMember frames_per_second; + RTCStatsMember frames_decoded; + RTCStatsMember key_frames_decoded; + RTCStatsMember frames_dropped; + RTCStatsMember total_decode_time; + RTCStatsMember total_processing_delay; + RTCStatsMember total_assembly_time; + RTCStatsMember frames_assembled_from_multiple_packets; + RTCStatsMember total_inter_frame_delay; + RTCStatsMember total_squared_inter_frame_delay; + RTCStatsMember pause_count; + RTCStatsMember total_pauses_duration; + RTCStatsMember freeze_count; + RTCStatsMember total_freezes_duration; + // https://w3c.github.io/webrtc-provisional-stats/#dom-rtcinboundrtpstreamstats-contenttype + RTCStatsMember content_type; + // Only populated if audio/video sync is enabled. + // TODO(https://crbug.com/webrtc/14177): Expose even if A/V sync is off? + RTCStatsMember estimated_playout_timestamp; + // Only implemented for video. + // TODO(https://crbug.com/webrtc/14178): Also implement for audio. + RTCRestrictedStatsMember + decoder_implementation; + // FIR and PLI counts are only defined for |kind == "video"|. + RTCStatsMember fir_count; + RTCStatsMember pli_count; + RTCStatsMember nack_count; + RTCStatsMember qp_sum; + // This is a remnant of the legacy getStats() API. When the "video-timing" + // header extension is used, + // https://webrtc.github.io/webrtc-org/experiments/rtp-hdrext/video-timing/, + // `googTimingFrameInfo` is exposed with the value of + // TimingFrameInfo::ToString(). + // TODO(https://crbug.com/webrtc/14586): Unship or standardize this metric. + RTCStatsMember goog_timing_frame_info; + RTCRestrictedStatsMember + power_efficient_decoder; + // Non-standard audio metrics. + RTCNonStandardStatsMember jitter_buffer_flushes; + RTCNonStandardStatsMember delayed_packet_outage_samples; + RTCNonStandardStatsMember relative_packet_arrival_delay; + RTCNonStandardStatsMember interruption_count; + RTCNonStandardStatsMember total_interruption_duration; + + // The former googMinPlayoutDelayMs (in seconds). + RTCNonStandardStatsMember min_playout_delay; +}; + +// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict* +class RTC_EXPORT RTCOutboundRTPStreamStats final : public RTCRTPStreamStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCOutboundRTPStreamStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCOutboundRTPStreamStats(std::string id, int64_t timestamp_us); + RTCOutboundRTPStreamStats(const RTCOutboundRTPStreamStats& other); + ~RTCOutboundRTPStreamStats() override; + + RTCStatsMember media_source_id; + RTCStatsMember remote_id; + RTCStatsMember mid; + RTCStatsMember rid; + RTCStatsMember packets_sent; + RTCStatsMember retransmitted_packets_sent; + RTCStatsMember bytes_sent; + RTCStatsMember header_bytes_sent; + RTCStatsMember retransmitted_bytes_sent; + RTCStatsMember target_bitrate; + RTCStatsMember frames_encoded; + RTCStatsMember key_frames_encoded; + RTCStatsMember total_encode_time; + RTCStatsMember total_encoded_bytes_target; + RTCStatsMember frame_width; + RTCStatsMember frame_height; + RTCStatsMember frames_per_second; + RTCStatsMember frames_sent; + RTCStatsMember huge_frames_sent; + RTCStatsMember total_packet_send_delay; + // Enum type RTCQualityLimitationReason + RTCStatsMember quality_limitation_reason; + RTCStatsMember> quality_limitation_durations; + // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qualitylimitationresolutionchanges + RTCStatsMember quality_limitation_resolution_changes; + // https://w3c.github.io/webrtc-provisional-stats/#dom-rtcoutboundrtpstreamstats-contenttype + RTCStatsMember content_type; + // Only implemented for video. + // TODO(https://crbug.com/webrtc/14178): Implement for audio as well. + RTCRestrictedStatsMember + encoder_implementation; + // FIR and PLI counts are only defined for |kind == "video"|. + RTCStatsMember fir_count; + RTCStatsMember pli_count; + RTCStatsMember nack_count; + RTCStatsMember qp_sum; + RTCStatsMember active; + RTCRestrictedStatsMember + power_efficient_encoder; + RTCStatsMember scalability_mode; +}; + +// https://w3c.github.io/webrtc-stats/#remoteinboundrtpstats-dict* +class RTC_EXPORT RTCRemoteInboundRtpStreamStats final + : public RTCReceivedRtpStreamStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCRemoteInboundRtpStreamStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCRemoteInboundRtpStreamStats(std::string id, int64_t timestamp_us); + RTCRemoteInboundRtpStreamStats(const RTCRemoteInboundRtpStreamStats& other); + ~RTCRemoteInboundRtpStreamStats() override; + + RTCStatsMember local_id; + RTCStatsMember round_trip_time; + RTCStatsMember fraction_lost; + RTCStatsMember total_round_trip_time; + RTCStatsMember round_trip_time_measurements; +}; + +// https://w3c.github.io/webrtc-stats/#remoteoutboundrtpstats-dict* +class RTC_EXPORT RTCRemoteOutboundRtpStreamStats final + : public RTCSentRtpStreamStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCRemoteOutboundRtpStreamStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCRemoteOutboundRtpStreamStats(std::string id, int64_t timestamp_us); + RTCRemoteOutboundRtpStreamStats(const RTCRemoteOutboundRtpStreamStats& other); + ~RTCRemoteOutboundRtpStreamStats() override; + + RTCStatsMember local_id; + RTCStatsMember remote_timestamp; + RTCStatsMember reports_sent; + RTCStatsMember round_trip_time; + RTCStatsMember round_trip_time_measurements; + RTCStatsMember total_round_trip_time; +}; + +// https://w3c.github.io/webrtc-stats/#dom-rtcmediasourcestats +class RTC_EXPORT RTCMediaSourceStats : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCMediaSourceStats(const RTCMediaSourceStats& other); + ~RTCMediaSourceStats() override; + + RTCStatsMember track_identifier; + RTCStatsMember kind; + + protected: + RTCMediaSourceStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCMediaSourceStats(std::string id, int64_t timestamp_us); +}; + +// https://w3c.github.io/webrtc-stats/#dom-rtcaudiosourcestats +class RTC_EXPORT RTCAudioSourceStats final : public RTCMediaSourceStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCAudioSourceStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCAudioSourceStats(std::string id, int64_t timestamp_us); + RTCAudioSourceStats(const RTCAudioSourceStats& other); + ~RTCAudioSourceStats() override; + + RTCStatsMember audio_level; + RTCStatsMember total_audio_energy; + RTCStatsMember total_samples_duration; + RTCStatsMember echo_return_loss; + RTCStatsMember echo_return_loss_enhancement; +}; + +// https://w3c.github.io/webrtc-stats/#dom-rtcvideosourcestats +class RTC_EXPORT RTCVideoSourceStats final : public RTCMediaSourceStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCVideoSourceStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCVideoSourceStats(std::string id, int64_t timestamp_us); + RTCVideoSourceStats(const RTCVideoSourceStats& other); + ~RTCVideoSourceStats() override; + + RTCStatsMember width; + RTCStatsMember height; + RTCStatsMember frames; + RTCStatsMember frames_per_second; +}; + +// https://w3c.github.io/webrtc-stats/#transportstats-dict* +class RTC_EXPORT RTCTransportStats final : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCTransportStats(std::string id, Timestamp timestamp); + ABSL_DEPRECATED("Use constructor with Timestamp instead") + RTCTransportStats(std::string id, int64_t timestamp_us); + RTCTransportStats(const RTCTransportStats& other); + ~RTCTransportStats() override; + + RTCStatsMember bytes_sent; + RTCStatsMember packets_sent; + RTCStatsMember bytes_received; + RTCStatsMember packets_received; + RTCStatsMember rtcp_transport_stats_id; + // Enum type RTCDtlsTransportState. + RTCStatsMember dtls_state; + RTCStatsMember selected_candidate_pair_id; + RTCStatsMember local_certificate_id; + RTCStatsMember remote_certificate_id; + RTCStatsMember tls_version; + RTCStatsMember dtls_cipher; + RTCStatsMember dtls_role; + RTCStatsMember srtp_cipher; + RTCStatsMember selected_candidate_pair_changes; + RTCStatsMember ice_role; + RTCStatsMember ice_local_username_fragment; + RTCStatsMember ice_state; +}; + +// https://w3c.github.io/webrtc-stats/#playoutstats-dict* +class RTC_EXPORT RTCAudioPlayoutStats final : public RTCStats { + public: + WEBRTC_RTCSTATS_DECL(); + + RTCAudioPlayoutStats(const std::string& id, Timestamp timestamp); + RTCAudioPlayoutStats(const RTCAudioPlayoutStats& other); + ~RTCAudioPlayoutStats() override; + + RTCStatsMember kind; + RTCStatsMember synthesized_samples_duration; + RTCStatsMember synthesized_samples_events; + RTCStatsMember total_samples_duration; + RTCStatsMember total_playout_delay; + RTCStatsMember total_samples_count; +}; + +} // namespace webrtc + +#endif // API_STATS_RTCSTATS_OBJECTS_H_ -- cgit v1.2.3