From f04a6ea7339bb570d3419cf77111b0ce60018c80 Mon Sep 17 00:00:00 2001 From: "fischman@webrtc.org" Date: Tue, 29 Apr 2014 17:53:30 +0000 Subject: [PATCH] MediaCodecVideoEncoder: limit MediaCodec bitrate to 95% of requested to avoid overshoot. BUG=3194 R=noahric@google.com Review URL: https://webrtc-codereview.appspot.com/17379004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6021 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java b/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java index dff334b371..d0acdc4ba8 100644 --- a/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java +++ b/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java @@ -98,7 +98,9 @@ class MediaCodecVideoEncoder { // webrtc "kilo" means 1000, not 1024. Apparently. // (and the price for overshooting is frame-dropping as webrtc enforces its // bandwidth estimation, which is unpleasant). - return kbps * 1000; + // Since the HW encoder in the N5 overshoots, we clamp to a bit less than + // the requested rate. Sad but true. Bug 3194. + return kbps * 950; } private void checkOnMediaCodecThread() {