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

Unified Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2254893009: Add histogram for percentage of incoming frames that are limited in resolution due to cpu (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: address comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine2.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
index 4a72ef61398a73eacad9667ad0633586dbdda6d6..be8eb85ac7e037ff41b636d58cf61c23b4f5532a 100644
--- a/webrtc/media/engine/webrtcvideoengine2.cc
+++ b/webrtc/media/engine/webrtcvideoengine2.cc
@@ -31,6 +31,7 @@
#include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h"
#include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
#include "webrtc/system_wrappers/include/field_trial.h"
+#include "webrtc/system_wrappers/include/metrics.h"
#include "webrtc/video_decoder.h"
#include "webrtc/video_encoder.h"
@@ -1576,6 +1577,8 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::WebRtcVideoSendStream(
call_(call),
cpu_restricted_counter_(0),
number_of_cpu_adapt_changes_(0),
+ frame_count_(0),
+ cpu_restricted_frame_count_(0),
source_(nullptr),
external_encoder_factory_(external_encoder_factory),
stream_(nullptr),
@@ -1621,6 +1624,16 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::~WebRtcVideoSendStream() {
call_->DestroyVideoSendStream(stream_);
}
DestroyVideoEncoder(&allocated_encoder_);
+ UpdateHistograms();
+}
+
+void WebRtcVideoChannel2::WebRtcVideoSendStream::UpdateHistograms() const {
+ const int kMinRequiredFrames = 200;
+ if (frame_count_ > kMinRequiredFrames) {
+ RTC_LOGGED_HISTOGRAM_PERCENTAGE(
+ "WebRTC.Video.CpuLimitedResolutionInPercent",
+ cpu_restricted_frame_count_ * 100 / frame_count_);
+ }
}
void WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame(
@@ -1675,6 +1688,10 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame(
return;
}
+ ++frame_count_;
+ if (cpu_restricted_counter_ > 0)
+ ++cpu_restricted_frame_count_;
+
stream_->Input()->IncomingCapturedFrame(video_frame);
}
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698