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

Unified 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: use rtc::TimeMillis 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/video/video_send_stream.cc
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index 3e95cb02956fc8d350703ca617704322fe513ba0..619aaffa87c2f1fe9c30516e52c484252303c525 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -160,6 +160,42 @@ std::string VideoSendStream::Config::ToString() const {
return ss.str();
}
+std::string VideoSendStream::Stats::ToString(int64_t time_ms) const {
+ std::stringstream ss;
+ ss << "VideoSendStream stats:" << time_ms << ",{";
+ ss << "[in_fps:" << input_frame_rate << "],";
+ ss << "[enc_fps:" << encode_frame_rate << "],";
+ ss << "[enc_ms:" << avg_encode_time_ms << "],";
+ ss << "[enc_usage_perc:" << encode_usage_percent << "],";
+ ss << "[target_bps:" << target_media_bitrate_bps << "],";
+ ss << "[media_bps:" << media_bitrate_bps << "],";
+ ss << "[suspended:" << (suspended ? "true" : "false") << "],";
+ ss << "[bw_adapted:" << (bw_limited_resolution ? "true" : "false") << "]";
+ ss << '}';
+ for (const auto& substream : substreams) {
+ ss << " {ssrc:" << substream.first << ",";
+ ss << substream.second.ToString();
+ ss << '}';
+ }
+ return ss.str();
+}
+
+std::string VideoSendStream::StreamStats::ToString() const {
+ std::stringstream ss;
+ ss << "[w:" << width << "],";
+ ss << "[h:" << height << "],";
+ ss << "[key:" << frame_counts.key_frames << "],";
+ ss << "[delta:" << frame_counts.delta_frames << "],";
+ ss << "[tot_bps:" << total_bitrate_bps << "],";
+ ss << "[retransmit_bps:" << retransmit_bitrate_bps << "],";
+ ss << "[avg_delay_ms:" << avg_delay_ms << "],";
+ ss << "[max_delay_ms:" << max_delay_ms << "],";
+ ss << "[nack:" << rtcp_packet_type_counts.nack_packets << "],";
+ ss << "[fir:" << rtcp_packet_type_counts.fir_packets << "],";
+ ss << "[pli:" << rtcp_packet_type_counts.pli_packets << "]";
+ return ss.str();
+}
+
namespace {
VideoCodecType PayloadNameToCodecType(const std::string& payload_name) {

Powered by Google App Engine
This is Rietveld 408576698