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 |
| 26 // superclass, but the *actual* information - rtclog::StreamConfig, etc. - |
| 27 // is kept separate. |
| 28 enum class Type { |
| 29 AudioNetworkAdaptation, |
| 30 AudioPlayout, |
| 31 AudioSendStreamConfig, |
| 32 BweUpdateDelayBased, |
| 33 BweUpdateLossBased, |
| 34 LoggingStarted, |
| 35 LoggingStopped, |
| 36 ProbeClusterCreated, |
| 37 ProbeResultFailure, |
| 38 ProbeResultSuccess, |
| 39 RtcpHeader, |
| 40 RtcpHeaderIncoming, |
| 41 RtcpHeaderOutgoing, |
| 42 RtpHeader, |
| 43 RtpHeaderIncoming, |
| 44 RtpHeaderOutgoing, |
| 45 VideoReceiveStreamConfig, |
| 46 VideoSendStreamConfig |
| 47 }; |
| 48 |
| 49 virtual ~RtcEvent() = default; |
| 50 |
| 51 virtual Type GetType() const = 0; |
| 52 }; |
| 53 |
| 54 } // namespace webrtc |
| 55 |
| 56 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_H_ |
OLD | NEW |