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

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: 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
« no previous file with comments | « webrtc/video/video_receive_stream.cc ('k') | webrtc/video_receive_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 << "cum_loss: " << rtcp_stats.cumulative_lost << ", ";
198 ss << "max_ext_seq: " << rtcp_stats.extended_max_sequence_number << ", ";
199 ss << "nack: " << rtcp_packet_type_counts.nack_packets << ", ";
200 ss << "fir: " << rtcp_packet_type_counts.fir_packets << ", ";
201 ss << "pli: " << rtcp_packet_type_counts.pli_packets;
202 return ss.str();
203 }
204
165 namespace { 205 namespace {
166 206
167 VideoCodecType PayloadNameToCodecType(const std::string& payload_name) { 207 VideoCodecType PayloadNameToCodecType(const std::string& payload_name) {
168 if (payload_name == "VP8") 208 if (payload_name == "VP8")
169 return kVideoCodecVP8; 209 return kVideoCodecVP8;
170 if (payload_name == "VP9") 210 if (payload_name == "VP9")
171 return kVideoCodecVP9; 211 return kVideoCodecVP9;
172 if (payload_name == "H264") 212 if (payload_name == "H264")
173 return kVideoCodecH264; 213 return kVideoCodecH264;
174 return kVideoCodecGeneric; 214 return kVideoCodecGeneric;
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 &module_nack_rate); 970 &module_nack_rate);
931 *sent_video_rate_bps += module_video_rate; 971 *sent_video_rate_bps += module_video_rate;
932 *sent_nack_rate_bps += module_nack_rate; 972 *sent_nack_rate_bps += module_nack_rate;
933 *sent_fec_rate_bps += module_fec_rate; 973 *sent_fec_rate_bps += module_fec_rate;
934 } 974 }
935 return 0; 975 return 0;
936 } 976 }
937 977
938 } // namespace internal 978 } // namespace internal
939 } // namespace webrtc 979 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_receive_stream.cc ('k') | webrtc/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698