From fa5fdce1009619d4ada99d74d066834fd66d3f40 Mon Sep 17 00:00:00 2001 From: kthelgason Date: Mon, 27 Feb 2017 00:15:31 -0800 Subject: [PATCH] Reland of Set scaling limit at 320 * 180 for all implementations. (patchset #1 id:1 of https://codereview.webrtc.org/2711913007/ ) Reason for revert: Reland after fixing broken perf tests. Original issue's description: > Revert of Set scaling limit at 320 * 180 for all implementations. (patchset #2 id:20001 of https://codereview.webrtc.org/2709153002/ ) > > Reason for revert: > Looks like webrtc_perf_test started failing on linux, mac and windows after this cl landed. > > Example failure: > > https://build.chromium.org/p/client.webrtc.perf/builders/Linux%20Trusty/builds/1386/steps/webrtc_perf_tests/logs/stdio > > [ RUN ] CallPerfTest.ReceivesCpuOveruseAndUnderuse > ../../webrtc/call/call_perf_tests.cc:522: Failure > Value of: Wait() > Actual: false > Expected: true > Timed out before receiving an overuse callback. > [ FAILED ] CallPerfTest.ReceivesCpuOveruseAndUnderuse (120056 ms) > > > Original issue's description: > > Set scaling limit at 320 * 180 for all implementations. > > > > The MediaCodec decoder on android has trouble decoding video at > > so low resolutions. We set the limit a bit higher for all implementations > > pending a robust software fallback implementation for MediaCodec. > > > > BUG=webrtc:7206 > > > > Review-Url: https://codereview.webrtc.org/2709153002 > > Cr-Commit-Position: refs/heads/master@{#16798} > > Committed: https://chromium.googlesource.com/external/webrtc/+/560ddb7321f2ae42ff1eb4c79d7c65d59f61dfe2 > > TBR=magjed@webrtc.org,sprang@webrtc.org,kthelgason@webrtc.org > # Not skipping CQ checks because original CL landed more than 1 days ago. > BUG=webrtc:7206 > > Review-Url: https://codereview.webrtc.org/2711913007 > Cr-Commit-Position: refs/heads/master@{#16839} > Committed: https://chromium.googlesource.com/external/webrtc/+/37510bf0946afef1015eabb66a801af3ac30042a TBR=magjed@webrtc.org,sprang@webrtc.org,tommi@webrtc.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=webrtc:7206 Review-Url: https://codereview.webrtc.org/2718013002 Cr-Commit-Position: refs/heads/master@{#16853} --- webrtc/call/call_perf_tests.cc | 9 +++------ webrtc/video/vie_encoder.cc | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/webrtc/call/call_perf_tests.cc b/webrtc/call/call_perf_tests.cc index ae092f3837..570b19b4ce 100644 --- a/webrtc/call/call_perf_tests.cc +++ b/webrtc/call/call_perf_tests.cc @@ -468,12 +468,7 @@ TEST_F(CallPerfTest, CaptureNtpTimeWithNetworkJitter) { const int kRunTimeMs = 20000; TestCaptureNtpTime(net_config, kThresholdMs, kStartTimeMs, kRunTimeMs); } -#if defined(WEBRTC_ANDROID) -// This test is disabled on android as it does not update -// sinkWants below 320x180, the starting resolution for these -// tests. -#define ReceivesCpuOveruseAndUnderuse DISABLED_ReceivesCpuOveruseAndUnderuse -#endif + TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) { class LoadObserver : public test::SendTest, public test::FrameGeneratorCapturer::SinkWantsObserver { @@ -486,6 +481,8 @@ TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) { void OnFrameGeneratorCapturerCreated( test::FrameGeneratorCapturer* frame_generator_capturer) override { frame_generator_capturer->SetSinkWantsObserver(this); + // Set a high initial resolution to be sure that we can scale down. + frame_generator_capturer->ChangeResolution(1920, 1080); } // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc index 1458af266f..7880c4a275 100644 --- a/webrtc/video/vie_encoder.cc +++ b/webrtc/video/vie_encoder.cc @@ -35,14 +35,12 @@ using DegradationPreference = VideoSendStream::DegradationPreference; // Time interval for logging frame counts. const int64_t kFrameLogIntervalMs = 60000; + // We will never ask for a resolution lower than this. -#if defined(WEBRTC_ANDROID) // TODO(kthelgason): Lower this limit when better testing // on MediaCodec and fallback implementations are in place. +// See https://bugs.chromium.org/p/webrtc/issues/detail?id=7206 const int kMinPixelsPerFrame = 320 * 180; -#else -const int kMinPixelsPerFrame = 120 * 90; -#endif // The maximum number of frames to drop at beginning of stream // to try and achieve desired bitrate.