This is a reland of eed5aa8904d09179971d3f4e7e10c109d7c62bfc Original change's description: > Structured ICE logging via RtcEventLog. > > This change list contains the structured logging module for ICE using > the RtcEventLog infrastructure, and also extension to the log parser > and analyzer. > > Bug: None > Change-Id: I6539cf282155c2cde4d3161c53500c0746671a02 > Reviewed-on: https://webrtc-review.googlesource.com/34622 > Commit-Queue: Qingsi Wang <qingsi@google.com> > Reviewed-by: Björn Terelius <terelius@webrtc.org> > Reviewed-by: Peter Thatcher <pthatcher@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#21816} TBR=pthatcher@webrtc.org,terelius@webrtc.org,deadbeef@webrtc.org Bug: None Change-Id: I3df585bf636315ceb0273967146111346a83be86 Reviewed-on: https://webrtc-review.googlesource.com/47545 Commit-Queue: Qingsi Wang <qingsi@google.com> Reviewed-by: Qingsi Wang <qingsi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21881}
66 lines
2.0 KiB
C++
66 lines
2.0 KiB
C++
/*
|
|
* 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 LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_H_
|
|
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_H_
|
|
|
|
#include <typedefs.h>
|
|
|
|
#include "rtc_base/timeutils.h"
|
|
|
|
namespace webrtc {
|
|
|
|
// This class allows us to store unencoded RTC events. Subclasses of this class
|
|
// store the actual information. This allows us to keep all unencoded events,
|
|
// even when their type and associated information differ, in the same buffer.
|
|
// Additionally, it prevents dependency leaking - a module that only logs
|
|
// events of type RtcEvent_A doesn't need to know about anything associated
|
|
// with events of type RtcEvent_B.
|
|
class RtcEvent {
|
|
public:
|
|
// Subclasses of this class have to associate themselves with a unique value
|
|
// of Type. This leaks the information of existing subclasses into the
|
|
// superclass, but the *actual* information - rtclog::StreamConfig, etc. -
|
|
// is kept separate.
|
|
enum class Type {
|
|
AlrStateEvent,
|
|
AudioNetworkAdaptation,
|
|
AudioPlayout,
|
|
AudioReceiveStreamConfig,
|
|
AudioSendStreamConfig,
|
|
BweUpdateDelayBased,
|
|
BweUpdateLossBased,
|
|
IceCandidatePairConfig,
|
|
IceCandidatePairEvent,
|
|
ProbeClusterCreated,
|
|
ProbeResultFailure,
|
|
ProbeResultSuccess,
|
|
RtcpPacketIncoming,
|
|
RtcpPacketOutgoing,
|
|
RtpPacketIncoming,
|
|
RtpPacketOutgoing,
|
|
VideoReceiveStreamConfig,
|
|
VideoSendStreamConfig
|
|
};
|
|
|
|
RtcEvent() : timestamp_us_(rtc::TimeMicros()) {}
|
|
virtual ~RtcEvent() = default;
|
|
|
|
virtual Type GetType() const = 0;
|
|
|
|
virtual bool IsConfigEvent() const = 0;
|
|
|
|
const int64_t timestamp_us_;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_H_
|