Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Add kType for RTCStats to fix GetStatsOfType build error. #642

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions talk/owt/sdk/base/connectionstats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ const char* const RTCStatsType::kRemoteCandidate = "remote-candidate";
const char* const RTCStatsType::kCertificate = "certificate";
const char* const RTCStatsType::kIceServer = "ice-server";

const char* RTCCertificateStats::kType = RTCStatsType::kCertificate;
const char* RTCCodecStats::kType = RTCStatsType::kCodec;
const char* RTCDataChannelStats::kType = RTCStatsType::kDataChannel;
const char* RTCIceCandidatePairStats::kType = RTCStatsType::kCandidatePair;
const char* RTCInboundRTPStreamStats::kType = RTCStatsType::kInboundRTP;
const char* RTCOutboundRTPStreamStats::kType = RTCStatsType::kOutboundRTP;
const char* RTCLocalIceCandidateStats::kType = RTCStatsType::kLocalCandidate;
const char* RTCRemoteIceCandidateStats::kType = RTCStatsType::kRemoteCandidate;
const char* RTCMediaStreamStats::kType = RTCStatsType::kStream;
const char* RTCMediaStreamTrackStats::kType = RTCStatsType::kTrack;
const char* RTCPeerConnectionStats::kType = RTCStatsType::kPeerConnection;
const char* RTCRemoteInboundRtpStreamStats::kType = RTCStatsType::kRemoteInboundRTP;
const char* RTCMediaSourceStats::kType = RTCStatsType::kMediaSource;
const char* RTCTransportStats::kType = RTCStatsType::kTransport;

RTCStatsReport::ConstIterator::ConstIterator(
owt::base::RTCStatsReport* report,
StatsMap::const_iterator it)
Expand Down
14 changes: 14 additions & 0 deletions talk/owt/sdk/include/cpp/owt/base/connectionstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class RTCStatsReport {
*/
class RTCCertificateStats : public RTCStats {
public:
static const char* kType;
RTCCertificateStats(const std::string& id,
int64_t timestamp,
const std::string& fingerprint,
Expand All @@ -235,6 +236,7 @@ class RTCCertificateStats : public RTCStats {
*/
class RTCCodecStats final : public RTCStats {
public:
static const char* kType;
RTCCodecStats(const std::string& id,
int64_t timestamp,
uint32_t payload_type,
Expand All @@ -261,6 +263,7 @@ class RTCCodecStats final : public RTCStats {
*/
class RTCDataChannelStats final : public RTCStats {
public:
static const char* kType;
RTCDataChannelStats(const std::string& id,
int64_t timestamp,
const std::string& label,
Expand Down Expand Up @@ -298,6 +301,7 @@ class RTCDataChannelStats final : public RTCStats {
*/
class RTCIceCandidatePairStats final : public RTCStats {
public:
static const char* kType;
RTCIceCandidatePairStats(const std::string& id,
int64_t timestamp,
const std::string& transport_id,
Expand Down Expand Up @@ -420,6 +424,7 @@ class RTCIceCandidateStats : public RTCStats {
*/
class RTCLocalIceCandidateStats final : RTCIceCandidateStats {
public:
static const char* kType;
RTCLocalIceCandidateStats(const std::string& id,
int64_t timestamp,
const std::string& transport_id,
Expand All @@ -442,6 +447,7 @@ class RTCLocalIceCandidateStats final : RTCIceCandidateStats {
*/
class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats {
public:
static const char* kType;
RTCRemoteIceCandidateStats(const std::string& id,
int64_t timestamp,
const std::string& transport_id,
Expand All @@ -466,6 +472,7 @@ class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats {
// fits to describe the modern RTCPeerConnection model (unified plan).
class RTCMediaStreamStats final : public RTCStats {
public:
static const char* kType;
RTCMediaStreamStats(const std::string& id,
int64_t timestamp,
const std::string& stream_identifier,
Expand All @@ -485,6 +492,7 @@ class RTCMediaStreamStats final : public RTCStats {
// and RTCOutboundRtpStreamStats.
class RTCMediaStreamTrackStats final : public RTCStats {
public:
static const char* kType;
RTCMediaStreamTrackStats(const std::string& id,
int64_t timestamp,
std::string track_identifier,
Expand Down Expand Up @@ -589,6 +597,7 @@ class RTCMediaStreamTrackStats final : public RTCStats {
*/
class RTCPeerConnectionStats final : public RTCStats {
public:
static const char* kType;
RTCPeerConnectionStats(const std::string& id,
int64_t timestamp,
uint32_t data_channels_opened,
Expand Down Expand Up @@ -647,6 +656,7 @@ class RTCRTPStreamStats : public RTCStats {
// TODO: Support the remote case |is_remote = true|.
class RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
public:
static const char* kType;
RTCInboundRTPStreamStats(const std::string& id,
int64_t timestamp,
uint32_t ssrc,
Expand Down Expand Up @@ -732,6 +742,7 @@ class RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
// TODO: Support the remote case |is_remote = true|.
class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
public:
static const char* kType;
RTCOutboundRTPStreamStats(const std::string& id,
int64_t timestamp,
uint32_t ssrc,
Expand Down Expand Up @@ -813,6 +824,7 @@ class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
// reportsReceived & roundTripTimeMeasurements.)
class RTCRemoteInboundRtpStreamStats final : public RTCStats {
public:
static const char* kType;
RTCRemoteInboundRtpStreamStats(const std::string& id,
int64_t timestamp,
uint32_t ssrc,
Expand Down Expand Up @@ -853,6 +865,7 @@ class RTCRemoteInboundRtpStreamStats final : public RTCStats {
*/
class RTCMediaSourceStats : public RTCStats {
public:
static const char* kType;
RTCMediaSourceStats(const std::string& type,
const std::string& id,
int64_t timestamp,
Expand Down Expand Up @@ -913,6 +926,7 @@ class RTCVideoSourceStats final : public RTCMediaSourceStats {
*/
class RTCTransportStats final : public RTCStats {
public:
static const char* kType;
RTCTransportStats(const std::string& id,
int64_t timestamp,
uint64_t bytes_sent,
Expand Down