Index: webrtc/logging/rtc_event_log/encoder/rtc_event_log_encoder.h |
diff --git a/webrtc/logging/rtc_event_log/encoder/rtc_event_log_encoder.h b/webrtc/logging/rtc_event_log/encoder/rtc_event_log_encoder.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f7ff486d7325ddc482e4c5662f8b3680aa15a53d |
--- /dev/null |
+++ b/webrtc/logging/rtc_event_log/encoder/rtc_event_log_encoder.h |
@@ -0,0 +1,115 @@ |
+/* |
+ * Copyright (c) 2015 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 WEBRTC_LOGGING_RTC_EVENT_LOG_ENCODER_RTC_EVENT_LOG_ENCODER_H_ |
+#define WEBRTC_LOGGING_RTC_EVENT_LOG_ENCODER_RTC_EVENT_LOG_ENCODER_H_ |
+ |
+#include <memory> |
+#include <string> |
+#include <vector> |
+ |
+#include "webrtc/api/array_view.h" |
+#include "webrtc/api/rtpparameters.h" |
+#include "webrtc/common_types.h" |
+#include "webrtc/rtc_base/platform_file.h" |
+ |
+namespace webrtc { |
+ |
+// Forward declaration of storage class that is automatically generated from |
+// the protobuf file. |
+namespace rtclog { |
+class EventStream; |
+ |
+struct StreamConfig { |
+ uint32_t local_ssrc = 0; |
+ uint32_t remote_ssrc = 0; |
+ uint32_t rtx_ssrc = 0; |
+ std::string rsid; |
+ |
+ bool remb = false; |
+ std::vector<RtpExtension> rtp_extensions; |
+ |
+ RtcpMode rtcp_mode = RtcpMode::kReducedSize; |
+ |
+ struct Codec { |
+ Codec(const std::string& payload_name, |
+ int payload_type, |
+ int rtx_payload_type) |
+ : payload_name(payload_name), |
+ payload_type(payload_type), |
+ rtx_payload_type(rtx_payload_type) {} |
+ |
+ std::string payload_name; |
+ int payload_type; |
+ int rtx_payload_type; |
+ }; |
+ std::vector<Codec> codecs; |
+}; |
+ |
+} // namespace rtclog |
+ |
+struct AudioEncoderRuntimeConfig; |
+class RtpPacketReceived; |
+class RtpPacketToSend; |
+enum class BandwidthUsage; |
+ |
+enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket }; |
+ |
+enum ProbeFailureReason { |
+ kInvalidSendReceiveInterval, |
+ kInvalidSendReceiveRatio, |
+ kTimeout |
+}; |
+ |
+class RtcEventLogEncoder { |
+ public: |
+ virtual ~RtcEventLogEncoder() = default; |
+ |
+ virtual void LoggingStart() = 0; |
+ virtual void LoggingStopped() = 0; |
+ virtual void VideoReceiveStreamConfig(const rtclog::StreamConfig& config) = 0; |
+ virtual void VideoSendStreamConfig(const rtclog::StreamConfig& config) = 0; |
+ virtual void AudioReceiveStreamConfig(const rtclog::StreamConfig& config) = 0; |
+ virtual void AudioSendStreamConfig(const rtclog::StreamConfig& config) = 0; |
+ virtual void RtpHeader(PacketDirection direction, |
+ const uint8_t* header, |
+ size_t packet_length) = 0; |
+ virtual void RtpHeader(PacketDirection direction, |
+ const uint8_t* header, |
+ size_t packet_length, |
+ int probe_cluster_id) = 0; |
+ virtual void IncomingRtpHeader(const RtpPacketReceived& packet) = 0; |
+ virtual void OutgoingRtpHeader(const RtpPacketToSend& packet, |
+ int probe_cluster_id) = 0; |
+ virtual void RtcpPacket(PacketDirection direction, |
+ const uint8_t* packet, |
+ size_t length) = 0; |
+ virtual void IncomingRtcpPacket(rtc::ArrayView<const uint8_t> packet) = 0; |
+ virtual void OutgoingRtcpPacket(rtc::ArrayView<const uint8_t> packet) = 0; |
+ virtual void AudioPlayout(uint32_t ssrc) = 0; |
+ virtual void LossBasedBweUpdate(int32_t bitrate_bps, |
+ uint8_t fraction_loss, |
+ int32_t total_packets) = 0; |
+ virtual void DelayBasedBweUpdate(int32_t bitrate_bps, |
+ BandwidthUsage detector_state) = 0; |
+ virtual void AudioNetworkAdaptation( |
+ const AudioEncoderRuntimeConfig& config) = 0; |
+ virtual void ProbeClusterCreated(int id, |
+ int bitrate_bps, |
+ int min_probes, |
+ int min_bytes) = 0; |
+ virtual void ProbeResultSuccess(int id, int bitrate_bps) = 0; |
+ virtual void ProbeResultFailure(int id, |
+ ProbeFailureReason failure_reason) = 0; |
+}; |
+ |
+} // namespace webrtc |
+ |
+#endif // WEBRTC_LOGGING_RTC_EVENT_LOG_ENCODER_RTC_EVENT_LOG_ENCODER_H_ |