OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
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 WEBRTC_LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_H_ | |
12 #define WEBRTC_LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_H_ | |
13 | |
14 namespace webrtc { | |
15 | |
16 // This class allows us to store unencoded RTC events. Subclasses of this class | |
17 // store the actual information. This allows us to keep all unencoded events, | |
18 // even when their type and associated information differ, in the same buffer. | |
19 // Additionally, it prevents dependency leaking - a module that only logs | |
20 // events of type RtcEvent_A doesn't need to know about anything associated | |
21 // with events of type RtcEvent_B. | |
22 class RtcEvent { | |
23 public: | |
24 // Subclasses of this class have to associate themselves with a unique | |
25 // of Type. This leaks the information of existing subclasses into the | |
terelius
2017/09/11 09:42:32
"unique of Type"?
eladalon
2017/09/11 15:44:12
Unique value. Thank for catching.
| |
26 // superclass, but the *actual* information - rtclog::StreamConfig, etc. - | |
27 // is kept separate. | |
28 enum class Type { | |
terelius
2017/09/11 09:42:31
I'd prefer to not order these alphabetically, but
eladalon
2017/09/11 15:44:12
If we don't sort alphabetically, these values (and
| |
29 AudioNetworkAdaptation, | |
30 AudioPlayout, | |
31 AudioReceiveStreamConfig, | |
32 AudioSendStreamConfig, | |
33 BweUpdateDelayBased, | |
34 BweUpdateLossBased, | |
35 LoggingStarted, | |
36 LoggingStopped, | |
37 ProbeClusterCreated, | |
38 ProbeResultFailure, | |
39 ProbeResultSuccess, | |
40 RtcpHeaderIncoming, | |
41 RtcpHeaderOutgoing, | |
42 RtpHeaderIncoming, | |
43 RtpHeaderOutgoing, | |
44 VideoReceiveStreamConfig, | |
45 VideoSendStreamConfig | |
46 }; | |
47 | |
48 virtual ~RtcEvent() = default; | |
49 | |
50 virtual Type GetType() const = 0; | |
51 }; | |
52 | |
53 } // namespace webrtc | |
54 | |
55 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_H_ | |
OLD | NEW |