Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: webrtc/logging/rtc_event_log/rtc_event_log.h

Issue 2666533002: Add probe logging to RtcEventLog. (Closed)
Patch Set: |min_probes| --> |min_packets| Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 17 matching lines...) Expand all
28 namespace rtclog { 28 namespace rtclog {
29 class EventStream; 29 class EventStream;
30 } // namespace rtclog 30 } // namespace rtclog
31 31
32 class Clock; 32 class Clock;
33 class RtcEventLogImpl; 33 class RtcEventLogImpl;
34 34
35 enum class MediaType; 35 enum class MediaType;
36 36
37 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket }; 37 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket };
38 enum ProbeFailureReason {
39 kInvalidSendReceiveInterval,
40 kInvalidSendReceiveRatio,
41 kTimeout
42 };
38 43
39 class RtcEventLog { 44 class RtcEventLog {
40 public: 45 public:
41 virtual ~RtcEventLog() {} 46 virtual ~RtcEventLog() {}
42 47
43 // Factory method to create an RtcEventLog object. 48 // Factory method to create an RtcEventLog object.
44 static std::unique_ptr<RtcEventLog> Create(); 49 static std::unique_ptr<RtcEventLog> Create();
45 // TODO(nisse): webrtc::Clock is deprecated. Delete this method and 50 // TODO(nisse): webrtc::Clock is deprecated. Delete this method and
46 // above forward declaration of Clock when 51 // above forward declaration of Clock when
47 // webrtc/system_wrappers/include/clock.h is deleted. 52 // webrtc/system_wrappers/include/clock.h is deleted.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 virtual void LogAudioSendStreamConfig( 99 virtual void LogAudioSendStreamConfig(
95 const webrtc::AudioSendStream::Config& config) = 0; 100 const webrtc::AudioSendStream::Config& config) = 0;
96 101
97 // Logs the header of an incoming or outgoing RTP packet. packet_length 102 // Logs the header of an incoming or outgoing RTP packet. packet_length
98 // is the total length of the packet, including both header and payload. 103 // is the total length of the packet, including both header and payload.
99 virtual void LogRtpHeader(PacketDirection direction, 104 virtual void LogRtpHeader(PacketDirection direction,
100 MediaType media_type, 105 MediaType media_type,
101 const uint8_t* header, 106 const uint8_t* header,
102 size_t packet_length) = 0; 107 size_t packet_length) = 0;
103 108
109 // Same as above but used on the sender side to log packets that are part of
110 // a probe cluster.
111 virtual void LogRtpHeader(PacketDirection direction,
112 MediaType media_type,
113 const uint8_t* header,
114 size_t packet_length,
115 int probe_cluster_id) = 0;
116
104 // Logs an incoming or outgoing RTCP packet. 117 // Logs an incoming or outgoing RTCP packet.
105 virtual void LogRtcpPacket(PacketDirection direction, 118 virtual void LogRtcpPacket(PacketDirection direction,
106 MediaType media_type, 119 MediaType media_type,
107 const uint8_t* packet, 120 const uint8_t* packet,
108 size_t length) = 0; 121 size_t length) = 0;
109 122
110 // Logs an audio playout event. 123 // Logs an audio playout event.
111 virtual void LogAudioPlayout(uint32_t ssrc) = 0; 124 virtual void LogAudioPlayout(uint32_t ssrc) = 0;
112 125
113 // Logs a bitrate update from the bandwidth estimator based on packet loss. 126 // Logs a bitrate update from the bandwidth estimator based on packet loss.
114 virtual void LogBwePacketLossEvent(int32_t bitrate, 127 virtual void LogBwePacketLossEvent(int32_t bitrate,
115 uint8_t fraction_loss, 128 uint8_t fraction_loss,
116 int32_t total_packets) = 0; 129 int32_t total_packets) = 0;
117 130
118 // Logs audio encoder re-configuration driven by audio network adaptor. 131 // Logs audio encoder re-configuration driven by audio network adaptor.
119 virtual void LogAudioNetworkAdaptation( 132 virtual void LogAudioNetworkAdaptation(
120 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) = 0; 133 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) = 0;
121 134
135 // Logs when a probe cluster is created.
136 virtual void LogProbeClusterCreated(int id,
137 int bitrate_bps,
138 int min_probes,
terelius 2017/02/20 14:00:31 probes -> packets
139 int min_bytes) = 0;
140
141 // Logs the result of a successful probing attempt.
142 virtual void LogProbeResultSuccess(int id, int bitrate_bps) = 0;
143
144 // Logs the result of an unsuccessful probing attempt.
145 virtual void LogProbeResultFailure(int id,
146 ProbeFailureReason failure_reason) = 0;
147
122 // Reads an RtcEventLog file and returns true when reading was successful. 148 // Reads an RtcEventLog file and returns true when reading was successful.
123 // The result is stored in the given EventStream object. 149 // The result is stored in the given EventStream object.
124 // The order of the events in the EventStream is implementation defined. 150 // The order of the events in the EventStream is implementation defined.
125 // The current implementation writes a LOG_START event, then the old 151 // The current implementation writes a LOG_START event, then the old
126 // configurations, then the remaining events in timestamp order and finally 152 // configurations, then the remaining events in timestamp order and finally
127 // a LOG_END event. However, this might change without further notice. 153 // a LOG_END event. However, this might change without further notice.
128 // TODO(terelius): Change result type to a vector? 154 // TODO(terelius): Change result type to a vector?
129 static bool ParseRtcEventLog(const std::string& file_name, 155 static bool ParseRtcEventLog(const std::string& file_name,
130 rtclog::EventStream* result); 156 rtclog::EventStream* result);
131 }; 157 };
(...skipping 13 matching lines...) Expand all
145 void LogVideoSendStreamConfig( 171 void LogVideoSendStreamConfig(
146 const VideoSendStream::Config& config) override {} 172 const VideoSendStream::Config& config) override {}
147 void LogAudioReceiveStreamConfig( 173 void LogAudioReceiveStreamConfig(
148 const AudioReceiveStream::Config& config) override {} 174 const AudioReceiveStream::Config& config) override {}
149 void LogAudioSendStreamConfig( 175 void LogAudioSendStreamConfig(
150 const AudioSendStream::Config& config) override {} 176 const AudioSendStream::Config& config) override {}
151 void LogRtpHeader(PacketDirection direction, 177 void LogRtpHeader(PacketDirection direction,
152 MediaType media_type, 178 MediaType media_type,
153 const uint8_t* header, 179 const uint8_t* header,
154 size_t packet_length) override {} 180 size_t packet_length) override {}
181 void LogRtpHeader(PacketDirection direction,
182 MediaType media_type,
183 const uint8_t* header,
184 size_t packet_length,
185 int probe_cluster_id) override {}
155 void LogRtcpPacket(PacketDirection direction, 186 void LogRtcpPacket(PacketDirection direction,
156 MediaType media_type, 187 MediaType media_type,
157 const uint8_t* packet, 188 const uint8_t* packet,
158 size_t length) override {} 189 size_t length) override {}
159 void LogAudioPlayout(uint32_t ssrc) override {} 190 void LogAudioPlayout(uint32_t ssrc) override {}
160 void LogBwePacketLossEvent(int32_t bitrate, 191 void LogBwePacketLossEvent(int32_t bitrate,
161 uint8_t fraction_loss, 192 uint8_t fraction_loss,
162 int32_t total_packets) override {} 193 int32_t total_packets) override {}
163 void LogAudioNetworkAdaptation( 194 void LogAudioNetworkAdaptation(
164 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) override{}; 195 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) override{};
196 void LogProbeClusterCreated(int id,
197 int bitrate_bps,
198 int min_probes,
terelius 2017/02/20 14:00:31 probes -> packets
199 int min_bytes) override{};
200 void LogProbeResultSuccess(int id, int bitrate_bps) override{};
201 void LogProbeResultFailure(int id,
202 ProbeFailureReason failure_reason) override{};
165 }; 203 };
166 204
167 } // namespace webrtc 205 } // namespace webrtc
168 206
169 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_H_ 207 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698