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

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: 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..47259e0cab32a3d10921866ebb82a706ea791fef 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),
+ frames_(0),
+ cpu_restricted_frames_(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 (frames_ > kMinRequiredFrames) {
+ RTC_LOGGED_HISTOGRAM_PERCENTAGE(
+ "WebRTC.Video.CpuLimitedResolutionInPercent",
+ cpu_restricted_frames_ * 100 / frames_);
perkj_webrtc 2016/08/22 09:06:42 suggest rename frames_ to frame_count_. Suggest to
åsapersson 2016/08/22 09:41:51 Done.
+ }
}
void WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame(
@@ -1675,6 +1688,10 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame(
return;
}
+ ++frames_;
perkj_webrtc 2016/08/22 09:06:42 frames_ and cpu_restricted_frames_ will be written
åsapersson 2016/08/22 09:41:51 Added guarded_by (and exclusive_lock_required for
+ if (cpu_restricted_counter_ > 0)
perkj_webrtc 2016/08/19 13:14:46 Would it be possible to do this in ViEEncoder inst
åsapersson 2016/08/22 07:56:29 Could it be done in a separate/follow up CL when t
perkj_webrtc 2016/08/22 09:06:42 sure.
+ ++cpu_restricted_frames_;
+
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