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

Side by Side Diff: webrtc/video/video_send_stream.cc

Issue 2133073002: Add periodic logging of video stats. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: add logging of stats for receive streams Created 4 years, 4 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 ss << ", local_renderer: " 155 ss << ", local_renderer: "
156 << (local_renderer ? "(VideoRenderer)" : "nullptr"); 156 << (local_renderer ? "(VideoRenderer)" : "nullptr");
157 ss << ", render_delay_ms: " << render_delay_ms; 157 ss << ", render_delay_ms: " << render_delay_ms;
158 ss << ", target_delay_ms: " << target_delay_ms; 158 ss << ", target_delay_ms: " << target_delay_ms;
159 ss << ", suspend_below_min_bitrate: " << (suspend_below_min_bitrate ? "on" 159 ss << ", suspend_below_min_bitrate: " << (suspend_below_min_bitrate ? "on"
160 : "off"); 160 : "off");
161 ss << '}'; 161 ss << '}';
162 return ss.str(); 162 return ss.str();
163 } 163 }
164 164
165 std::string VideoSendStream::Stats::ToString(int64_t time_ms) const {
166 std::stringstream ss;
167 ss << "VideoSendStream stats: " << time_ms << ", {";
168 ss << "input_fps: " << input_frame_rate << ", ";
169 ss << "encode_fps: " << encode_frame_rate << ", ";
170 ss << "encode_ms: " << avg_encode_time_ms << ", ";
171 ss << "encode_usage_perc: " << encode_usage_percent << ", ";
172 ss << "target_bps: " << target_media_bitrate_bps << ", ";
173 ss << "media_bps: " << media_bitrate_bps << ", ";
174 ss << "suspended: " << (suspended ? "true" : "false") << ", ";
175 ss << "bw_adapted: " << (bw_limited_resolution ? "true" : "false");
176 ss << '}';
177 for (const auto& substream : substreams) {
178 if (!substream.second.is_rtx) {
179 ss << " {ssrc: " << substream.first << ", ";
180 ss << substream.second.ToString();
181 ss << '}';
182 }
183 }
184 return ss.str();
185 }
186
187 std::string VideoSendStream::StreamStats::ToString() const {
188 std::stringstream ss;
189 ss << "width: " << width << ", ";
190 ss << "height: " << height << ", ";
191 ss << "key: " << frame_counts.key_frames << ", ";
192 ss << "delta: " << frame_counts.delta_frames << ", ";
193 ss << "total_bps: " << total_bitrate_bps << ", ";
194 ss << "retransmit_bps: " << retransmit_bitrate_bps << ", ";
195 ss << "avg_delay_ms: " << avg_delay_ms << ", ";
196 ss << "max_delay_ms: " << max_delay_ms << ", ";
197 ss << "nack: " << rtcp_packet_type_counts.nack_packets << ", ";
198 ss << "fir: " << rtcp_packet_type_counts.fir_packets << ", ";
199 ss << "pli: " << rtcp_packet_type_counts.pli_packets;
200 return ss.str();
201 }
202
165 namespace { 203 namespace {
166 204
167 VideoCodecType PayloadNameToCodecType(const std::string& payload_name) { 205 VideoCodecType PayloadNameToCodecType(const std::string& payload_name) {
168 if (payload_name == "VP8") 206 if (payload_name == "VP8")
169 return kVideoCodecVP8; 207 return kVideoCodecVP8;
170 if (payload_name == "VP9") 208 if (payload_name == "VP9")
171 return kVideoCodecVP9; 209 return kVideoCodecVP9;
172 if (payload_name == "H264") 210 if (payload_name == "H264")
173 return kVideoCodecH264; 211 return kVideoCodecH264;
174 return kVideoCodecGeneric; 212 return kVideoCodecGeneric;
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 &module_nack_rate); 968 &module_nack_rate);
931 *sent_video_rate_bps += module_video_rate; 969 *sent_video_rate_bps += module_video_rate;
932 *sent_nack_rate_bps += module_nack_rate; 970 *sent_nack_rate_bps += module_nack_rate;
933 *sent_fec_rate_bps += module_fec_rate; 971 *sent_fec_rate_bps += module_fec_rate;
934 } 972 }
935 return 0; 973 return 0;
936 } 974 }
937 975
938 } // namespace internal 976 } // namespace internal
939 } // namespace webrtc 977 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698