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

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: rebase, address comments Created 4 years, 5 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 ss << " {ssrc:" << substream.first << ", ";
179 ss << substream.second.ToString();
180 ss << '}';
181 }
182 return ss.str();
183 }
184
185 std::string VideoSendStream::StreamStats::ToString() const {
186 std::stringstream ss;
187 ss << "width:" << width << ", ";
188 ss << "height:" << height << ", ";
189 ss << "key:" << frame_counts.key_frames << ", ";
190 ss << "delta:" << frame_counts.delta_frames << ", ";
191 ss << "total_bps:" << total_bitrate_bps << ", ";
192 ss << "retransmit_bps:" << retransmit_bitrate_bps << ", ";
193 ss << "avg_delay_ms:" << avg_delay_ms << ", ";
194 ss << "max_delay_ms:" << max_delay_ms << ", ";
195 ss << "nack:" << rtcp_packet_type_counts.nack_packets << ", ";
196 ss << "fir:" << rtcp_packet_type_counts.fir_packets << ", ";
197 ss << "pli:" << rtcp_packet_type_counts.pli_packets;
198 return ss.str();
199 }
200
165 namespace { 201 namespace {
166 202
167 VideoCodecType PayloadNameToCodecType(const std::string& payload_name) { 203 VideoCodecType PayloadNameToCodecType(const std::string& payload_name) {
168 if (payload_name == "VP8") 204 if (payload_name == "VP8")
169 return kVideoCodecVP8; 205 return kVideoCodecVP8;
170 if (payload_name == "VP9") 206 if (payload_name == "VP9")
171 return kVideoCodecVP9; 207 return kVideoCodecVP9;
172 if (payload_name == "H264") 208 if (payload_name == "H264")
173 return kVideoCodecH264; 209 return kVideoCodecH264;
174 return kVideoCodecGeneric; 210 return kVideoCodecGeneric;
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 &module_nack_rate); 966 &module_nack_rate);
931 *sent_video_rate_bps += module_video_rate; 967 *sent_video_rate_bps += module_video_rate;
932 *sent_nack_rate_bps += module_nack_rate; 968 *sent_nack_rate_bps += module_nack_rate;
933 *sent_fec_rate_bps += module_fec_rate; 969 *sent_fec_rate_bps += module_fec_rate;
934 } 970 }
935 return 0; 971 return 0;
936 } 972 }
937 973
938 } // namespace internal 974 } // namespace internal
939 } // namespace webrtc 975 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698