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

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

Issue 2666533002: Add probe logging to RtcEventLog. (Closed)
Patch Set: Rebase + format 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 18 matching lines...) Expand all
29 namespace rtclog { 29 namespace rtclog {
30 class EventStream; 30 class EventStream;
31 } // namespace rtclog 31 } // namespace rtclog
32 32
33 class Clock; 33 class Clock;
34 class RtcEventLogImpl; 34 class RtcEventLogImpl;
35 35
36 enum class MediaType; 36 enum class MediaType;
37 37
38 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket }; 38 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket };
39 enum ProbeFailureReason {
40 kInvalidSendReceiveInterval,
41 kInvalidSendReceiveRatio,
42 kTimeout
43 };
39 44
40 class RtcEventLog { 45 class RtcEventLog {
41 public: 46 public:
42 virtual ~RtcEventLog() {} 47 virtual ~RtcEventLog() {}
43 48
44 // Factory method to create an RtcEventLog object. 49 // Factory method to create an RtcEventLog object.
45 static std::unique_ptr<RtcEventLog> Create(); 50 static std::unique_ptr<RtcEventLog> Create();
46 // TODO(nisse): webrtc::Clock is deprecated. Delete this method and 51 // TODO(nisse): webrtc::Clock is deprecated. Delete this method and
47 // above forward declaration of Clock when 52 // above forward declaration of Clock when
48 // webrtc/system_wrappers/include/clock.h is deleted. 53 // webrtc/system_wrappers/include/clock.h is deleted.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 virtual void LogAudioSendStreamConfig( 100 virtual void LogAudioSendStreamConfig(
96 const webrtc::AudioSendStream::Config& config) = 0; 101 const webrtc::AudioSendStream::Config& config) = 0;
97 102
98 // Logs the header of an incoming or outgoing RTP packet. packet_length 103 // Logs the header of an incoming or outgoing RTP packet. packet_length
99 // is the total length of the packet, including both header and payload. 104 // is the total length of the packet, including both header and payload.
100 virtual void LogRtpHeader(PacketDirection direction, 105 virtual void LogRtpHeader(PacketDirection direction,
101 MediaType media_type, 106 MediaType media_type,
102 const uint8_t* header, 107 const uint8_t* header,
103 size_t packet_length) = 0; 108 size_t packet_length) = 0;
104 109
110 // Same as above but used on the sender side to log packets that are part of
111 // a probe cluster.
112 virtual void LogRtpHeader(PacketDirection direction,
113 MediaType media_type,
114 const uint8_t* header,
115 size_t packet_length,
116 int probe_cluster_id) = 0;
117
105 // Logs an incoming or outgoing RTCP packet. 118 // Logs an incoming or outgoing RTCP packet.
106 virtual void LogRtcpPacket(PacketDirection direction, 119 virtual void LogRtcpPacket(PacketDirection direction,
107 MediaType media_type, 120 MediaType media_type,
108 const uint8_t* packet, 121 const uint8_t* packet,
109 size_t length) = 0; 122 size_t length) = 0;
110 123
111 // Logs an audio playout event. 124 // Logs an audio playout event.
112 virtual void LogAudioPlayout(uint32_t ssrc) = 0; 125 virtual void LogAudioPlayout(uint32_t ssrc) = 0;
113 126
114 // Logs a bitrate update from the bandwidth estimator based on packet loss. 127 // Logs a bitrate update from the bandwidth estimator based on packet loss.
115 virtual void LogLossBasedBweUpdate(int32_t bitrate_bps, 128 virtual void LogLossBasedBweUpdate(int32_t bitrate_bps,
116 uint8_t fraction_loss, 129 uint8_t fraction_loss,
117 int32_t total_packets) = 0; 130 int32_t total_packets) = 0;
118 131
119 // Logs a bitrate update from the bandwidth estimator based on delay changes. 132 // Logs a bitrate update from the bandwidth estimator based on delay changes.
120 virtual void LogDelayBasedBweUpdate(int32_t bitrate_bps, 133 virtual void LogDelayBasedBweUpdate(int32_t bitrate_bps,
121 BandwidthUsage detector_state) = 0; 134 BandwidthUsage detector_state) = 0;
122 135
123 // Logs audio encoder re-configuration driven by audio network adaptor. 136 // Logs audio encoder re-configuration driven by audio network adaptor.
124 virtual void LogAudioNetworkAdaptation( 137 virtual void LogAudioNetworkAdaptation(
125 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) = 0; 138 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) = 0;
126 139
140 // Logs when a probe cluster is created.
141 virtual void LogProbeClusterCreated(int id,
142 int bitrate_bps,
143 int min_probes,
144 int min_bytes) = 0;
145
146 // Logs the result of a successful probing attempt.
147 virtual void LogProbeResultSuccess(int id, int bitrate_bps) = 0;
148
149 // Logs the result of an unsuccessful probing attempt.
150 virtual void LogProbeResultFailure(int id,
151 ProbeFailureReason failure_reason) = 0;
152
127 // Reads an RtcEventLog file and returns true when reading was successful. 153 // Reads an RtcEventLog file and returns true when reading was successful.
128 // The result is stored in the given EventStream object. 154 // The result is stored in the given EventStream object.
129 // The order of the events in the EventStream is implementation defined. 155 // The order of the events in the EventStream is implementation defined.
130 // The current implementation writes a LOG_START event, then the old 156 // The current implementation writes a LOG_START event, then the old
131 // configurations, then the remaining events in timestamp order and finally 157 // configurations, then the remaining events in timestamp order and finally
132 // a LOG_END event. However, this might change without further notice. 158 // a LOG_END event. However, this might change without further notice.
133 // TODO(terelius): Change result type to a vector? 159 // TODO(terelius): Change result type to a vector?
134 static bool ParseRtcEventLog(const std::string& file_name, 160 static bool ParseRtcEventLog(const std::string& file_name,
135 rtclog::EventStream* result); 161 rtclog::EventStream* result);
136 }; 162 };
(...skipping 13 matching lines...) Expand all
150 void LogVideoSendStreamConfig( 176 void LogVideoSendStreamConfig(
151 const VideoSendStream::Config& config) override {} 177 const VideoSendStream::Config& config) override {}
152 void LogAudioReceiveStreamConfig( 178 void LogAudioReceiveStreamConfig(
153 const AudioReceiveStream::Config& config) override {} 179 const AudioReceiveStream::Config& config) override {}
154 void LogAudioSendStreamConfig( 180 void LogAudioSendStreamConfig(
155 const AudioSendStream::Config& config) override {} 181 const AudioSendStream::Config& config) override {}
156 void LogRtpHeader(PacketDirection direction, 182 void LogRtpHeader(PacketDirection direction,
157 MediaType media_type, 183 MediaType media_type,
158 const uint8_t* header, 184 const uint8_t* header,
159 size_t packet_length) override {} 185 size_t packet_length) override {}
186 void LogRtpHeader(PacketDirection direction,
187 MediaType media_type,
188 const uint8_t* header,
189 size_t packet_length,
190 int probe_cluster_id) override {}
160 void LogRtcpPacket(PacketDirection direction, 191 void LogRtcpPacket(PacketDirection direction,
161 MediaType media_type, 192 MediaType media_type,
162 const uint8_t* packet, 193 const uint8_t* packet,
163 size_t length) override {} 194 size_t length) override {}
164 void LogAudioPlayout(uint32_t ssrc) override {} 195 void LogAudioPlayout(uint32_t ssrc) override {}
165 void LogLossBasedBweUpdate(int32_t bitrate_bps, 196 void LogLossBasedBweUpdate(int32_t bitrate_bps,
166 uint8_t fraction_loss, 197 uint8_t fraction_loss,
167 int32_t total_packets) override {} 198 int32_t total_packets) override {}
168 void LogDelayBasedBweUpdate(int32_t bitrate_bps, 199 void LogDelayBasedBweUpdate(int32_t bitrate_bps,
169 BandwidthUsage detector_state) override {} 200 BandwidthUsage detector_state) override {}
170 void LogAudioNetworkAdaptation( 201 void LogAudioNetworkAdaptation(
171 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) override {} 202 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) override {}
203 void LogProbeClusterCreated(int id,
204 int bitrate_bps,
205 int min_probes,
206 int min_bytes) override{};
207 void LogProbeResultSuccess(int id, int bitrate_bps) override{};
208 void LogProbeResultFailure(int id,
209 ProbeFailureReason failure_reason) override{};
172 }; 210 };
173 211
174 } // namespace webrtc 212 } // namespace webrtc
175 213
176 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_H_ 214 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_H_
OLDNEW
« no previous file with comments | « webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h ('k') | webrtc/logging/rtc_event_log/rtc_event_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698