2016-09-01 01:17:40 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-03-29 08:24:59 -07:00
|
|
|
#include <algorithm>
|
2016-11-01 11:45:46 -07:00
|
|
|
#include <limits>
|
2016-09-23 15:52:06 +02:00
|
|
|
#include <utility>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/video/i420_buffer.h"
|
|
|
|
|
#include "media/base/videoadapter.h"
|
|
|
|
|
#include "modules/video_coding/codecs/vp8/temporal_layers.h"
|
|
|
|
|
#include "modules/video_coding/utility/default_video_bitrate_allocator.h"
|
|
|
|
|
#include "rtc_base/fakeclock.h"
|
|
|
|
|
#include "rtc_base/logging.h"
|
|
|
|
|
#include "system_wrappers/include/metrics_default.h"
|
|
|
|
|
#include "system_wrappers/include/sleep.h"
|
|
|
|
|
#include "test/encoder_settings.h"
|
|
|
|
|
#include "test/fake_encoder.h"
|
|
|
|
|
#include "test/frame_generator.h"
|
|
|
|
|
#include "test/gmock.h"
|
|
|
|
|
#include "test/gtest.h"
|
|
|
|
|
#include "video/send_statistics_proxy.h"
|
|
|
|
|
#include "video/video_stream_encoder.h"
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2016-12-09 03:53:59 -08:00
|
|
|
namespace {
|
|
|
|
|
const int kMinPixelsPerFrame = 320 * 180;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
const int kMinFramerateFps = 2;
|
2017-12-08 17:04:29 -08:00
|
|
|
const int kMinBalancedFramerateFps = 7;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
const int64_t kFrameTimeoutMs = 100;
|
2017-08-18 00:28:40 -07:00
|
|
|
const unsigned char kNumSlDummy = 0;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
} // namespace
|
2016-12-09 03:53:59 -08:00
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
2016-11-29 01:44:11 -08:00
|
|
|
using DegredationPreference = VideoSendStream::DegradationPreference;
|
2017-02-01 08:38:12 -08:00
|
|
|
using ScaleReason = AdaptationObserverInterface::AdaptReason;
|
2017-01-16 06:24:02 -08:00
|
|
|
using ::testing::_;
|
|
|
|
|
using ::testing::Return;
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2016-11-01 11:45:46 -07:00
|
|
|
namespace {
|
2016-11-25 04:37:00 -08:00
|
|
|
const size_t kMaxPayloadLength = 1440;
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
const int kTargetBitrateBps = 1000000;
|
|
|
|
|
const int kLowTargetBitrateBps = kTargetBitrateBps / 10;
|
|
|
|
|
const int kMaxInitialFramedrop = 4;
|
2017-06-15 04:21:07 -07:00
|
|
|
const int kDefaultFramerate = 30;
|
2016-11-25 04:37:00 -08:00
|
|
|
|
2016-11-01 11:45:46 -07:00
|
|
|
class TestBuffer : public webrtc::I420Buffer {
|
|
|
|
|
public:
|
|
|
|
|
TestBuffer(rtc::Event* event, int width, int height)
|
|
|
|
|
: I420Buffer(width, height), event_(event) {}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
friend class rtc::RefCountedObject<TestBuffer>;
|
|
|
|
|
~TestBuffer() override {
|
|
|
|
|
if (event_)
|
|
|
|
|
event_->Set();
|
|
|
|
|
}
|
|
|
|
|
rtc::Event* const event_;
|
|
|
|
|
};
|
|
|
|
|
|
2017-12-06 10:27:48 +01:00
|
|
|
class CpuOveruseDetectorProxy : public OveruseFrameDetector {
|
|
|
|
|
public:
|
|
|
|
|
CpuOveruseDetectorProxy(const CpuOveruseOptions& options,
|
|
|
|
|
CpuOveruseMetricsObserver* metrics_observer)
|
|
|
|
|
: OveruseFrameDetector(options,
|
|
|
|
|
metrics_observer),
|
|
|
|
|
last_target_framerate_fps_(-1) {}
|
|
|
|
|
virtual ~CpuOveruseDetectorProxy() {}
|
|
|
|
|
|
|
|
|
|
void OnTargetFramerateUpdated(int framerate_fps) override {
|
|
|
|
|
rtc::CritScope cs(&lock_);
|
|
|
|
|
last_target_framerate_fps_ = framerate_fps;
|
|
|
|
|
OveruseFrameDetector::OnTargetFramerateUpdated(framerate_fps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int GetLastTargetFramerate() {
|
|
|
|
|
rtc::CritScope cs(&lock_);
|
|
|
|
|
return last_target_framerate_fps_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
rtc::CriticalSection lock_;
|
|
|
|
|
int last_target_framerate_fps_ RTC_GUARDED_BY(lock_);
|
|
|
|
|
};
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
class VideoStreamEncoderUnderTest : public VideoStreamEncoder {
|
2016-11-01 11:45:46 -07:00
|
|
|
public:
|
2017-12-06 10:27:48 +01:00
|
|
|
VideoStreamEncoderUnderTest(SendStatisticsProxy* stats_proxy,
|
|
|
|
|
const VideoSendStream::Config::EncoderSettings& settings)
|
2017-08-03 08:27:51 -07:00
|
|
|
: VideoStreamEncoder(
|
|
|
|
|
1 /* number_of_cores */,
|
|
|
|
|
stats_proxy,
|
|
|
|
|
settings,
|
|
|
|
|
nullptr /* pre_encode_callback */,
|
|
|
|
|
std::unique_ptr<OveruseFrameDetector>(
|
2017-12-06 10:27:48 +01:00
|
|
|
overuse_detector_proxy_ = new CpuOveruseDetectorProxy(
|
2018-01-31 16:09:31 +01:00
|
|
|
CpuOveruseOptions(),
|
2017-08-03 08:27:51 -07:00
|
|
|
stats_proxy))) {}
|
2016-11-01 11:45:46 -07:00
|
|
|
|
2017-02-01 08:38:12 -08:00
|
|
|
void PostTaskAndWait(bool down, AdaptReason reason) {
|
2016-11-01 11:45:46 -07:00
|
|
|
rtc::Event event(false, false);
|
2016-11-29 01:44:11 -08:00
|
|
|
encoder_queue()->PostTask([this, &event, reason, down] {
|
2017-02-01 08:38:12 -08:00
|
|
|
down ? AdaptDown(reason) : AdaptUp(reason);
|
2016-11-01 11:45:46 -07:00
|
|
|
event.Set();
|
|
|
|
|
});
|
2017-02-16 15:46:27 -08:00
|
|
|
ASSERT_TRUE(event.Wait(5000));
|
2016-11-01 11:45:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-03-03 00:24:41 -08:00
|
|
|
// This is used as a synchronisation mechanism, to make sure that the
|
|
|
|
|
// encoder queue is not blocked before we start sending it frames.
|
|
|
|
|
void WaitUntilTaskQueueIsIdle() {
|
|
|
|
|
rtc::Event event(false, false);
|
|
|
|
|
encoder_queue()->PostTask([&event] {
|
|
|
|
|
event.Set();
|
|
|
|
|
});
|
|
|
|
|
ASSERT_TRUE(event.Wait(5000));
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-01 08:38:12 -08:00
|
|
|
void TriggerCpuOveruse() { PostTaskAndWait(true, AdaptReason::kCpu); }
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-02-01 08:38:12 -08:00
|
|
|
void TriggerCpuNormalUsage() { PostTaskAndWait(false, AdaptReason::kCpu); }
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-02-01 08:38:12 -08:00
|
|
|
void TriggerQualityLow() { PostTaskAndWait(true, AdaptReason::kQuality); }
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-02-01 08:38:12 -08:00
|
|
|
void TriggerQualityHigh() { PostTaskAndWait(false, AdaptReason::kQuality); }
|
2017-06-15 04:21:07 -07:00
|
|
|
|
2017-12-06 10:27:48 +01:00
|
|
|
CpuOveruseDetectorProxy* overuse_detector_proxy_;
|
2016-11-01 11:45:46 -07:00
|
|
|
};
|
|
|
|
|
|
2016-11-25 04:37:00 -08:00
|
|
|
class VideoStreamFactory
|
|
|
|
|
: public VideoEncoderConfig::VideoStreamFactoryInterface {
|
|
|
|
|
public:
|
2017-06-15 04:21:07 -07:00
|
|
|
explicit VideoStreamFactory(size_t num_temporal_layers, int framerate)
|
|
|
|
|
: num_temporal_layers_(num_temporal_layers), framerate_(framerate) {
|
2016-11-25 04:37:00 -08:00
|
|
|
EXPECT_GT(num_temporal_layers, 0u);
|
2017-06-15 04:21:07 -07:00
|
|
|
EXPECT_GT(framerate, 0);
|
2016-11-25 04:37:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::vector<VideoStream> CreateEncoderStreams(
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
const VideoEncoderConfig& encoder_config) override {
|
|
|
|
|
std::vector<VideoStream> streams =
|
|
|
|
|
test::CreateVideoStreams(width, height, encoder_config);
|
|
|
|
|
for (VideoStream& stream : streams) {
|
|
|
|
|
stream.temporal_layer_thresholds_bps.resize(num_temporal_layers_ - 1);
|
2017-06-15 04:21:07 -07:00
|
|
|
stream.max_framerate = framerate_;
|
2016-11-25 04:37:00 -08:00
|
|
|
}
|
|
|
|
|
return streams;
|
|
|
|
|
}
|
2017-06-15 04:21:07 -07:00
|
|
|
|
2016-11-25 04:37:00 -08:00
|
|
|
const size_t num_temporal_layers_;
|
2017-06-15 04:21:07 -07:00
|
|
|
const int framerate_;
|
2016-11-25 04:37:00 -08:00
|
|
|
};
|
|
|
|
|
|
2017-06-16 06:53:48 -07:00
|
|
|
|
2017-02-01 08:38:12 -08:00
|
|
|
class AdaptingFrameForwarder : public test::FrameForwarder {
|
|
|
|
|
public:
|
|
|
|
|
AdaptingFrameForwarder() : adaptation_enabled_(false) {}
|
2017-04-04 05:51:49 -07:00
|
|
|
~AdaptingFrameForwarder() override {}
|
2017-02-01 08:38:12 -08:00
|
|
|
|
|
|
|
|
void set_adaptation_enabled(bool enabled) {
|
|
|
|
|
rtc::CritScope cs(&crit_);
|
|
|
|
|
adaptation_enabled_ = enabled;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
bool adaption_enabled() const {
|
2017-02-01 08:38:12 -08:00
|
|
|
rtc::CritScope cs(&crit_);
|
|
|
|
|
return adaptation_enabled_;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 23:40:18 -07:00
|
|
|
rtc::VideoSinkWants last_wants() const {
|
|
|
|
|
rtc::CritScope cs(&crit_);
|
|
|
|
|
return last_wants_;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
rtc::Optional<int> last_sent_width() const { return last_width_; }
|
|
|
|
|
rtc::Optional<int> last_sent_height() const { return last_height_; }
|
|
|
|
|
|
2017-02-01 08:38:12 -08:00
|
|
|
void IncomingCapturedFrame(const VideoFrame& video_frame) override {
|
|
|
|
|
int cropped_width = 0;
|
|
|
|
|
int cropped_height = 0;
|
|
|
|
|
int out_width = 0;
|
|
|
|
|
int out_height = 0;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
if (adaption_enabled()) {
|
|
|
|
|
if (adapter_.AdaptFrameResolution(
|
|
|
|
|
video_frame.width(), video_frame.height(),
|
|
|
|
|
video_frame.timestamp_us() * 1000, &cropped_width,
|
|
|
|
|
&cropped_height, &out_width, &out_height)) {
|
|
|
|
|
VideoFrame adapted_frame(new rtc::RefCountedObject<TestBuffer>(
|
|
|
|
|
nullptr, out_width, out_height),
|
|
|
|
|
99, 99, kVideoRotation_0);
|
|
|
|
|
adapted_frame.set_ntp_time_ms(video_frame.ntp_time_ms());
|
|
|
|
|
test::FrameForwarder::IncomingCapturedFrame(adapted_frame);
|
2017-12-08 17:04:29 -08:00
|
|
|
last_width_.emplace(adapted_frame.width());
|
|
|
|
|
last_height_.emplace(adapted_frame.height());
|
|
|
|
|
} else {
|
|
|
|
|
last_width_ = rtc::nullopt;
|
|
|
|
|
last_height_ = rtc::nullopt;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
2017-02-01 08:38:12 -08:00
|
|
|
} else {
|
|
|
|
|
test::FrameForwarder::IncomingCapturedFrame(video_frame);
|
2017-12-08 17:04:29 -08:00
|
|
|
last_width_.emplace(video_frame.width());
|
|
|
|
|
last_height_.emplace(video_frame.height());
|
2017-02-01 08:38:12 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
|
|
|
|
|
const rtc::VideoSinkWants& wants) override {
|
|
|
|
|
rtc::CritScope cs(&crit_);
|
2017-05-15 23:40:18 -07:00
|
|
|
last_wants_ = sink_wants();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
adapter_.OnResolutionFramerateRequest(wants.target_pixel_count,
|
|
|
|
|
wants.max_pixel_count,
|
|
|
|
|
wants.max_framerate_fps);
|
2017-02-01 08:38:12 -08:00
|
|
|
test::FrameForwarder::AddOrUpdateSink(sink, wants);
|
|
|
|
|
}
|
|
|
|
|
cricket::VideoAdapter adapter_;
|
2017-09-09 04:17:22 -07:00
|
|
|
bool adaptation_enabled_ RTC_GUARDED_BY(crit_);
|
|
|
|
|
rtc::VideoSinkWants last_wants_ RTC_GUARDED_BY(crit_);
|
2017-12-08 17:04:29 -08:00
|
|
|
rtc::Optional<int> last_width_;
|
|
|
|
|
rtc::Optional<int> last_height_;
|
2017-02-01 08:38:12 -08:00
|
|
|
};
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
|
|
|
|
class MockableSendStatisticsProxy : public SendStatisticsProxy {
|
|
|
|
|
public:
|
|
|
|
|
MockableSendStatisticsProxy(Clock* clock,
|
|
|
|
|
const VideoSendStream::Config& config,
|
|
|
|
|
VideoEncoderConfig::ContentType content_type)
|
|
|
|
|
: SendStatisticsProxy(clock, config, content_type) {}
|
|
|
|
|
|
|
|
|
|
VideoSendStream::Stats GetStats() override {
|
|
|
|
|
rtc::CritScope cs(&lock_);
|
|
|
|
|
if (mock_stats_)
|
|
|
|
|
return *mock_stats_;
|
|
|
|
|
return SendStatisticsProxy::GetStats();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetMockStats(const VideoSendStream::Stats& stats) {
|
|
|
|
|
rtc::CritScope cs(&lock_);
|
|
|
|
|
mock_stats_.emplace(stats);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ResetMockStats() {
|
|
|
|
|
rtc::CritScope cs(&lock_);
|
|
|
|
|
mock_stats_.reset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
rtc::CriticalSection lock_;
|
2017-09-09 04:17:22 -07:00
|
|
|
rtc::Optional<VideoSendStream::Stats> mock_stats_ RTC_GUARDED_BY(lock_);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
};
|
|
|
|
|
|
2017-06-27 07:06:52 -07:00
|
|
|
class MockBitrateObserver : public VideoBitrateAllocationObserver {
|
|
|
|
|
public:
|
|
|
|
|
MOCK_METHOD1(OnBitrateAllocationUpdated, void(const BitrateAllocation&));
|
|
|
|
|
};
|
|
|
|
|
|
2016-11-01 11:45:46 -07:00
|
|
|
} // namespace
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
class VideoStreamEncoderTest : public ::testing::Test {
|
2016-09-01 01:17:40 -07:00
|
|
|
public:
|
|
|
|
|
static const int kDefaultTimeoutMs = 30 * 1000;
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
VideoStreamEncoderTest()
|
2016-09-01 01:17:40 -07:00
|
|
|
: video_send_config_(VideoSendStream::Config(nullptr)),
|
2016-10-02 23:45:26 -07:00
|
|
|
codec_width_(320),
|
|
|
|
|
codec_height_(240),
|
2017-06-27 07:06:52 -07:00
|
|
|
max_framerate_(30),
|
2016-09-01 01:17:40 -07:00
|
|
|
fake_encoder_(),
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
stats_proxy_(new MockableSendStatisticsProxy(
|
2016-11-01 11:45:46 -07:00
|
|
|
Clock::GetRealTimeClock(),
|
|
|
|
|
video_send_config_,
|
|
|
|
|
webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo)),
|
2016-09-01 01:17:40 -07:00
|
|
|
sink_(&fake_encoder_) {}
|
|
|
|
|
|
|
|
|
|
void SetUp() override {
|
2016-11-01 11:45:46 -07:00
|
|
|
metrics::Reset();
|
2016-09-01 01:17:40 -07:00
|
|
|
video_send_config_ = VideoSendStream::Config(nullptr);
|
|
|
|
|
video_send_config_.encoder_settings.encoder = &fake_encoder_;
|
|
|
|
|
video_send_config_.encoder_settings.payload_name = "FAKE";
|
|
|
|
|
video_send_config_.encoder_settings.payload_type = 125;
|
|
|
|
|
|
2016-09-23 15:52:06 +02:00
|
|
|
VideoEncoderConfig video_encoder_config;
|
2016-10-02 23:45:26 -07:00
|
|
|
test::FillEncoderConfiguration(1, &video_encoder_config);
|
2017-06-27 07:06:52 -07:00
|
|
|
video_encoder_config.video_stream_factory =
|
|
|
|
|
new rtc::RefCountedObject<VideoStreamFactory>(1, max_framerate_);
|
2016-11-16 16:41:30 +01:00
|
|
|
video_encoder_config_ = video_encoder_config.Copy();
|
2017-06-27 07:06:52 -07:00
|
|
|
|
|
|
|
|
// Framerate limit is specified by the VideoStreamFactory.
|
|
|
|
|
std::vector<VideoStream> streams =
|
|
|
|
|
video_encoder_config.video_stream_factory->CreateEncoderStreams(
|
|
|
|
|
codec_width_, codec_height_, video_encoder_config);
|
|
|
|
|
max_framerate_ = streams[0].max_framerate;
|
|
|
|
|
fake_clock_.SetTimeMicros(1234);
|
|
|
|
|
|
2016-11-25 04:37:00 -08:00
|
|
|
ConfigureEncoder(std::move(video_encoder_config), true /* nack_enabled */);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ConfigureEncoder(VideoEncoderConfig video_encoder_config,
|
|
|
|
|
bool nack_enabled) {
|
2017-08-03 08:27:51 -07:00
|
|
|
if (video_stream_encoder_)
|
|
|
|
|
video_stream_encoder_->Stop();
|
|
|
|
|
video_stream_encoder_.reset(new VideoStreamEncoderUnderTest(
|
2016-11-01 11:45:46 -07:00
|
|
|
stats_proxy_.get(), video_send_config_.encoder_settings));
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSink(&sink_, false /* rotation_applied */);
|
|
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&video_source_,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainFramerate);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetStartBitrate(kTargetBitrateBps);
|
|
|
|
|
video_stream_encoder_->ConfigureEncoder(std::move(video_encoder_config),
|
|
|
|
|
kMaxPayloadLength, nack_enabled);
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
2016-11-25 04:37:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ResetEncoder(const std::string& payload_name,
|
|
|
|
|
size_t num_streams,
|
|
|
|
|
size_t num_temporal_layers,
|
2017-08-18 00:28:40 -07:00
|
|
|
unsigned char num_spatial_layers,
|
2017-06-27 07:06:52 -07:00
|
|
|
bool nack_enabled,
|
|
|
|
|
bool screenshare) {
|
2016-11-25 04:37:00 -08:00
|
|
|
video_send_config_.encoder_settings.payload_name = payload_name;
|
|
|
|
|
|
|
|
|
|
VideoEncoderConfig video_encoder_config;
|
|
|
|
|
video_encoder_config.number_of_streams = num_streams;
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
video_encoder_config.max_bitrate_bps = kTargetBitrateBps;
|
2016-11-25 04:37:00 -08:00
|
|
|
video_encoder_config.video_stream_factory =
|
2017-06-15 04:21:07 -07:00
|
|
|
new rtc::RefCountedObject<VideoStreamFactory>(num_temporal_layers,
|
|
|
|
|
kDefaultFramerate);
|
2017-06-27 07:06:52 -07:00
|
|
|
video_encoder_config.content_type =
|
|
|
|
|
screenshare ? VideoEncoderConfig::ContentType::kScreen
|
|
|
|
|
: VideoEncoderConfig::ContentType::kRealtimeVideo;
|
2017-08-18 00:28:40 -07:00
|
|
|
if (payload_name == "VP9") {
|
|
|
|
|
VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings();
|
|
|
|
|
vp9_settings.numberOfSpatialLayers = num_spatial_layers;
|
|
|
|
|
video_encoder_config.encoder_specific_settings =
|
|
|
|
|
new rtc::RefCountedObject<
|
|
|
|
|
VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings);
|
|
|
|
|
}
|
2016-11-25 04:37:00 -08:00
|
|
|
ConfigureEncoder(std::move(video_encoder_config), nack_enabled);
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
|
|
|
|
|
2017-01-16 06:24:02 -08:00
|
|
|
VideoFrame CreateFrame(int64_t ntp_time_ms,
|
|
|
|
|
rtc::Event* destruction_event) const {
|
2016-09-23 15:52:06 +02:00
|
|
|
VideoFrame frame(new rtc::RefCountedObject<TestBuffer>(
|
|
|
|
|
destruction_event, codec_width_, codec_height_),
|
|
|
|
|
99, 99, kVideoRotation_0);
|
2017-01-16 06:24:02 -08:00
|
|
|
frame.set_ntp_time_ms(ntp_time_ms);
|
2016-09-01 01:17:40 -07:00
|
|
|
return frame;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-16 06:24:02 -08:00
|
|
|
VideoFrame CreateFrame(int64_t ntp_time_ms, int width, int height) const {
|
2016-11-01 11:45:46 -07:00
|
|
|
VideoFrame frame(
|
|
|
|
|
new rtc::RefCountedObject<TestBuffer>(nullptr, width, height), 99, 99,
|
|
|
|
|
kVideoRotation_0);
|
2017-01-16 06:24:02 -08:00
|
|
|
frame.set_ntp_time_ms(ntp_time_ms);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
frame.set_timestamp_us(ntp_time_ms * 1000);
|
2016-11-01 11:45:46 -07:00
|
|
|
return frame;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-10 01:12:52 -07:00
|
|
|
void VerifyNoLimitation(const rtc::VideoSinkWants& wants) {
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(), wants.max_framerate_fps);
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(), wants.max_pixel_count);
|
|
|
|
|
EXPECT_FALSE(wants.target_pixel_count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void VerifyFpsEqResolutionEq(const rtc::VideoSinkWants& wants1,
|
|
|
|
|
const rtc::VideoSinkWants& wants2) {
|
|
|
|
|
EXPECT_EQ(wants1.max_framerate_fps, wants2.max_framerate_fps);
|
|
|
|
|
EXPECT_EQ(wants1.max_pixel_count, wants2.max_pixel_count);
|
2017-04-10 01:12:52 -07:00
|
|
|
}
|
|
|
|
|
|
2017-05-15 23:40:18 -07:00
|
|
|
void VerifyFpsMaxResolutionLt(const rtc::VideoSinkWants& wants1,
|
|
|
|
|
const rtc::VideoSinkWants& wants2) {
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(), wants1.max_framerate_fps);
|
|
|
|
|
EXPECT_LT(wants1.max_pixel_count, wants2.max_pixel_count);
|
|
|
|
|
EXPECT_GT(wants1.max_pixel_count, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void VerifyFpsMaxResolutionGt(const rtc::VideoSinkWants& wants1,
|
|
|
|
|
const rtc::VideoSinkWants& wants2) {
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(), wants1.max_framerate_fps);
|
|
|
|
|
EXPECT_GT(wants1.max_pixel_count, wants2.max_pixel_count);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-13 23:25:22 -07:00
|
|
|
void VerifyFpsMaxResolutionEq(const rtc::VideoSinkWants& wants1,
|
|
|
|
|
const rtc::VideoSinkWants& wants2) {
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(), wants1.max_framerate_fps);
|
|
|
|
|
EXPECT_EQ(wants1.max_pixel_count, wants2.max_pixel_count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void VerifyFpsLtResolutionEq(const rtc::VideoSinkWants& wants1,
|
|
|
|
|
const rtc::VideoSinkWants& wants2) {
|
|
|
|
|
EXPECT_LT(wants1.max_framerate_fps, wants2.max_framerate_fps);
|
|
|
|
|
EXPECT_EQ(wants1.max_pixel_count, wants2.max_pixel_count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void VerifyFpsGtResolutionEq(const rtc::VideoSinkWants& wants1,
|
|
|
|
|
const rtc::VideoSinkWants& wants2) {
|
|
|
|
|
EXPECT_GT(wants1.max_framerate_fps, wants2.max_framerate_fps);
|
|
|
|
|
EXPECT_EQ(wants1.max_pixel_count, wants2.max_pixel_count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void VerifyFpsEqResolutionLt(const rtc::VideoSinkWants& wants1,
|
|
|
|
|
const rtc::VideoSinkWants& wants2) {
|
|
|
|
|
EXPECT_EQ(wants1.max_framerate_fps, wants2.max_framerate_fps);
|
|
|
|
|
EXPECT_LT(wants1.max_pixel_count, wants2.max_pixel_count);
|
|
|
|
|
EXPECT_GT(wants1.max_pixel_count, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void VerifyFpsEqResolutionGt(const rtc::VideoSinkWants& wants1,
|
|
|
|
|
const rtc::VideoSinkWants& wants2) {
|
|
|
|
|
EXPECT_EQ(wants1.max_framerate_fps, wants2.max_framerate_fps);
|
|
|
|
|
EXPECT_GT(wants1.max_pixel_count, wants2.max_pixel_count);
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 23:40:18 -07:00
|
|
|
void VerifyFpsMaxResolutionLt(const rtc::VideoSinkWants& wants,
|
|
|
|
|
int pixel_count) {
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(), wants.max_framerate_fps);
|
2017-04-10 01:12:52 -07:00
|
|
|
EXPECT_LT(wants.max_pixel_count, pixel_count);
|
|
|
|
|
EXPECT_GT(wants.max_pixel_count, 0);
|
2017-05-15 23:40:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void VerifyFpsLtResolutionMax(const rtc::VideoSinkWants& wants, int fps) {
|
|
|
|
|
EXPECT_LT(wants.max_framerate_fps, fps);
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(), wants.max_pixel_count);
|
|
|
|
|
EXPECT_FALSE(wants.target_pixel_count);
|
2017-04-10 01:12:52 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-13 23:25:22 -07:00
|
|
|
void VerifyFpsEqResolutionMax(const rtc::VideoSinkWants& wants,
|
|
|
|
|
int expected_fps) {
|
|
|
|
|
EXPECT_EQ(expected_fps, wants.max_framerate_fps);
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(), wants.max_pixel_count);
|
|
|
|
|
EXPECT_FALSE(wants.target_pixel_count);
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
void VerifyBalancedModeFpsRange(const rtc::VideoSinkWants& wants,
|
|
|
|
|
int last_frame_pixels) {
|
|
|
|
|
// Balanced mode should always scale FPS to the desired range before
|
|
|
|
|
// attempting to scale resolution.
|
|
|
|
|
int fps_limit = wants.max_framerate_fps;
|
|
|
|
|
if (last_frame_pixels <= 320 * 240) {
|
|
|
|
|
EXPECT_TRUE(7 <= fps_limit && fps_limit <= 10);
|
|
|
|
|
} else if (last_frame_pixels <= 480 * 270) {
|
|
|
|
|
EXPECT_TRUE(10 <= fps_limit && fps_limit <= 15);
|
|
|
|
|
} else if (last_frame_pixels <= 640 * 480) {
|
|
|
|
|
EXPECT_LE(15, fps_limit);
|
|
|
|
|
} else {
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(), fps_limit);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-27 07:06:52 -07:00
|
|
|
void WaitForEncodedFrame(int64_t expected_ntp_time) {
|
|
|
|
|
sink_.WaitForEncodedFrame(expected_ntp_time);
|
|
|
|
|
fake_clock_.AdvanceTimeMicros(rtc::kNumMicrosecsPerSec / max_framerate_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TimedWaitForEncodedFrame(int64_t expected_ntp_time, int64_t timeout_ms) {
|
|
|
|
|
bool ok = sink_.TimedWaitForEncodedFrame(expected_ntp_time, timeout_ms);
|
|
|
|
|
fake_clock_.AdvanceTimeMicros(rtc::kNumMicrosecsPerSec / max_framerate_);
|
|
|
|
|
return ok;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WaitForEncodedFrame(uint32_t expected_width, uint32_t expected_height) {
|
|
|
|
|
sink_.WaitForEncodedFrame(expected_width, expected_height);
|
|
|
|
|
fake_clock_.AdvanceTimeMicros(rtc::kNumMicrosecsPerSec / max_framerate_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ExpectDroppedFrame() {
|
|
|
|
|
sink_.ExpectDroppedFrame();
|
|
|
|
|
fake_clock_.AdvanceTimeMicros(rtc::kNumMicrosecsPerSec / max_framerate_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool WaitForFrame(int64_t timeout_ms) {
|
|
|
|
|
bool ok = sink_.WaitForFrame(timeout_ms);
|
|
|
|
|
fake_clock_.AdvanceTimeMicros(rtc::kNumMicrosecsPerSec / max_framerate_);
|
|
|
|
|
return ok;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
class TestEncoder : public test::FakeEncoder {
|
|
|
|
|
public:
|
|
|
|
|
TestEncoder()
|
|
|
|
|
: FakeEncoder(Clock::GetRealTimeClock()),
|
|
|
|
|
continue_encode_event_(false, false) {}
|
|
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
VideoCodec codec_config() const {
|
2017-01-16 05:57:16 -08:00
|
|
|
rtc::CritScope lock(&crit_sect_);
|
2016-10-02 23:45:26 -07:00
|
|
|
return config_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BlockNextEncode() {
|
2017-01-16 05:57:16 -08:00
|
|
|
rtc::CritScope lock(&local_crit_sect_);
|
2016-10-02 23:45:26 -07:00
|
|
|
block_next_encode_ = true;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-29 01:44:11 -08:00
|
|
|
VideoEncoder::ScalingSettings GetScalingSettings() const override {
|
2017-03-03 00:24:41 -08:00
|
|
|
rtc::CritScope lock(&local_crit_sect_);
|
2017-02-14 00:46:51 -08:00
|
|
|
if (quality_scaling_)
|
2017-08-17 08:58:54 -07:00
|
|
|
return VideoEncoder::ScalingSettings(true, 1, 2, kMinPixelsPerFrame);
|
2017-02-14 00:46:51 -08:00
|
|
|
return VideoEncoder::ScalingSettings(false);
|
2016-11-29 01:44:11 -08:00
|
|
|
}
|
|
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
void ContinueEncode() { continue_encode_event_.Set(); }
|
|
|
|
|
|
|
|
|
|
void CheckLastTimeStampsMatch(int64_t ntp_time_ms,
|
|
|
|
|
uint32_t timestamp) const {
|
2017-01-16 05:57:16 -08:00
|
|
|
rtc::CritScope lock(&local_crit_sect_);
|
2016-10-02 23:45:26 -07:00
|
|
|
EXPECT_EQ(timestamp_, timestamp);
|
|
|
|
|
EXPECT_EQ(ntp_time_ms_, ntp_time_ms);
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-03 00:24:41 -08:00
|
|
|
void SetQualityScaling(bool b) {
|
|
|
|
|
rtc::CritScope lock(&local_crit_sect_);
|
|
|
|
|
quality_scaling_ = b;
|
|
|
|
|
}
|
2017-02-14 00:46:51 -08:00
|
|
|
|
2017-03-29 08:24:59 -07:00
|
|
|
void ForceInitEncodeFailure(bool force_failure) {
|
|
|
|
|
rtc::CritScope lock(&local_crit_sect_);
|
|
|
|
|
force_init_encode_failed_ = force_failure;
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
private:
|
2016-09-01 01:17:40 -07:00
|
|
|
int32_t Encode(const VideoFrame& input_image,
|
|
|
|
|
const CodecSpecificInfo* codec_specific_info,
|
|
|
|
|
const std::vector<FrameType>* frame_types) override {
|
|
|
|
|
bool block_encode;
|
|
|
|
|
{
|
2017-01-16 05:57:16 -08:00
|
|
|
rtc::CritScope lock(&local_crit_sect_);
|
2016-09-01 01:17:40 -07:00
|
|
|
EXPECT_GT(input_image.timestamp(), timestamp_);
|
|
|
|
|
EXPECT_GT(input_image.ntp_time_ms(), ntp_time_ms_);
|
|
|
|
|
EXPECT_EQ(input_image.timestamp(), input_image.ntp_time_ms() * 90);
|
|
|
|
|
|
|
|
|
|
timestamp_ = input_image.timestamp();
|
|
|
|
|
ntp_time_ms_ = input_image.ntp_time_ms();
|
2016-11-01 11:45:46 -07:00
|
|
|
last_input_width_ = input_image.width();
|
|
|
|
|
last_input_height_ = input_image.height();
|
2016-09-01 01:17:40 -07:00
|
|
|
block_encode = block_next_encode_;
|
|
|
|
|
block_next_encode_ = false;
|
|
|
|
|
}
|
|
|
|
|
int32_t result =
|
|
|
|
|
FakeEncoder::Encode(input_image, codec_specific_info, frame_types);
|
|
|
|
|
if (block_encode)
|
2016-09-16 07:53:41 -07:00
|
|
|
EXPECT_TRUE(continue_encode_event_.Wait(kDefaultTimeoutMs));
|
2016-09-01 01:17:40 -07:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-29 08:24:59 -07:00
|
|
|
int32_t InitEncode(const VideoCodec* config,
|
|
|
|
|
int32_t number_of_cores,
|
|
|
|
|
size_t max_payload_size) override {
|
|
|
|
|
int res =
|
|
|
|
|
FakeEncoder::InitEncode(config, number_of_cores, max_payload_size);
|
|
|
|
|
rtc::CritScope lock(&local_crit_sect_);
|
|
|
|
|
if (config->codecType == kVideoCodecVP8 && config->VP8().tl_factory) {
|
|
|
|
|
// Simulate setting up temporal layers, in order to validate the life
|
|
|
|
|
// cycle of these objects.
|
|
|
|
|
int num_streams = std::max<int>(1, config->numberOfSimulcastStreams);
|
|
|
|
|
int num_temporal_layers =
|
|
|
|
|
std::max<int>(1, config->VP8().numberOfTemporalLayers);
|
|
|
|
|
for (int i = 0; i < num_streams; ++i) {
|
|
|
|
|
allocated_temporal_layers_.emplace_back(
|
|
|
|
|
config->VP8().tl_factory->Create(i, num_temporal_layers, 42));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (force_init_encode_failed_)
|
|
|
|
|
return -1;
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-16 05:57:16 -08:00
|
|
|
rtc::CriticalSection local_crit_sect_;
|
2017-09-09 04:17:22 -07:00
|
|
|
bool block_next_encode_ RTC_GUARDED_BY(local_crit_sect_) = false;
|
2016-09-01 01:17:40 -07:00
|
|
|
rtc::Event continue_encode_event_;
|
2017-09-09 04:17:22 -07:00
|
|
|
uint32_t timestamp_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
|
|
|
|
int64_t ntp_time_ms_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
|
|
|
|
int last_input_width_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
|
|
|
|
int last_input_height_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
|
|
|
|
bool quality_scaling_ RTC_GUARDED_BY(local_crit_sect_) = true;
|
2017-03-29 08:24:59 -07:00
|
|
|
std::vector<std::unique_ptr<TemporalLayers>> allocated_temporal_layers_
|
2017-09-09 04:17:22 -07:00
|
|
|
RTC_GUARDED_BY(local_crit_sect_);
|
|
|
|
|
bool force_init_encode_failed_ RTC_GUARDED_BY(local_crit_sect_) = false;
|
2016-09-01 01:17:40 -07:00
|
|
|
};
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
class TestSink : public VideoStreamEncoder::EncoderSink {
|
2016-09-01 01:17:40 -07:00
|
|
|
public:
|
|
|
|
|
explicit TestSink(TestEncoder* test_encoder)
|
|
|
|
|
: test_encoder_(test_encoder), encoded_frame_event_(false, false) {}
|
|
|
|
|
|
|
|
|
|
void WaitForEncodedFrame(int64_t expected_ntp_time) {
|
2017-06-27 07:06:52 -07:00
|
|
|
EXPECT_TRUE(
|
|
|
|
|
TimedWaitForEncodedFrame(expected_ntp_time, kDefaultTimeoutMs));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TimedWaitForEncodedFrame(int64_t expected_ntp_time,
|
|
|
|
|
int64_t timeout_ms) {
|
2016-09-01 01:17:40 -07:00
|
|
|
uint32_t timestamp = 0;
|
2017-06-27 07:06:52 -07:00
|
|
|
if (!encoded_frame_event_.Wait(timeout_ms))
|
|
|
|
|
return false;
|
2016-09-01 01:17:40 -07:00
|
|
|
{
|
|
|
|
|
rtc::CritScope lock(&crit_);
|
2017-02-01 08:38:12 -08:00
|
|
|
timestamp = last_timestamp_;
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
|
|
|
|
test_encoder_->CheckLastTimeStampsMatch(expected_ntp_time, timestamp);
|
2017-06-27 07:06:52 -07:00
|
|
|
return true;
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-01 08:38:12 -08:00
|
|
|
void WaitForEncodedFrame(uint32_t expected_width,
|
|
|
|
|
uint32_t expected_height) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_TRUE(encoded_frame_event_.Wait(kDefaultTimeoutMs));
|
2017-12-04 14:13:56 +01:00
|
|
|
CheckLastFrameSizeMatches(expected_width, expected_height);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
|
|
|
|
|
2017-12-04 14:13:56 +01:00
|
|
|
void CheckLastFrameSizeMatches(uint32_t expected_width,
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
uint32_t expected_height) {
|
2017-02-01 08:38:12 -08:00
|
|
|
uint32_t width = 0;
|
|
|
|
|
uint32_t height = 0;
|
|
|
|
|
{
|
|
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
width = last_width_;
|
|
|
|
|
height = last_height_;
|
|
|
|
|
}
|
|
|
|
|
EXPECT_EQ(expected_height, height);
|
|
|
|
|
EXPECT_EQ(expected_width, width);
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-03 00:24:41 -08:00
|
|
|
void ExpectDroppedFrame() { EXPECT_FALSE(encoded_frame_event_.Wait(100)); }
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
bool WaitForFrame(int64_t timeout_ms) {
|
|
|
|
|
return encoded_frame_event_.Wait(timeout_ms);
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
void SetExpectNoFrames() {
|
|
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
expect_frames_ = false;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
int number_of_reconfigurations() const {
|
2016-09-23 15:52:06 +02:00
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
return number_of_reconfigurations_;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
int last_min_transmit_bitrate() const {
|
2016-09-23 15:52:06 +02:00
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
return min_transmit_bitrate_bps_;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
private:
|
2016-11-04 11:39:29 -07:00
|
|
|
Result OnEncodedImage(
|
|
|
|
|
const EncodedImage& encoded_image,
|
|
|
|
|
const CodecSpecificInfo* codec_specific_info,
|
|
|
|
|
const RTPFragmentationHeader* fragmentation) override {
|
2016-09-23 15:52:06 +02:00
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
EXPECT_TRUE(expect_frames_);
|
2017-02-01 08:38:12 -08:00
|
|
|
last_timestamp_ = encoded_image._timeStamp;
|
|
|
|
|
last_width_ = encoded_image._encodedWidth;
|
|
|
|
|
last_height_ = encoded_image._encodedHeight;
|
2016-09-23 15:52:06 +02:00
|
|
|
encoded_frame_event_.Set();
|
2017-02-01 08:38:12 -08:00
|
|
|
return Result(Result::OK, last_timestamp_);
|
2016-09-23 15:52:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnEncoderConfigurationChanged(std::vector<VideoStream> streams,
|
|
|
|
|
int min_transmit_bitrate_bps) override {
|
|
|
|
|
rtc::CriticalSection crit_;
|
|
|
|
|
++number_of_reconfigurations_;
|
|
|
|
|
min_transmit_bitrate_bps_ = min_transmit_bitrate_bps;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
rtc::CriticalSection crit_;
|
|
|
|
|
TestEncoder* test_encoder_;
|
|
|
|
|
rtc::Event encoded_frame_event_;
|
2017-02-01 08:38:12 -08:00
|
|
|
uint32_t last_timestamp_ = 0;
|
|
|
|
|
uint32_t last_height_ = 0;
|
|
|
|
|
uint32_t last_width_ = 0;
|
2016-09-01 01:17:40 -07:00
|
|
|
bool expect_frames_ = true;
|
2016-09-23 15:52:06 +02:00
|
|
|
int number_of_reconfigurations_ = 0;
|
|
|
|
|
int min_transmit_bitrate_bps_ = 0;
|
2016-09-01 01:17:40 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
VideoSendStream::Config video_send_config_;
|
2016-11-16 16:41:30 +01:00
|
|
|
VideoEncoderConfig video_encoder_config_;
|
2016-09-23 15:52:06 +02:00
|
|
|
int codec_width_;
|
|
|
|
|
int codec_height_;
|
2017-06-27 07:06:52 -07:00
|
|
|
int max_framerate_;
|
2016-09-01 01:17:40 -07:00
|
|
|
TestEncoder fake_encoder_;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
std::unique_ptr<MockableSendStatisticsProxy> stats_proxy_;
|
2016-09-01 01:17:40 -07:00
|
|
|
TestSink sink_;
|
2017-02-01 08:38:12 -08:00
|
|
|
AdaptingFrameForwarder video_source_;
|
2017-08-03 08:27:51 -07:00
|
|
|
std::unique_ptr<VideoStreamEncoderUnderTest> video_stream_encoder_;
|
2017-06-27 07:06:52 -07:00
|
|
|
rtc::ScopedFakeClock fake_clock_;
|
2016-09-01 01:17:40 -07:00
|
|
|
};
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, EncodeOneFrame) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-09-01 01:17:40 -07:00
|
|
|
rtc::Event frame_destroyed_event(false, false);
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, &frame_destroyed_event));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-09-16 07:53:41 -07:00
|
|
|
EXPECT_TRUE(frame_destroyed_event.Wait(kDefaultTimeoutMs));
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, DropsFramesBeforeFirstOnBitrateUpdated) {
|
2016-09-01 01:17:40 -07:00
|
|
|
// Dropped since no target bitrate has been set.
|
|
|
|
|
rtc::Event frame_destroyed_event(false, false);
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, &frame_destroyed_event));
|
|
|
|
|
EXPECT_TRUE(frame_destroyed_event.Wait(kDefaultTimeoutMs));
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, DropsFramesWhenRateSetToZero) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(0, 0, 0);
|
2016-09-01 01:17:40 -07:00
|
|
|
// Dropped since bitrate is zero.
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr));
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(3, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(3);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, DropsFramesWithSameOrOldNtpTimestamp) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-09-01 01:17:40 -07:00
|
|
|
|
|
|
|
|
// This frame will be dropped since it has the same ntp timestamp.
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, DropsFrameAfterStop) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-09-01 01:17:40 -07:00
|
|
|
sink_.SetExpectNoFrames();
|
|
|
|
|
rtc::Event frame_destroyed_event(false, false);
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, &frame_destroyed_event));
|
|
|
|
|
EXPECT_TRUE(frame_destroyed_event.Wait(kDefaultTimeoutMs));
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, DropsPendingFramesOnSlowEncode) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-09-01 01:17:40 -07:00
|
|
|
|
|
|
|
|
fake_encoder_.BlockNextEncode();
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-09-01 01:17:40 -07:00
|
|
|
// Here, the encoder thread will be blocked in the TestEncoder waiting for a
|
|
|
|
|
// call to ContinueEncode.
|
2016-09-16 07:53:41 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr));
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(3, nullptr));
|
2016-09-01 01:17:40 -07:00
|
|
|
fake_encoder_.ContinueEncode();
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(3);
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
ConfigureEncoderTriggersOnEncoderConfigurationChanged) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-10-30 21:37:57 +01:00
|
|
|
EXPECT_EQ(0, sink_.number_of_reconfigurations());
|
2016-09-23 15:52:06 +02:00
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
2016-09-23 16:24:55 +02:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-10-30 21:37:57 +01:00
|
|
|
// The encoder will have been configured once when the first frame is
|
|
|
|
|
// received.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
2016-09-23 15:52:06 +02:00
|
|
|
|
|
|
|
|
VideoEncoderConfig video_encoder_config;
|
2016-10-02 23:45:26 -07:00
|
|
|
test::FillEncoderConfiguration(1, &video_encoder_config);
|
2016-09-23 15:52:06 +02:00
|
|
|
video_encoder_config.min_transmit_bitrate_bps = 9999;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->ConfigureEncoder(std::move(video_encoder_config),
|
|
|
|
|
kMaxPayloadLength,
|
|
|
|
|
true /* nack_enabled */);
|
2016-09-23 15:52:06 +02:00
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
2016-09-23 16:24:55 +02:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2016-10-30 21:37:57 +01:00
|
|
|
EXPECT_EQ(2, sink_.number_of_reconfigurations());
|
2016-09-29 23:25:40 -07:00
|
|
|
EXPECT_EQ(9999, sink_.last_min_transmit_bitrate());
|
2016-09-29 22:39:10 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-09-29 22:39:10 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, FrameResolutionChangeReconfigureEncoder) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-10-02 23:45:26 -07:00
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-10-30 21:37:57 +01:00
|
|
|
// The encoder will have been configured once.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
2016-10-02 23:45:26 -07:00
|
|
|
EXPECT_EQ(codec_width_, fake_encoder_.codec_config().width);
|
|
|
|
|
EXPECT_EQ(codec_height_, fake_encoder_.codec_config().height);
|
|
|
|
|
|
|
|
|
|
codec_width_ *= 2;
|
|
|
|
|
codec_height_ *= 2;
|
|
|
|
|
// Capture a frame with a higher resolution and wait for it to synchronize
|
|
|
|
|
// with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2016-10-02 23:45:26 -07:00
|
|
|
EXPECT_EQ(codec_width_, fake_encoder_.codec_config().width);
|
|
|
|
|
EXPECT_EQ(codec_height_, fake_encoder_.codec_config().height);
|
2016-10-30 21:37:57 +01:00
|
|
|
EXPECT_EQ(2, sink_.number_of_reconfigurations());
|
2016-10-02 23:45:26 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-10-02 23:45:26 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, Vp8ResilienceIsOffFor1S1TLWithNackEnabled) {
|
2016-11-25 04:37:00 -08:00
|
|
|
const bool kNackEnabled = true;
|
|
|
|
|
const size_t kNumStreams = 1;
|
|
|
|
|
const size_t kNumTl = 1;
|
2017-08-18 00:28:40 -07:00
|
|
|
ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled, false);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-25 04:37:00 -08:00
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-11-25 04:37:00 -08:00
|
|
|
// The encoder have been configured once when the first frame is received.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
|
|
|
|
EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType);
|
|
|
|
|
EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams);
|
|
|
|
|
EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers);
|
|
|
|
|
// Resilience is off for no temporal layers with nack on.
|
|
|
|
|
EXPECT_EQ(kResilienceOff, fake_encoder_.codec_config().VP8()->resilience);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-25 04:37:00 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, Vp8ResilienceIsOffFor2S1TlWithNackEnabled) {
|
2016-11-25 04:37:00 -08:00
|
|
|
const bool kNackEnabled = true;
|
|
|
|
|
const size_t kNumStreams = 2;
|
|
|
|
|
const size_t kNumTl = 1;
|
2017-08-18 00:28:40 -07:00
|
|
|
ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled, false);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-25 04:37:00 -08:00
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-11-25 04:37:00 -08:00
|
|
|
// The encoder have been configured once when the first frame is received.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
|
|
|
|
EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType);
|
|
|
|
|
EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams);
|
|
|
|
|
EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers);
|
|
|
|
|
// Resilience is off for no temporal layers and >1 streams with nack on.
|
|
|
|
|
EXPECT_EQ(kResilienceOff, fake_encoder_.codec_config().VP8()->resilience);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-25 04:37:00 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, Vp8ResilienceIsOnFor1S1TLWithNackDisabled) {
|
2016-11-25 04:37:00 -08:00
|
|
|
const bool kNackEnabled = false;
|
|
|
|
|
const size_t kNumStreams = 1;
|
|
|
|
|
const size_t kNumTl = 1;
|
2017-08-18 00:28:40 -07:00
|
|
|
ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled, false);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-25 04:37:00 -08:00
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-11-25 04:37:00 -08:00
|
|
|
// The encoder have been configured once when the first frame is received.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
|
|
|
|
EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType);
|
|
|
|
|
EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams);
|
|
|
|
|
EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers);
|
|
|
|
|
// Resilience is on for no temporal layers with nack off.
|
|
|
|
|
EXPECT_EQ(kResilientStream, fake_encoder_.codec_config().VP8()->resilience);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-25 04:37:00 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, Vp8ResilienceIsOnFor1S2TlWithNackEnabled) {
|
2016-11-25 04:37:00 -08:00
|
|
|
const bool kNackEnabled = true;
|
|
|
|
|
const size_t kNumStreams = 1;
|
|
|
|
|
const size_t kNumTl = 2;
|
2017-08-18 00:28:40 -07:00
|
|
|
ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled, false);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-25 04:37:00 -08:00
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-11-25 04:37:00 -08:00
|
|
|
// The encoder have been configured once when the first frame is received.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
|
|
|
|
EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType);
|
|
|
|
|
EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams);
|
|
|
|
|
EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers);
|
|
|
|
|
// Resilience is on for temporal layers.
|
|
|
|
|
EXPECT_EQ(kResilientStream, fake_encoder_.codec_config().VP8()->resilience);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-25 04:37:00 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-18 00:28:40 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, Vp9ResilienceIsOffFor1SL1TLWithNackEnabled) {
|
|
|
|
|
const bool kNackEnabled = true;
|
|
|
|
|
const size_t kNumStreams = 1;
|
|
|
|
|
const size_t kNumTl = 1;
|
|
|
|
|
const unsigned char kNumSl = 1;
|
|
|
|
|
ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled, false);
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
|
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
|
|
|
|
sink_.WaitForEncodedFrame(1);
|
|
|
|
|
// The encoder have been configured once when the first frame is received.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
|
|
|
|
EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType);
|
|
|
|
|
EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams);
|
|
|
|
|
EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers);
|
|
|
|
|
EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers);
|
|
|
|
|
// Resilience is off for no spatial and temporal layers with nack on.
|
|
|
|
|
EXPECT_FALSE(fake_encoder_.codec_config().VP9()->resilienceOn);
|
|
|
|
|
video_stream_encoder_->Stop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(VideoStreamEncoderTest, Vp9ResilienceIsOnFor1SL1TLWithNackDisabled) {
|
|
|
|
|
const bool kNackEnabled = false;
|
|
|
|
|
const size_t kNumStreams = 1;
|
|
|
|
|
const size_t kNumTl = 1;
|
|
|
|
|
const unsigned char kNumSl = 1;
|
|
|
|
|
ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled, false);
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
|
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
|
|
|
|
sink_.WaitForEncodedFrame(1);
|
|
|
|
|
// The encoder have been configured once when the first frame is received.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
|
|
|
|
EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType);
|
|
|
|
|
EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams);
|
|
|
|
|
EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers);
|
|
|
|
|
EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers);
|
|
|
|
|
// Resilience is on if nack is off.
|
|
|
|
|
EXPECT_TRUE(fake_encoder_.codec_config().VP9()->resilienceOn);
|
|
|
|
|
video_stream_encoder_->Stop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(VideoStreamEncoderTest, Vp9ResilienceIsOnFor2SL1TLWithNackEnabled) {
|
|
|
|
|
const bool kNackEnabled = true;
|
|
|
|
|
const size_t kNumStreams = 1;
|
|
|
|
|
const size_t kNumTl = 1;
|
|
|
|
|
const unsigned char kNumSl = 2;
|
|
|
|
|
ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled, false);
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
|
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
|
|
|
|
sink_.WaitForEncodedFrame(1);
|
|
|
|
|
// The encoder have been configured once when the first frame is received.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
|
|
|
|
EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType);
|
|
|
|
|
EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams);
|
|
|
|
|
EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers);
|
|
|
|
|
EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers);
|
|
|
|
|
// Resilience is on for spatial layers.
|
|
|
|
|
EXPECT_TRUE(fake_encoder_.codec_config().VP9()->resilienceOn);
|
|
|
|
|
video_stream_encoder_->Stop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(VideoStreamEncoderTest, Vp9ResilienceIsOnFor1SL2TLWithNackEnabled) {
|
|
|
|
|
const bool kNackEnabled = true;
|
|
|
|
|
const size_t kNumStreams = 1;
|
|
|
|
|
const size_t kNumTl = 2;
|
|
|
|
|
const unsigned char kNumSl = 1;
|
|
|
|
|
ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled, false);
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
|
|
|
|
|
|
|
|
|
// Capture a frame and wait for it to synchronize with the encoder thread.
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr));
|
|
|
|
|
sink_.WaitForEncodedFrame(1);
|
|
|
|
|
// The encoder have been configured once when the first frame is received.
|
|
|
|
|
EXPECT_EQ(1, sink_.number_of_reconfigurations());
|
|
|
|
|
EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType);
|
|
|
|
|
EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams);
|
|
|
|
|
EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers);
|
|
|
|
|
EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers);
|
|
|
|
|
// Resilience is on for temporal layers.
|
|
|
|
|
EXPECT_TRUE(fake_encoder_.codec_config().VP9()->resilienceOn);
|
|
|
|
|
video_stream_encoder_->Stop();
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, SwitchSourceDeregisterEncoderAsSink) {
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_TRUE(video_source_.has_sinks());
|
|
|
|
|
test::FrameForwarder new_video_source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainFramerate);
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_FALSE(video_source_.has_sinks());
|
|
|
|
|
EXPECT_TRUE(new_video_source.has_sinks());
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-01 11:45:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, SinkWantsRotationApplied) {
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_FALSE(video_source_.sink_wants().rotation_applied);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSink(&sink_, true /*rotation_applied*/);
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_TRUE(video_source_.sink_wants().rotation_applied);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-01 11:45:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
TEST_F(VideoStreamEncoderTest, TestCpuDowngrades_BalancedMode) {
|
|
|
|
|
const int kFramerateFps = 30;
|
2017-06-13 23:25:22 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-12-08 17:04:29 -08:00
|
|
|
|
|
|
|
|
// We rely on the automatic resolution adaptation, but we handle framerate
|
|
|
|
|
// adaptation manually by mocking the stats proxy.
|
|
|
|
|
video_source_.set_adaptation_enabled(true);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
// Enable kBalanced preference, no initial limitation.
|
2017-12-08 17:04:29 -08:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-12-08 17:04:29 -08:00
|
|
|
&video_source_,
|
2017-08-03 08:27:51 -07:00
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2017-12-08 17:04:29 -08:00
|
|
|
VerifyNoLimitation(video_source_.sink_wants());
|
2017-06-13 23:25:22 -07:00
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
2017-12-08 17:04:29 -08:00
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
2017-06-13 23:25:22 -07:00
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
// Adapt down as far as possible.
|
|
|
|
|
rtc::VideoSinkWants last_wants;
|
|
|
|
|
int64_t t = 1;
|
|
|
|
|
int loop_count = 0;
|
|
|
|
|
do {
|
|
|
|
|
++loop_count;
|
|
|
|
|
last_wants = video_source_.sink_wants();
|
|
|
|
|
|
|
|
|
|
// Simulate the framerate we've been asked to adapt to.
|
|
|
|
|
const int fps = std::min(kFramerateFps, last_wants.max_framerate_fps);
|
|
|
|
|
const int frame_interval_ms = rtc::kNumMillisecsPerSec / fps;
|
|
|
|
|
VideoSendStream::Stats mock_stats = stats_proxy_->GetStats();
|
|
|
|
|
mock_stats.input_frame_rate = fps;
|
|
|
|
|
stats_proxy_->SetMockStats(mock_stats);
|
|
|
|
|
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(t, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(t);
|
|
|
|
|
t += frame_interval_ms;
|
2017-06-13 23:25:22 -07:00
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
|
|
|
|
VerifyBalancedModeFpsRange(
|
|
|
|
|
video_source_.sink_wants(),
|
|
|
|
|
*video_source_.last_sent_width() * *video_source_.last_sent_height());
|
|
|
|
|
} while (video_source_.sink_wants().max_pixel_count <
|
|
|
|
|
last_wants.max_pixel_count ||
|
|
|
|
|
video_source_.sink_wants().max_framerate_fps <
|
|
|
|
|
last_wants.max_framerate_fps);
|
|
|
|
|
|
|
|
|
|
// Verify that we've adapted all the way down.
|
|
|
|
|
stats_proxy_->ResetMockStats();
|
2017-06-13 23:25:22 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
2017-12-08 17:04:29 -08:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(loop_count - 1,
|
2017-06-13 23:25:22 -07:00
|
|
|
stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
2017-12-08 17:04:29 -08:00
|
|
|
EXPECT_EQ(kMinPixelsPerFrame, *video_source_.last_sent_width() *
|
|
|
|
|
*video_source_.last_sent_height());
|
|
|
|
|
EXPECT_EQ(kMinBalancedFramerateFps,
|
|
|
|
|
video_source_.sink_wants().max_framerate_fps);
|
|
|
|
|
|
|
|
|
|
// Adapt back up the same number of times we adapted down.
|
|
|
|
|
for (int i = 0; i < loop_count - 1; ++i) {
|
|
|
|
|
last_wants = video_source_.sink_wants();
|
|
|
|
|
|
|
|
|
|
// Simulate the framerate we've been asked to adapt to.
|
|
|
|
|
const int fps = std::min(kFramerateFps, last_wants.max_framerate_fps);
|
|
|
|
|
const int frame_interval_ms = rtc::kNumMillisecsPerSec / fps;
|
|
|
|
|
VideoSendStream::Stats mock_stats = stats_proxy_->GetStats();
|
|
|
|
|
mock_stats.input_frame_rate = fps;
|
|
|
|
|
stats_proxy_->SetMockStats(mock_stats);
|
|
|
|
|
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(t, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(t);
|
|
|
|
|
t += frame_interval_ms;
|
2017-06-13 23:25:22 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-12-08 17:04:29 -08:00
|
|
|
VerifyBalancedModeFpsRange(
|
|
|
|
|
video_source_.sink_wants(),
|
|
|
|
|
*video_source_.last_sent_width() * *video_source_.last_sent_height());
|
|
|
|
|
EXPECT_TRUE(video_source_.sink_wants().max_pixel_count >
|
|
|
|
|
last_wants.max_pixel_count ||
|
|
|
|
|
video_source_.sink_wants().max_framerate_fps >
|
|
|
|
|
last_wants.max_framerate_fps);
|
2017-06-13 23:25:22 -07:00
|
|
|
}
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
VerifyNoLimitation(video_source_.sink_wants());
|
|
|
|
|
stats_proxy_->ResetMockStats();
|
2017-06-13 23:25:22 -07:00
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
2017-12-08 17:04:29 -08:00
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ((loop_count - 1) * 2,
|
|
|
|
|
stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-13 23:25:22 -07:00
|
|
|
}
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, SinkWantsStoredByDegradationPreference) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(video_source_.sink_wants());
|
2016-11-01 11:45:46 -07:00
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
|
|
|
|
const int kFrameIntervalMs = 1000 / 30;
|
|
|
|
|
|
|
|
|
|
int frame_timestamp = 1;
|
2016-11-01 11:45:46 -07:00
|
|
|
|
2016-12-01 03:59:51 -08:00
|
|
|
video_source_.IncomingCapturedFrame(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
CreateFrame(frame_timestamp, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(frame_timestamp);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
frame_timestamp += kFrameIntervalMs;
|
|
|
|
|
|
2016-11-01 11:45:46 -07:00
|
|
|
// Trigger CPU overuse.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
Reason for revert:
This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
Original issue's description:
> Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
>
> Reason for revert:
> Found issue with test case, will add fix to reland cl.
>
> Original issue's description:
> > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> >
> > Reason for revert:
> > Breaks perf tests:
> > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> >
> > Original issue's description:
> > > Add framerate to VideoSinkWants and ability to signal on overuse
> > >
> > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > current degradation preference is maintain-resolution rather than
> > > balanced.
> > >
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2716643002
> > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2764133002
> > Cr-Commit-Position: refs/heads/master@{#17331}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
>
> TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2781433002
> Cr-Commit-Position: refs/heads/master@{#17474}
> Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2783183003
Cr-Commit-Position: refs/heads/master@{#17477}
2017-03-30 10:44:38 -07:00
|
|
|
video_source_.IncomingCapturedFrame(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
CreateFrame(frame_timestamp, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(frame_timestamp);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
frame_timestamp += kFrameIntervalMs;
|
|
|
|
|
|
2017-04-07 00:57:58 -07:00
|
|
|
// Default degradation preference is maintain-framerate, so will lower max
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// wanted resolution.
|
2017-02-10 07:04:27 -08:00
|
|
|
EXPECT_FALSE(video_source_.sink_wants().target_pixel_count);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_LT(video_source_.sink_wants().max_pixel_count,
|
|
|
|
|
kFrameWidth * kFrameHeight);
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(),
|
|
|
|
|
video_source_.sink_wants().max_framerate_fps);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// Set new source, switch to maintain-resolution.
|
2016-11-01 11:45:46 -07:00
|
|
|
test::FrameForwarder new_video_source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2016-11-01 11:45:46 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// Initially no degradation registered.
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(new_video_source.sink_wants());
|
2016-11-01 11:45:46 -07:00
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// Force an input frame rate to be available, or the adaptation call won't
|
|
|
|
|
// know what framerate to adapt form.
|
2017-04-10 01:12:52 -07:00
|
|
|
const int kInputFps = 30;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
2017-04-10 01:12:52 -07:00
|
|
|
stats.input_frame_rate = kInputFps;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
stats_proxy_->SetMockStats(stats);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2016-11-01 11:45:46 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
CreateFrame(frame_timestamp, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(frame_timestamp);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
frame_timestamp += kFrameIntervalMs;
|
|
|
|
|
|
|
|
|
|
// Some framerate constraint should be set.
|
|
|
|
|
EXPECT_FALSE(new_video_source.sink_wants().target_pixel_count);
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(),
|
|
|
|
|
new_video_source.sink_wants().max_pixel_count);
|
2017-04-10 01:12:52 -07:00
|
|
|
EXPECT_LT(new_video_source.sink_wants().max_framerate_fps, kInputFps);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
2017-04-10 01:12:52 -07:00
|
|
|
// Turn off degradation completely.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kDegradationDisabled);
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(new_video_source.sink_wants());
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(frame_timestamp, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(frame_timestamp);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
frame_timestamp += kFrameIntervalMs;
|
|
|
|
|
|
|
|
|
|
// Still no degradation.
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(new_video_source.sink_wants());
|
2016-11-01 11:45:46 -07:00
|
|
|
|
|
|
|
|
// Calling SetSource with resolution scaling enabled apply the old SinkWants.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainFramerate);
|
|
|
|
|
EXPECT_LT(new_video_source.sink_wants().max_pixel_count,
|
|
|
|
|
kFrameWidth * kFrameHeight);
|
|
|
|
|
EXPECT_FALSE(new_video_source.sink_wants().target_pixel_count);
|
|
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(),
|
|
|
|
|
new_video_source.sink_wants().max_framerate_fps);
|
|
|
|
|
|
|
|
|
|
// Calling SetSource with framerate scaling enabled apply the old SinkWants.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
2017-02-10 07:04:27 -08:00
|
|
|
EXPECT_FALSE(new_video_source.sink_wants().target_pixel_count);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(),
|
|
|
|
|
new_video_source.sink_wants().max_pixel_count);
|
2017-04-10 01:12:52 -07:00
|
|
|
EXPECT_LT(new_video_source.sink_wants().max_framerate_fps, kInputFps);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-01 11:45:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, StatsTracksQualityAdaptationStats) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2017-04-04 05:51:49 -07:00
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats.number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2017-04-04 05:51:49 -07:00
|
|
|
|
|
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_TRUE(stats.bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats.number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(3);
|
2017-04-04 05:51:49 -07:00
|
|
|
|
|
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(2, stats.number_of_quality_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-04-04 05:51:49 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, StatsTracksCpuAdaptationStats) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-04 05:51:49 -07:00
|
|
|
|
|
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-11-01 11:45:46 -07:00
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger CPU overuse.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
|
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_TRUE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger CPU normal use.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(3);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
|
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(2, stats.number_of_cpu_adapt_changes);
|
2017-04-04 05:51:49 -07:00
|
|
|
EXPECT_EQ(0, stats.number_of_quality_adapt_changes);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-01 11:45:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, SwitchingSourceKeepsCpuAdaptation) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-11-29 01:44:11 -08:00
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
2016-11-29 01:44:11 -08:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Trigger CPU overuse.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2016-11-29 01:44:11 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
2016-11-29 01:44:11 -08:00
|
|
|
EXPECT_TRUE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Set new source with adaptation still enabled.
|
|
|
|
|
test::FrameForwarder new_video_source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainFramerate);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(3);
|
2016-11-29 01:44:11 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
2016-11-29 01:44:11 -08:00
|
|
|
EXPECT_TRUE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Set adaptation disabled.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2016-11-29 01:44:11 -08:00
|
|
|
&new_video_source,
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
VideoSendStream::DegradationPreference::kDegradationDisabled);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(4, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(4);
|
2016-11-29 01:44:11 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
2016-11-29 01:44:11 -08:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Set adaptation back to enabled.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainFramerate);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(5, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(5);
|
2016-11-29 01:44:11 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
2016-11-29 01:44:11 -08:00
|
|
|
EXPECT_TRUE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Trigger CPU normal use.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(6, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(6);
|
2016-11-29 01:44:11 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
2016-11-29 01:44:11 -08:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(2, stats.number_of_cpu_adapt_changes);
|
2017-04-10 01:12:52 -07:00
|
|
|
EXPECT_EQ(0, stats.number_of_quality_adapt_changes);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-29 01:44:11 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, SwitchingSourceKeepsQualityAdaptation) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-11-29 01:44:11 -08:00
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_framerate);
|
2017-04-04 05:51:49 -07:00
|
|
|
EXPECT_EQ(0, stats.number_of_quality_adapt_changes);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
|
|
|
|
// Set new source with adaptation still enabled.
|
|
|
|
|
test::FrameForwarder new_video_source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2016-11-29 01:44:11 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_framerate);
|
2017-04-04 05:51:49 -07:00
|
|
|
EXPECT_EQ(0, stats.number_of_quality_adapt_changes);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Trigger adapt down.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(3);
|
2016-11-29 01:44:11 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_TRUE(stats.bw_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_framerate);
|
2017-04-04 05:51:49 -07:00
|
|
|
EXPECT_EQ(1, stats.number_of_quality_adapt_changes);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Set new source with adaptation still enabled.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(4, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(4);
|
2016-11-29 01:44:11 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_TRUE(stats.bw_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_framerate);
|
2017-04-04 05:51:49 -07:00
|
|
|
EXPECT_EQ(1, stats.number_of_quality_adapt_changes);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-10 01:12:52 -07:00
|
|
|
// Disable resolution scaling.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2016-11-29 01:44:11 -08:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(5, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(5);
|
2016-11-29 01:44:11 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.bw_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.bw_limited_framerate);
|
2017-04-04 05:51:49 -07:00
|
|
|
EXPECT_EQ(1, stats.number_of_quality_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats.number_of_cpu_adapt_changes);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-29 01:44:11 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
QualityAdaptationStatsAreResetWhenScalerIsDisabled) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-03-31 05:29:12 -07:00
|
|
|
|
|
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
video_source_.set_adaptation_enabled(true);
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2017-03-31 05:29:12 -07:00
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-03-31 05:29:12 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2017-03-31 05:29:12 -07:00
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger overuse.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-03-31 05:29:12 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(3);
|
2017-03-31 05:29:12 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Set source with adaptation still enabled but quality scaler is off.
|
|
|
|
|
fake_encoder_.SetQualityScaling(false);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&video_source_,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainFramerate);
|
2017-03-31 05:29:12 -07:00
|
|
|
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(4, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(4);
|
2017-03-31 05:29:12 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-03-31 05:29:12 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
StatsTracksCpuAdaptationStatsWhenSwitchingSource) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
2017-04-07 00:57:58 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-02-10 07:04:27 -08:00
|
|
|
int sequence = 1;
|
2016-11-01 11:45:46 -07:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
2016-11-01 11:45:46 -07:00
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
2017-02-10 07:04:27 -08:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_framerate);
|
2017-02-10 07:04:27 -08:00
|
|
|
EXPECT_EQ(0, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-04-10 01:12:52 -07:00
|
|
|
// Trigger CPU overuse, should now adapt down.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
2017-02-10 07:04:27 -08:00
|
|
|
stats = stats_proxy_->GetStats();
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_TRUE(stats.cpu_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_framerate);
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_EQ(1, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Set new source with adaptation still enabled.
|
|
|
|
|
test::FrameForwarder new_video_source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainFramerate);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
|
|
|
|
new_video_source.IncomingCapturedFrame(
|
2017-04-04 05:51:49 -07:00
|
|
|
CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
2016-11-01 11:45:46 -07:00
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_TRUE(stats.cpu_limited_resolution);
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_framerate);
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_EQ(1, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// Set cpu adaptation by frame dropping.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2016-11-01 11:45:46 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
new_video_source.IncomingCapturedFrame(
|
2017-04-04 05:51:49 -07:00
|
|
|
CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
2016-11-01 11:45:46 -07:00
|
|
|
stats = stats_proxy_->GetStats();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// Not adapted at first.
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_framerate);
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_EQ(1, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// Force an input frame rate to be available, or the adaptation call won't
|
2017-05-15 23:40:18 -07:00
|
|
|
// know what framerate to adapt from.
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
VideoSendStream::Stats mock_stats = stats_proxy_->GetStats();
|
|
|
|
|
mock_stats.input_frame_rate = 30;
|
|
|
|
|
stats_proxy_->SetMockStats(mock_stats);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
stats_proxy_->ResetMockStats();
|
|
|
|
|
|
|
|
|
|
new_video_source.IncomingCapturedFrame(
|
2017-04-04 05:51:49 -07:00
|
|
|
CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
|
|
|
|
// Framerate now adapted.
|
|
|
|
|
stats = stats_proxy_->GetStats();
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats.cpu_limited_framerate);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(2, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Disable CPU adaptation.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kDegradationDisabled);
|
|
|
|
|
new_video_source.IncomingCapturedFrame(
|
2017-04-04 05:51:49 -07:00
|
|
|
CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
|
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_framerate);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(2, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Try to trigger overuse. Should not succeed.
|
|
|
|
|
stats_proxy_->SetMockStats(mock_stats);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
stats_proxy_->ResetMockStats();
|
|
|
|
|
|
|
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_framerate);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(2, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Switch back the source with resolution adaptation enabled.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&video_source_,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainFramerate);
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
2016-11-01 11:45:46 -07:00
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_TRUE(stats.cpu_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_framerate);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(2, stats.number_of_cpu_adapt_changes);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
|
|
|
|
// Trigger CPU normal usage.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
2016-11-01 11:45:46 -07:00
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_framerate);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(3, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Back to the source with adaptation off, set it back to maintain-resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
new_video_source.IncomingCapturedFrame(
|
2017-04-04 05:51:49 -07:00
|
|
|
CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
stats = stats_proxy_->GetStats();
|
2017-06-07 00:01:02 -07:00
|
|
|
// Disabled, since we previously switched the source to disabled.
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_TRUE(stats.cpu_limited_framerate);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(3, stats.number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger CPU normal usage.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(
|
2017-04-04 05:51:49 -07:00
|
|
|
CreateFrame(sequence, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(sequence++);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_FALSE(stats.cpu_limited_resolution);
|
2017-06-07 00:01:02 -07:00
|
|
|
EXPECT_FALSE(stats.cpu_limited_framerate);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(4, stats.number_of_cpu_adapt_changes);
|
2017-04-10 01:12:52 -07:00
|
|
|
EXPECT_EQ(0, stats.number_of_quality_adapt_changes);
|
2016-11-01 11:45:46 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-01 11:45:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, StatsTracksPreferredBitrate) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-16 16:41:30 +01:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-11-16 16:41:30 +01:00
|
|
|
|
|
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
|
|
|
|
EXPECT_EQ(video_encoder_config_.max_bitrate_bps,
|
|
|
|
|
stats.preferred_media_bitrate_bps);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-16 16:41:30 +01:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
ScalingUpAndDownDoesNothingWithMaintainResolution) {
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Expect no scaling to begin with.
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(video_source_.sink_wants());
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Trigger scale down.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2016-12-01 03:59:51 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2016-12-01 03:59:51 -08:00
|
|
|
|
2016-11-29 01:44:11 -08:00
|
|
|
// Expect a scale down.
|
|
|
|
|
EXPECT_TRUE(video_source_.sink_wants().max_pixel_count);
|
2017-04-04 05:51:49 -07:00
|
|
|
EXPECT_LT(video_source_.sink_wants().max_pixel_count, kWidth * kHeight);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-10 01:12:52 -07:00
|
|
|
// Set resolution scaling disabled.
|
2016-11-29 01:44:11 -08:00
|
|
|
test::FrameForwarder new_video_source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2016-11-29 01:44:11 -08:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Trigger scale down.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(3);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Expect no scaling.
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(),
|
|
|
|
|
new_video_source.sink_wants().max_pixel_count);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Trigger scale up.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-04-04 05:51:49 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(4, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(4);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-04-10 01:12:52 -07:00
|
|
|
// Expect nothing to change, still no scaling.
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_EQ(std::numeric_limits<int>::max(),
|
|
|
|
|
new_video_source.sink_wants().max_pixel_count);
|
2016-11-29 01:44:11 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-11-29 01:44:11 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
SkipsSameAdaptDownRequest_MaintainFramerateMode) {
|
2017-04-10 01:12:52 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-10 01:12:52 -07:00
|
|
|
|
|
|
|
|
// Enable kMaintainFramerate preference, no initial limitation.
|
|
|
|
|
test::FrameForwarder source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-04-10 01:12:52 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainFramerate);
|
|
|
|
|
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
2017-04-10 01:12:52 -07:00
|
|
|
const int kLastMaxPixelCount = source.sink_wants().max_pixel_count;
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down for same input resolution, expect no change.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-10 01:12:52 -07:00
|
|
|
EXPECT_EQ(kLastMaxPixelCount, source.sink_wants().max_pixel_count);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-04-10 01:12:52 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, SkipsSameOrLargerAdaptDownRequest_BalancedMode) {
|
2017-06-13 23:25:22 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
// Enable kBalanced preference, no initial limitation.
|
|
|
|
|
test::FrameForwarder source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2017-06-13 23:25:22 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(1);
|
|
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
const int kLastMaxPixelCount = source.sink_wants().max_pixel_count;
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down for same input resolution, expect no change.
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(2);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
EXPECT_EQ(kLastMaxPixelCount, source.sink_wants().max_pixel_count);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down for larger input resolution, expect no change.
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(3, kWidth + 1, kHeight + 1));
|
|
|
|
|
sink_.WaitForEncodedFrame(3);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
EXPECT_EQ(kLastMaxPixelCount, source.sink_wants().max_pixel_count);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-13 23:25:22 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
NoChangeForInitialNormalUsage_MaintainFramerateMode) {
|
2017-04-10 01:12:52 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-10 01:12:52 -07:00
|
|
|
|
|
|
|
|
// Enable kMaintainFramerate preference, no initial limitation.
|
|
|
|
|
test::FrameForwarder source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-04-10 01:12:52 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainFramerate);
|
|
|
|
|
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no change.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-04-10 01:12:52 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
NoChangeForInitialNormalUsage_MaintainResolutionMode) {
|
2017-04-10 01:12:52 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-10 01:12:52 -07:00
|
|
|
|
|
|
|
|
// Enable kMaintainResolution preference, no initial limitation.
|
|
|
|
|
test::FrameForwarder source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-04-10 01:12:52 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
2017-04-10 01:12:52 -07:00
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no change.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
2017-05-15 23:40:18 -07:00
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
2017-04-10 01:12:52 -07:00
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-04-10 01:12:52 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, NoChangeForInitialNormalUsage_BalancedMode) {
|
2017-06-13 23:25:22 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
// Enable kBalanced preference, no initial limitation.
|
|
|
|
|
test::FrameForwarder source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(kWidth, kHeight);
|
|
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no change.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-13 23:25:22 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, NoChangeForInitialNormalUsage_DisabledMode) {
|
2017-05-15 23:40:18 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-05-15 23:40:18 -07:00
|
|
|
|
|
|
|
|
// Enable kDegradationDisabled preference, no initial limitation.
|
|
|
|
|
test::FrameForwarder source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-05-15 23:40:18 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kDegradationDisabled);
|
|
|
|
|
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(kWidth, kHeight);
|
|
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no change.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-05-15 23:40:18 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
AdaptsResolutionForLowQuality_MaintainFramerateMode) {
|
2017-04-10 01:12:52 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-10 01:12:52 -07:00
|
|
|
|
|
|
|
|
// Enable kMaintainFramerate preference, no initial limitation.
|
|
|
|
|
AdaptingFrameForwarder source;
|
|
|
|
|
source.set_adaptation_enabled(true);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-04-10 01:12:52 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainFramerate);
|
|
|
|
|
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-04-10 01:12:52 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
2017-04-10 01:12:52 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no restriction.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-04-10 01:12:52 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-04-10 01:12:52 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
AdaptsFramerateForLowQuality_MaintainResolutionMode) {
|
2017-05-15 23:40:18 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
const int kInputFps = 30;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-05-15 23:40:18 -07:00
|
|
|
|
|
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
|
|
|
|
stats.input_frame_rate = kInputFps;
|
|
|
|
|
stats_proxy_->SetMockStats(stats);
|
|
|
|
|
|
|
|
|
|
// Expect no scaling to begin with (preference: kMaintainFramerate).
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(1);
|
|
|
|
|
VerifyNoLimitation(video_source_.sink_wants());
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-05-15 23:40:18 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(2);
|
|
|
|
|
VerifyFpsMaxResolutionLt(video_source_.sink_wants(), kWidth * kHeight);
|
|
|
|
|
|
|
|
|
|
// Enable kMaintainResolution preference.
|
|
|
|
|
test::FrameForwarder new_video_source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-05-15 23:40:18 -07:00
|
|
|
&new_video_source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
VerifyNoLimitation(new_video_source.sink_wants());
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect reduced framerate.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-05-15 23:40:18 -07:00
|
|
|
new_video_source.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(3);
|
|
|
|
|
VerifyFpsLtResolutionMax(new_video_source.sink_wants(), kInputFps);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no restriction.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyNoLimitation(new_video_source.sink_wants());
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-05-15 23:40:18 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, DoesNotScaleBelowSetResolutionLimit) {
|
2017-04-21 01:47:31 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
const size_t kNumFrames = 10;
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2016-12-01 03:59:51 -08:00
|
|
|
|
2017-04-21 01:47:31 -07:00
|
|
|
// Enable adapter, expected input resolutions when downscaling:
|
2017-08-17 08:58:54 -07:00
|
|
|
// 1280x720 -> 960x540 -> 640x360 -> 480x270 -> 320x180 (kMinPixelsPerFrame)
|
2017-04-21 01:47:31 -07:00
|
|
|
video_source_.set_adaptation_enabled(true);
|
|
|
|
|
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
int downscales = 0;
|
|
|
|
|
for (size_t i = 1; i <= kNumFrames; i++) {
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(i, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(i);
|
2017-04-21 01:47:31 -07:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Trigger scale down.
|
2017-04-21 01:47:31 -07:00
|
|
|
rtc::VideoSinkWants last_wants = video_source_.sink_wants();
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_GE(video_source_.sink_wants().max_pixel_count, kMinPixelsPerFrame);
|
2017-04-21 01:47:31 -07:00
|
|
|
|
|
|
|
|
if (video_source_.sink_wants().max_pixel_count < last_wants.max_pixel_count)
|
|
|
|
|
++downscales;
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(downscales,
|
|
|
|
|
stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
EXPECT_GT(downscales, 0);
|
2016-12-01 03:59:51 -08:00
|
|
|
}
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-04-21 01:47:31 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
2017-04-21 01:47:31 -07:00
|
|
|
AdaptsResolutionUpAndDownTwiceOnOveruse_MaintainFramerateMode) {
|
|
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-21 01:47:31 -07:00
|
|
|
|
|
|
|
|
// Enable kMaintainFramerate preference, no initial limitation.
|
|
|
|
|
AdaptingFrameForwarder source;
|
|
|
|
|
source.set_adaptation_enabled(true);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-04-21 01:47:31 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainFramerate);
|
|
|
|
|
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-04-21 01:47:31 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no restriction.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-04-21 01:47:31 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(4, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(4);
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(3, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no restriction.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-05-15 23:40:18 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(5, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(kWidth, kHeight);
|
2017-04-21 01:47:31 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(4, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-04-21 01:47:31 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
2017-06-13 23:25:22 -07:00
|
|
|
AdaptsResolutionUpAndDownTwiceForLowQuality_BalancedMode_NoFpsLimit) {
|
|
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
// Enable kBalanced preference, no initial limitation.
|
|
|
|
|
AdaptingFrameForwarder source;
|
|
|
|
|
source.set_adaptation_enabled(true);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(kWidth, kHeight);
|
|
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(2);
|
|
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no restriction.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(kWidth, kHeight);
|
|
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(4, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(4);
|
|
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(3, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no restriction.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(5, kWidth, kHeight));
|
|
|
|
|
sink_.WaitForEncodedFrame(kWidth, kHeight);
|
|
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(4, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-13 23:25:22 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
2017-04-21 01:47:31 -07:00
|
|
|
AdaptsResolutionOnOveruseAndLowQuality_MaintainFramerateMode) {
|
|
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-21 01:47:31 -07:00
|
|
|
|
|
|
|
|
// Enable kMaintainFramerate preference, no initial limitation.
|
|
|
|
|
AdaptingFrameForwarder source;
|
|
|
|
|
source.set_adaptation_enabled(true);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-04-21 01:47:31 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainFramerate);
|
|
|
|
|
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-04-21 01:47:31 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt down, expect scaled down resolution (960x540).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(2, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt down, expect scaled down resolution (640x360).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(3, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(3);
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), source.last_wants());
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
// Trigger cpu adapt down, expect scaled down resolution (480x270).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(4, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(4);
|
2017-12-08 17:04:29 -08:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), source.last_wants());
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
2017-12-08 17:04:29 -08:00
|
|
|
EXPECT_EQ(3, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
// Trigger quality adapt down, expect scaled down resolution (320x180).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(5, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(5);
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), source.last_wants());
|
2017-12-08 17:04:29 -08:00
|
|
|
rtc::VideoSinkWants last_wants = source.sink_wants();
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
2017-12-08 17:04:29 -08:00
|
|
|
EXPECT_EQ(3, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
// Trigger quality adapt down, expect no change (min resolution reached).
|
|
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(6, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(6);
|
2017-12-08 17:04:29 -08:00
|
|
|
VerifyFpsMaxResolutionEq(source.sink_wants(), last_wants);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(3, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
// Trigger cpu adapt up, expect upscaled resolution (480x270).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(7, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(7);
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsMaxResolutionGt(source.sink_wants(), source.last_wants());
|
2017-12-08 17:04:29 -08:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(4, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
// Trigger cpu adapt up, expect upscaled resolution (640x360).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-04-21 01:47:31 -07:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(8, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(8);
|
2017-12-08 17:04:29 -08:00
|
|
|
VerifyFpsMaxResolutionGt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(5, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt up, expect upscaled resolution (960x540).
|
|
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(9, kWidth, kHeight));
|
|
|
|
|
WaitForEncodedFrame(9);
|
|
|
|
|
VerifyFpsMaxResolutionGt(source.sink_wants(), source.last_wants());
|
|
|
|
|
last_wants = source.sink_wants();
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_EQ(6, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt up, no cpu downgrades, expect no change (960x540).
|
|
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(10, kWidth, kHeight));
|
|
|
|
|
WaitForEncodedFrame(10);
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsEqResolutionEq(source.sink_wants(), last_wants);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
2017-12-08 17:04:29 -08:00
|
|
|
EXPECT_EQ(6, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger quality adapt up, expect no restriction (1280x720).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-12-08 17:04:29 -08:00
|
|
|
source.IncomingCapturedFrame(CreateFrame(11, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-05-15 23:40:18 -07:00
|
|
|
VerifyFpsMaxResolutionGt(source.sink_wants(), source.last_wants());
|
2017-04-21 01:47:31 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
2017-12-08 17:04:29 -08:00
|
|
|
EXPECT_EQ(6, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
2017-04-21 01:47:31 -07:00
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
2016-12-01 03:59:51 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2016-12-01 03:59:51 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, CpuLimitedHistogramIsReported) {
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 640;
|
|
|
|
|
const int kHeight = 360;
|
2016-11-01 11:45:46 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-27 07:06:52 -07:00
|
|
|
|
2016-11-01 11:45:46 -07:00
|
|
|
for (int i = 1; i <= SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) {
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(i, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(i);
|
2016-11-01 11:45:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2016-11-01 11:45:46 -07:00
|
|
|
for (int i = 1; i <= SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) {
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(
|
|
|
|
|
SendStatisticsProxy::kMinRequiredMetricsSamples + i, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(SendStatisticsProxy::kMinRequiredMetricsSamples + i);
|
2016-11-01 11:45:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
|
|
|
|
video_stream_encoder_.reset();
|
2016-11-01 11:45:46 -07:00
|
|
|
stats_proxy_.reset();
|
2017-02-28 08:49:33 -08:00
|
|
|
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_EQ(1,
|
|
|
|
|
metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent"));
|
|
|
|
|
EXPECT_EQ(
|
|
|
|
|
1, metrics::NumEvents("WebRTC.Video.CpuLimitedResolutionInPercent", 50));
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
CpuLimitedHistogramIsNotReportedForDisabledDegradation) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-19 02:01:06 -07:00
|
|
|
const int kWidth = 640;
|
|
|
|
|
const int kHeight = 360;
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-04-19 02:01:06 -07:00
|
|
|
&video_source_,
|
|
|
|
|
VideoSendStream::DegradationPreference::kDegradationDisabled);
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) {
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(i, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(i);
|
2017-04-19 02:01:06 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
|
|
|
|
video_stream_encoder_.reset();
|
2017-04-19 02:01:06 -07:00
|
|
|
stats_proxy_.reset();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(0,
|
|
|
|
|
metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent"));
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, CallsBitrateObserver) {
|
2017-06-27 07:06:52 -07:00
|
|
|
MockBitrateObserver bitrate_observer;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetBitrateObserver(&bitrate_observer);
|
2017-01-16 06:24:02 -08:00
|
|
|
|
|
|
|
|
const int kDefaultFps = 30;
|
|
|
|
|
const BitrateAllocation expected_bitrate =
|
|
|
|
|
DefaultVideoBitrateAllocator(fake_encoder_.codec_config())
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
.GetAllocation(kLowTargetBitrateBps, kDefaultFps);
|
2017-01-16 06:24:02 -08:00
|
|
|
|
|
|
|
|
// First called on bitrate updated, then again on first frame.
|
|
|
|
|
EXPECT_CALL(bitrate_observer, OnBitrateAllocationUpdated(expected_bitrate))
|
|
|
|
|
.Times(2);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kLowTargetBitrateBps, 0, 0);
|
2017-01-16 06:24:02 -08:00
|
|
|
|
|
|
|
|
const int64_t kStartTimeMs = 1;
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(kStartTimeMs, codec_width_, codec_height_));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kStartTimeMs);
|
2017-01-16 06:24:02 -08:00
|
|
|
|
|
|
|
|
// Not called on second frame.
|
|
|
|
|
EXPECT_CALL(bitrate_observer, OnBitrateAllocationUpdated(expected_bitrate))
|
|
|
|
|
.Times(0);
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(kStartTimeMs + 1, codec_width_, codec_height_));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kStartTimeMs + 1);
|
2017-01-16 06:24:02 -08:00
|
|
|
|
|
|
|
|
// Called after a process interval.
|
|
|
|
|
const int64_t kProcessIntervalMs =
|
|
|
|
|
vcm::VCMProcessTimer::kDefaultProcessIntervalMs;
|
2017-06-27 07:06:52 -07:00
|
|
|
fake_clock_.AdvanceTimeMicros(rtc::kNumMicrosecsPerMillisec *
|
|
|
|
|
(kProcessIntervalMs + (1000 / kDefaultFps)));
|
2017-01-16 06:24:02 -08:00
|
|
|
EXPECT_CALL(bitrate_observer, OnBitrateAllocationUpdated(expected_bitrate))
|
|
|
|
|
.Times(1);
|
|
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(
|
|
|
|
|
kStartTimeMs + kProcessIntervalMs, codec_width_, codec_height_));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kStartTimeMs + kProcessIntervalMs);
|
2017-01-16 06:24:02 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-01-16 06:24:02 -08:00
|
|
|
}
|
|
|
|
|
|
2017-12-06 10:27:48 +01:00
|
|
|
TEST_F(VideoStreamEncoderTest, OveruseDetectorUpdatedOnReconfigureAndAdaption) {
|
|
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
|
|
|
|
const int kFramerate = 24;
|
|
|
|
|
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
|
|
|
|
test::FrameForwarder source;
|
|
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
|
|
|
|
|
// Insert a single frame, triggering initial configuration.
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kFrameWidth, kFrameHeight));
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate(),
|
|
|
|
|
kDefaultFramerate);
|
|
|
|
|
|
|
|
|
|
// Trigger reconfigure encoder (without resetting the entire instance).
|
|
|
|
|
VideoEncoderConfig video_encoder_config;
|
|
|
|
|
video_encoder_config.max_bitrate_bps = kTargetBitrateBps;
|
|
|
|
|
video_encoder_config.number_of_streams = 1;
|
|
|
|
|
video_encoder_config.video_stream_factory =
|
|
|
|
|
new rtc::RefCountedObject<VideoStreamFactory>(1, kFramerate);
|
|
|
|
|
video_stream_encoder_->ConfigureEncoder(std::move(video_encoder_config),
|
|
|
|
|
kMaxPayloadLength, false);
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
|
|
|
|
|
|
|
|
|
// Detector should be updated with fps limit from codec config.
|
|
|
|
|
EXPECT_EQ(
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate(),
|
|
|
|
|
kFramerate);
|
|
|
|
|
|
|
|
|
|
// Trigger overuse, max framerate should be reduced.
|
|
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
|
|
|
|
stats.input_frame_rate = kFramerate;
|
|
|
|
|
stats_proxy_->SetMockStats(stats);
|
|
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
|
|
|
|
int adapted_framerate =
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate();
|
|
|
|
|
EXPECT_LT(adapted_framerate, kFramerate);
|
|
|
|
|
|
|
|
|
|
// Trigger underuse, max framerate should go back to codec configured fps.
|
|
|
|
|
// Set extra low fps, to make sure it's actually reset, not just incremented.
|
|
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
stats.input_frame_rate = adapted_framerate / 2;
|
|
|
|
|
stats_proxy_->SetMockStats(stats);
|
|
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
|
|
|
|
EXPECT_EQ(
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate(),
|
|
|
|
|
kFramerate);
|
|
|
|
|
|
|
|
|
|
video_stream_encoder_->Stop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
OveruseDetectorUpdatedRespectsFramerateAfterUnderuse) {
|
|
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
|
|
|
|
const int kLowFramerate = 15;
|
|
|
|
|
const int kHighFramerate = 25;
|
|
|
|
|
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
|
|
|
|
test::FrameForwarder source;
|
|
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
|
|
|
|
|
// Trigger initial configuration.
|
|
|
|
|
VideoEncoderConfig video_encoder_config;
|
|
|
|
|
video_encoder_config.max_bitrate_bps = kTargetBitrateBps;
|
|
|
|
|
video_encoder_config.number_of_streams = 1;
|
|
|
|
|
video_encoder_config.video_stream_factory =
|
|
|
|
|
new rtc::RefCountedObject<VideoStreamFactory>(1, kLowFramerate);
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kFrameWidth, kFrameHeight));
|
|
|
|
|
video_stream_encoder_->ConfigureEncoder(std::move(video_encoder_config),
|
|
|
|
|
kMaxPayloadLength, false);
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate(),
|
|
|
|
|
kLowFramerate);
|
|
|
|
|
|
|
|
|
|
// Trigger overuse, max framerate should be reduced.
|
|
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
|
|
|
|
stats.input_frame_rate = kLowFramerate;
|
|
|
|
|
stats_proxy_->SetMockStats(stats);
|
|
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
|
|
|
|
int adapted_framerate =
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate();
|
|
|
|
|
EXPECT_LT(adapted_framerate, kLowFramerate);
|
|
|
|
|
|
|
|
|
|
// Reconfigure the encoder with a new (higher max framerate), max fps should
|
|
|
|
|
// still respect the adaptation.
|
|
|
|
|
video_encoder_config.video_stream_factory =
|
|
|
|
|
new rtc::RefCountedObject<VideoStreamFactory>(1, kHighFramerate);
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kFrameWidth, kFrameHeight));
|
|
|
|
|
video_stream_encoder_->ConfigureEncoder(std::move(video_encoder_config),
|
|
|
|
|
kMaxPayloadLength, false);
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate(),
|
|
|
|
|
adapted_framerate);
|
|
|
|
|
|
|
|
|
|
// Trigger underuse, max framerate should go back to codec configured fps.
|
|
|
|
|
stats = stats_proxy_->GetStats();
|
|
|
|
|
stats.input_frame_rate = adapted_framerate;
|
|
|
|
|
stats_proxy_->SetMockStats(stats);
|
|
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
|
|
|
|
EXPECT_EQ(
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate(),
|
|
|
|
|
kHighFramerate);
|
|
|
|
|
|
|
|
|
|
video_stream_encoder_->Stop();
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
OveruseDetectorUpdatedOnDegradationPreferenceChange) {
|
2017-06-15 04:21:07 -07:00
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
|
|
|
|
const int kFramerate = 24;
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-15 04:21:07 -07:00
|
|
|
test::FrameForwarder source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-06-15 04:21:07 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
|
|
|
|
|
// Trigger initial configuration.
|
|
|
|
|
VideoEncoderConfig video_encoder_config;
|
|
|
|
|
video_encoder_config.max_bitrate_bps = kTargetBitrateBps;
|
|
|
|
|
video_encoder_config.number_of_streams = 1;
|
|
|
|
|
video_encoder_config.video_stream_factory =
|
|
|
|
|
new rtc::RefCountedObject<VideoStreamFactory>(1, kFramerate);
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kFrameWidth, kFrameHeight));
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->ConfigureEncoder(std::move(video_encoder_config),
|
|
|
|
|
kMaxPayloadLength, false);
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
2017-06-15 04:21:07 -07:00
|
|
|
|
2017-12-06 10:27:48 +01:00
|
|
|
EXPECT_EQ(
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate(),
|
|
|
|
|
kFramerate);
|
2017-06-15 04:21:07 -07:00
|
|
|
|
|
|
|
|
// Trigger overuse, max framerate should be reduced.
|
|
|
|
|
VideoSendStream::Stats stats = stats_proxy_->GetStats();
|
|
|
|
|
stats.input_frame_rate = kFramerate;
|
|
|
|
|
stats_proxy_->SetMockStats(stats);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
2017-12-06 10:27:48 +01:00
|
|
|
int adapted_framerate =
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate();
|
2017-06-15 04:21:07 -07:00
|
|
|
EXPECT_LT(adapted_framerate, kFramerate);
|
|
|
|
|
|
|
|
|
|
// Change degradation preference to not enable framerate scaling. Target
|
|
|
|
|
// framerate should be changed to codec defined limit.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-06-15 04:21:07 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainFramerate);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
2017-12-06 10:27:48 +01:00
|
|
|
EXPECT_EQ(
|
|
|
|
|
video_stream_encoder_->overuse_detector_proxy_->GetLastTargetFramerate(),
|
|
|
|
|
kFramerate);
|
2017-06-15 04:21:07 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-15 04:21:07 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, DropsFramesAndScalesWhenBitrateIsTooLow) {
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kTooLowBitrateForFrameSizeBps = 10000;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTooLowBitrateForFrameSizeBps, 0, 0);
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 640;
|
|
|
|
|
const int kHeight = 360;
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
|
|
|
|
// Expect to drop this frame, the wait should time out.
|
2017-06-27 07:06:52 -07:00
|
|
|
ExpectDroppedFrame();
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
|
|
|
|
// Expect the sink_wants to specify a scaled frame.
|
2017-04-07 00:57:58 -07:00
|
|
|
EXPECT_LT(video_source_.sink_wants().max_pixel_count, kWidth * kHeight);
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
int last_pixel_count = video_source_.sink_wants().max_pixel_count;
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Next frame is scaled.
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
video_source_.IncomingCapturedFrame(
|
2017-04-04 05:51:49 -07:00
|
|
|
CreateFrame(2, kWidth * 3 / 4, kHeight * 3 / 4));
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
|
|
|
|
// Expect to drop this frame, the wait should time out.
|
2017-06-27 07:06:52 -07:00
|
|
|
ExpectDroppedFrame();
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_LT(video_source_.sink_wants().max_pixel_count, last_pixel_count);
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
NumberOfDroppedFramesLimitedWhenBitrateIsTooLow) {
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kTooLowBitrateForFrameSizeBps = 10000;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTooLowBitrateForFrameSizeBps, 0, 0);
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 640;
|
|
|
|
|
const int kHeight = 360;
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
|
|
|
|
// We expect the n initial frames to get dropped.
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 1; i <= kMaxInitialFramedrop; ++i) {
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(i, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
ExpectDroppedFrame();
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
}
|
|
|
|
|
// The n+1th frame should not be dropped, even though it's size is too large.
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(i, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(i);
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
|
|
|
|
// Expect the sink_wants to specify a scaled frame.
|
2017-04-04 05:51:49 -07:00
|
|
|
EXPECT_LT(video_source_.sink_wants().max_pixel_count, kWidth * kHeight);
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
InitialFrameDropOffWithMaintainResolutionPreference) {
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 640;
|
|
|
|
|
const int kHeight = 360;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kLowTargetBitrateBps, 0, 0);
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
|
|
|
|
// Set degradation preference.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
&video_source_,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
// Frame should not be dropped, even if it's too large.
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, InitialFrameDropOffWhenEncoderDisabledScaling) {
|
2017-04-04 05:51:49 -07:00
|
|
|
const int kWidth = 640;
|
|
|
|
|
const int kHeight = 360;
|
2017-02-14 00:46:51 -08:00
|
|
|
fake_encoder_.SetQualityScaling(false);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kLowTargetBitrateBps, 0, 0);
|
2017-05-15 23:40:18 -07:00
|
|
|
|
2017-02-14 11:57:25 -08:00
|
|
|
// Force quality scaler reconfiguration by resetting the source.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&video_source_,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2017-02-14 00:46:51 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
video_source_.IncomingCapturedFrame(CreateFrame(1, kWidth, kHeight));
|
2017-02-14 00:46:51 -08:00
|
|
|
// Frame should not be dropped, even if it's too large.
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2017-02-14 00:46:51 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-02-14 00:46:51 -08:00
|
|
|
fake_encoder_.SetQualityScaling(true);
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
2017-04-21 01:47:31 -07:00
|
|
|
ResolutionNotAdaptedForTooSmallFrame_MaintainFramerateMode) {
|
|
|
|
|
const int kTooSmallWidth = 10;
|
|
|
|
|
const int kTooSmallHeight = 10;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-04-21 01:47:31 -07:00
|
|
|
|
|
|
|
|
// Enable kMaintainFramerate preference, no initial limitation.
|
|
|
|
|
test::FrameForwarder source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
2017-04-21 01:47:31 -07:00
|
|
|
&source, VideoSendStream::DegradationPreference::kMaintainFramerate);
|
|
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, too small frame, expect no change.
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kTooSmallWidth, kTooSmallHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-04-21 01:47:31 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-04-21 01:47:31 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
ResolutionNotAdaptedForTooSmallFrame_BalancedMode) {
|
2017-06-13 23:25:22 -07:00
|
|
|
const int kTooSmallWidth = 10;
|
|
|
|
|
const int kTooSmallHeight = 10;
|
|
|
|
|
const int kFpsLimit = 7;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
// Enable kBalanced preference, no initial limitation.
|
|
|
|
|
test::FrameForwarder source;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect limited framerate.
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(1, kTooSmallWidth, kTooSmallHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(1);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionMax(source.sink_wants(), kFpsLimit);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, too small frame, expect no change.
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(2, kTooSmallWidth, kTooSmallHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(2);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionMax(source.sink_wants(), kFpsLimit);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-13 23:25:22 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, FailingInitEncodeDoesntCauseCrash) {
|
2017-04-10 01:12:52 -07:00
|
|
|
fake_encoder_.ForceInitEncodeFailure(true);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-08-18 00:28:40 -07:00
|
|
|
ResetEncoder("VP8", 2, 1, 1, true, false);
|
2017-04-10 01:12:52 -07:00
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(1, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
ExpectDroppedFrame();
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-04-10 01:12:52 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-01 08:38:12 -08:00
|
|
|
// TODO(sprang): Extend this with fps throttling and any "balanced" extensions.
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
AdaptsResolutionOnOveruse_MaintainFramerateMode) {
|
|
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-02-01 08:38:12 -08:00
|
|
|
|
|
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
|
|
|
|
// Enabled default VideoAdapter downscaling. First step is 3/4, not 3/5 as
|
2017-08-03 08:27:51 -07:00
|
|
|
// requested by
|
|
|
|
|
// VideoStreamEncoder::VideoSourceProxy::RequestResolutionLowerThan().
|
2017-02-01 08:38:12 -08:00
|
|
|
video_source_.set_adaptation_enabled(true);
|
|
|
|
|
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(1, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kFrameWidth, kFrameHeight);
|
2017-02-01 08:38:12 -08:00
|
|
|
|
|
|
|
|
// Trigger CPU overuse, downscale by 3/4.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-02-01 08:38:12 -08:00
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(2, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame((kFrameWidth * 3) / 4, (kFrameHeight * 3) / 4);
|
2017-02-01 08:38:12 -08:00
|
|
|
|
2017-04-04 05:51:49 -07:00
|
|
|
// Trigger CPU normal use, return to original resolution.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-02-01 08:38:12 -08:00
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(3, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kFrameWidth, kFrameHeight);
|
2017-02-01 08:38:12 -08:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-02-01 08:38:12 -08:00
|
|
|
}
|
2017-03-29 08:24:59 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
AdaptsFramerateOnOveruse_MaintainResolutionMode) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
2017-06-27 07:06:52 -07:00
|
|
|
int kFrameIntervalMs = rtc::kNumMillisecsPerSec / max_framerate_;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
|
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&video_source_,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
video_source_.set_adaptation_enabled(true);
|
|
|
|
|
|
2017-06-27 07:06:52 -07:00
|
|
|
int64_t timestamp_ms = fake_clock_.TimeNanos() / rtc::kNumNanosecsPerMillisec;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
|
|
|
|
// Try to trigger overuse. No fps estimate available => no effect.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
|
|
|
|
// Insert frames for one second to get a stable estimate.
|
2017-06-27 07:06:52 -07:00
|
|
|
for (int i = 0; i < max_framerate_; ++i) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Trigger CPU overuse, reduce framerate by 2/3.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
int num_frames_dropped = 0;
|
2017-06-27 07:06:52 -07:00
|
|
|
for (int i = 0; i < max_framerate_; ++i) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
if (!WaitForFrame(kFrameTimeoutMs)) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
++num_frames_dropped;
|
|
|
|
|
} else {
|
2017-12-04 14:13:56 +01:00
|
|
|
sink_.CheckLastFrameSizeMatches(kFrameWidth, kFrameHeight);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-27 07:06:52 -07:00
|
|
|
// Add some slack to account for frames dropped by the frame dropper.
|
|
|
|
|
const int kErrorMargin = 1;
|
|
|
|
|
EXPECT_NEAR(num_frames_dropped, max_framerate_ - (max_framerate_ * 2 / 3),
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
kErrorMargin);
|
|
|
|
|
|
|
|
|
|
// Trigger CPU overuse, reduce framerate by 2/3 again.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
num_frames_dropped = 0;
|
2017-06-27 07:06:52 -07:00
|
|
|
for (int i = 0; i < max_framerate_; ++i) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
if (!WaitForFrame(kFrameTimeoutMs)) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
++num_frames_dropped;
|
|
|
|
|
} else {
|
2017-12-04 14:13:56 +01:00
|
|
|
sink_.CheckLastFrameSizeMatches(kFrameWidth, kFrameHeight);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
|
|
|
|
}
|
2017-06-27 07:06:52 -07:00
|
|
|
EXPECT_NEAR(num_frames_dropped, max_framerate_ - (max_framerate_ * 4 / 9),
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
kErrorMargin);
|
|
|
|
|
|
|
|
|
|
// Go back up one step.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
num_frames_dropped = 0;
|
2017-06-27 07:06:52 -07:00
|
|
|
for (int i = 0; i < max_framerate_; ++i) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
if (!WaitForFrame(kFrameTimeoutMs)) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
++num_frames_dropped;
|
|
|
|
|
} else {
|
2017-12-04 14:13:56 +01:00
|
|
|
sink_.CheckLastFrameSizeMatches(kFrameWidth, kFrameHeight);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
|
|
|
|
}
|
2017-06-27 07:06:52 -07:00
|
|
|
EXPECT_NEAR(num_frames_dropped, max_framerate_ - (max_framerate_ * 2 / 3),
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
kErrorMargin);
|
|
|
|
|
|
|
|
|
|
// Go back up to original mode.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
num_frames_dropped = 0;
|
2017-06-27 07:06:52 -07:00
|
|
|
for (int i = 0; i < max_framerate_; ++i) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
if (!WaitForFrame(kFrameTimeoutMs)) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
++num_frames_dropped;
|
|
|
|
|
} else {
|
2017-12-04 14:13:56 +01:00
|
|
|
sink_.CheckLastFrameSizeMatches(kFrameWidth, kFrameHeight);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
EXPECT_NEAR(num_frames_dropped, 0, kErrorMargin);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, DoesntAdaptDownPastMinFramerate) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
const int kFramerateFps = 5;
|
|
|
|
|
const int kFrameIntervalMs = rtc::kNumMillisecsPerSec / kFramerateFps;
|
|
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
|
|
|
|
|
2017-06-27 07:06:52 -07:00
|
|
|
// Reconfigure encoder with two temporal layers and screensharing, which will
|
|
|
|
|
// disable frame dropping and make testing easier.
|
2017-08-18 00:28:40 -07:00
|
|
|
ResetEncoder("VP8", 1, 2, 1, true, true);
|
2017-06-27 07:06:52 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
|
|
|
|
video_stream_encoder_->SetSource(
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
&video_source_,
|
|
|
|
|
VideoSendStream::DegradationPreference::kMaintainResolution);
|
|
|
|
|
video_source_.set_adaptation_enabled(true);
|
|
|
|
|
|
2017-06-27 07:06:52 -07:00
|
|
|
int64_t timestamp_ms = fake_clock_.TimeNanos() / rtc::kNumNanosecsPerMillisec;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
|
|
|
|
// Trigger overuse as much as we can.
|
2017-12-08 17:04:29 -08:00
|
|
|
rtc::VideoSinkWants last_wants;
|
|
|
|
|
do {
|
|
|
|
|
last_wants = video_source_.sink_wants();
|
|
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// Insert frames to get a new fps estimate...
|
|
|
|
|
for (int j = 0; j < kFramerateFps; ++j) {
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
2017-12-08 17:04:29 -08:00
|
|
|
if (video_source_.last_sent_width()) {
|
|
|
|
|
sink_.WaitForEncodedFrame(timestamp_ms);
|
|
|
|
|
}
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
2017-12-08 17:04:29 -08:00
|
|
|
fake_clock_.AdvanceTimeMicros(
|
|
|
|
|
kFrameIntervalMs * rtc::kNumMicrosecsPerMillisec);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
|
|
|
|
// ...and then try to adapt again.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-12-08 17:04:29 -08:00
|
|
|
} while (video_source_.sink_wants().max_framerate_fps <
|
|
|
|
|
last_wants.max_framerate_fps);
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
2017-12-08 17:04:29 -08:00
|
|
|
VerifyFpsEqResolutionMax(video_source_.sink_wants(), kMinFramerateFps);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-13 23:25:22 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
AdaptsResolutionAndFramerateForLowQuality_BalancedMode) {
|
2017-06-13 23:25:22 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
const int64_t kFrameIntervalMs = 150;
|
|
|
|
|
int64_t timestamp_ms = kFrameIntervalMs;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
// Enable kBalanced preference, no initial limitation.
|
|
|
|
|
AdaptingFrameForwarder source;
|
|
|
|
|
source.set_adaptation_enabled(true);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution (960x540@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution (640x360@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect reduced fps (640x360@15fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsLtResolutionEq(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(3, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution (480x270@15fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionLt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(4, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Restrict bitrate, trigger adapt down, expect reduced fps (480x270@10fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsLtResolutionEq(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(5, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect scaled down resolution (320x180@10fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionLt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(6, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect reduced fps (320x180@7fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsLtResolutionEq(source.sink_wants(), source.last_wants());
|
|
|
|
|
rtc::VideoSinkWants last_wants = source.sink_wants();
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(7, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, min resolution reached, expect no change.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionEq(source.sink_wants(), last_wants);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(7, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt down, expect expect increased fps (320x180@10fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsGtResolutionEq(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(8, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect upscaled resolution (480x270@10fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionGt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(9, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Increase bitrate, trigger adapt up, expect increased fps (480x270@15fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsGtResolutionEq(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(10, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect upscaled resolution (640x360@15fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionGt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(11, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect increased fps (640x360@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionEq(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(12, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect upscaled resolution (960x540@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionGt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(13, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no restriction (1280x720fps@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionGt(source.sink_wants(), source.last_wants());
|
|
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_EQ(14, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no change.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_EQ(14, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-13 23:25:22 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, AdaptWithTwoReasonsAndDifferentOrder_Framerate) {
|
2017-06-13 23:25:22 -07:00
|
|
|
const int kWidth = 1280;
|
|
|
|
|
const int kHeight = 720;
|
|
|
|
|
const int64_t kFrameIntervalMs = 150;
|
|
|
|
|
int64_t timestamp_ms = kFrameIntervalMs;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
// Enable kBalanced preference, no initial limitation.
|
|
|
|
|
AdaptingFrameForwarder source;
|
|
|
|
|
source.set_adaptation_enabled(true);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt down, expect scaled down resolution (960x540@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), kWidth * kHeight);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt down, expect scaled down resolution (640x360@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionLt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger quality adapt down, expect reduced fps (640x360@15fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsLtResolutionEq(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt up, expect increased fps (640x360@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionEq(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(3, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger quality adapt up, expect upscaled resolution (960x540@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionGt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(3, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt up, expect no restriction (1280x720fps@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsMaxResolutionGt(source.sink_wants(), source.last_wants());
|
|
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(4, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no change.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_EQ(4, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-13 23:25:22 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest,
|
|
|
|
|
AdaptWithTwoReasonsAndDifferentOrder_Resolution) {
|
2017-06-13 23:25:22 -07:00
|
|
|
const int kWidth = 640;
|
|
|
|
|
const int kHeight = 360;
|
|
|
|
|
const int kFpsLimit = 15;
|
|
|
|
|
const int64_t kFrameIntervalMs = 150;
|
|
|
|
|
int64_t timestamp_ms = kFrameIntervalMs;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-13 23:25:22 -07:00
|
|
|
|
|
|
|
|
// Enable kBalanced preference, no initial limitation.
|
|
|
|
|
AdaptingFrameForwarder source;
|
|
|
|
|
source.set_adaptation_enabled(true);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetSource(
|
|
|
|
|
&source,
|
|
|
|
|
VideoSendStream::DegradationPreference::kBalanced);
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kWidth, kHeight);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt down, expect scaled down framerate (640x360@15fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionMax(source.sink_wants(), kFpsLimit);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(0, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger quality adapt down, expect scaled down resolution (480x270@15fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityLow();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionLt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger cpu adapt up, expect upscaled resolution (640x360@15fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuNormalUsage();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyFpsEqResolutionGt(source.sink_wants(), source.last_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_TRUE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(1, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger quality adapt up, expect increased fps (640x360@30fps).
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
source.IncomingCapturedFrame(CreateFrame(timestamp_ms, kWidth, kHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().bw_limited_framerate);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_resolution);
|
|
|
|
|
EXPECT_FALSE(stats_proxy_->GetStats().cpu_limited_framerate);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
|
|
|
|
// Trigger adapt up, expect no change.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerQualityHigh();
|
2017-06-13 23:25:22 -07:00
|
|
|
VerifyNoLimitation(source.sink_wants());
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_cpu_adapt_changes);
|
|
|
|
|
EXPECT_EQ(2, stats_proxy_->GetStats().number_of_quality_adapt_changes);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
}
|
2017-06-13 23:25:22 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, AcceptsFullHdAdaptedDownSimulcastFrames) {
|
2017-06-16 06:53:48 -07:00
|
|
|
// Simulates simulcast behavior and makes highest stream resolutions divisible
|
|
|
|
|
// by 4.
|
|
|
|
|
class CroppingVideoStreamFactory
|
|
|
|
|
: public VideoEncoderConfig::VideoStreamFactoryInterface {
|
|
|
|
|
public:
|
|
|
|
|
explicit CroppingVideoStreamFactory(size_t num_temporal_layers,
|
|
|
|
|
int framerate)
|
|
|
|
|
: num_temporal_layers_(num_temporal_layers), framerate_(framerate) {
|
|
|
|
|
EXPECT_GT(num_temporal_layers, 0u);
|
|
|
|
|
EXPECT_GT(framerate, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::vector<VideoStream> CreateEncoderStreams(
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
const VideoEncoderConfig& encoder_config) override {
|
|
|
|
|
std::vector<VideoStream> streams =
|
|
|
|
|
test::CreateVideoStreams(width - width % 4, height - height % 4,
|
|
|
|
|
encoder_config);
|
|
|
|
|
for (VideoStream& stream : streams) {
|
|
|
|
|
stream.temporal_layer_thresholds_bps.resize(num_temporal_layers_ - 1);
|
|
|
|
|
stream.max_framerate = framerate_;
|
|
|
|
|
}
|
|
|
|
|
return streams;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const size_t num_temporal_layers_;
|
|
|
|
|
const int framerate_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const int kFrameWidth = 1920;
|
|
|
|
|
const int kFrameHeight = 1080;
|
|
|
|
|
// 3/4 of 1920.
|
|
|
|
|
const int kAdaptedFrameWidth = 1440;
|
|
|
|
|
// 3/4 of 1080 rounded down to multiple of 4.
|
|
|
|
|
const int kAdaptedFrameHeight = 808;
|
|
|
|
|
const int kFramerate = 24;
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-16 06:53:48 -07:00
|
|
|
// Trigger reconfigure encoder (without resetting the entire instance).
|
|
|
|
|
VideoEncoderConfig video_encoder_config;
|
|
|
|
|
video_encoder_config.max_bitrate_bps = kTargetBitrateBps;
|
|
|
|
|
video_encoder_config.number_of_streams = 1;
|
|
|
|
|
video_encoder_config.video_stream_factory =
|
|
|
|
|
new rtc::RefCountedObject<CroppingVideoStreamFactory>(1, kFramerate);
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->ConfigureEncoder(std::move(video_encoder_config),
|
|
|
|
|
kMaxPayloadLength, false);
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
2017-06-16 06:53:48 -07:00
|
|
|
|
|
|
|
|
video_source_.set_adaptation_enabled(true);
|
|
|
|
|
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(1, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kFrameWidth, kFrameHeight);
|
2017-06-16 06:53:48 -07:00
|
|
|
|
|
|
|
|
// Trigger CPU overuse, downscale by 3/4.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->TriggerCpuOveruse();
|
2017-06-16 06:53:48 -07:00
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(2, kFrameWidth, kFrameHeight));
|
2017-06-27 07:06:52 -07:00
|
|
|
WaitForEncodedFrame(kAdaptedFrameWidth, kAdaptedFrameHeight);
|
2017-06-16 06:53:48 -07:00
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-16 06:53:48 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, PeriodicallyUpdatesChannelParameters) {
|
2017-06-27 07:06:52 -07:00
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
|
|
|
|
const int kLowFps = 2;
|
|
|
|
|
const int kHighFps = 30;
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-27 07:06:52 -07:00
|
|
|
|
|
|
|
|
int64_t timestamp_ms = fake_clock_.TimeNanos() / rtc::kNumNanosecsPerMillisec;
|
|
|
|
|
max_framerate_ = kLowFps;
|
|
|
|
|
|
|
|
|
|
// Insert 2 seconds of 2fps video.
|
|
|
|
|
for (int i = 0; i < kLowFps * 2; ++i) {
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
|
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
|
|
|
|
timestamp_ms += 1000 / kLowFps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Make sure encoder is updated with new target.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
2017-06-27 07:06:52 -07:00
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
|
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
|
|
|
|
timestamp_ms += 1000 / kLowFps;
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(kLowFps, fake_encoder_.GetConfiguredInputFramerate());
|
|
|
|
|
|
|
|
|
|
// Insert 30fps frames for just a little more than the forced update period.
|
|
|
|
|
const int kVcmTimerIntervalFrames =
|
|
|
|
|
(vcm::VCMProcessTimer::kDefaultProcessIntervalMs * kHighFps) / 1000;
|
|
|
|
|
const int kFrameIntervalMs = 1000 / kHighFps;
|
|
|
|
|
max_framerate_ = kHighFps;
|
|
|
|
|
for (int i = 0; i < kVcmTimerIntervalFrames + 2; ++i) {
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
|
|
|
|
// Wait for encoded frame, but skip ahead if it doesn't arrive as it might
|
|
|
|
|
// be dropped if the encoder hans't been updated with the new higher target
|
|
|
|
|
// framerate yet, causing it to overshoot the target bitrate and then
|
|
|
|
|
// suffering the wrath of the media optimizer.
|
|
|
|
|
TimedWaitForEncodedFrame(timestamp_ms, 2 * kFrameIntervalMs);
|
|
|
|
|
timestamp_ms += kFrameIntervalMs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Don expect correct measurement just yet, but it should be higher than
|
|
|
|
|
// before.
|
|
|
|
|
EXPECT_GT(fake_encoder_.GetConfiguredInputFramerate(), kLowFps);
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-27 07:06:52 -07:00
|
|
|
}
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
TEST_F(VideoStreamEncoderTest, DoesNotUpdateBitrateAllocationWhenSuspended) {
|
2017-06-27 07:06:52 -07:00
|
|
|
const int kFrameWidth = 1280;
|
|
|
|
|
const int kFrameHeight = 720;
|
|
|
|
|
const int kTargetBitrateBps = 1000000;
|
|
|
|
|
|
|
|
|
|
MockBitrateObserver bitrate_observer;
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->SetBitrateObserver(&bitrate_observer);
|
2017-06-27 07:06:52 -07:00
|
|
|
|
|
|
|
|
EXPECT_CALL(bitrate_observer, OnBitrateAllocationUpdated(_)).Times(1);
|
|
|
|
|
// Initial bitrate update.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0);
|
|
|
|
|
video_stream_encoder_->WaitUntilTaskQueueIsIdle();
|
2017-06-27 07:06:52 -07:00
|
|
|
|
|
|
|
|
// Insert a first video frame, causes another bitrate update.
|
|
|
|
|
int64_t timestamp_ms = fake_clock_.TimeNanos() / rtc::kNumNanosecsPerMillisec;
|
|
|
|
|
EXPECT_CALL(bitrate_observer, OnBitrateAllocationUpdated(_)).Times(1);
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
|
|
|
|
WaitForEncodedFrame(timestamp_ms);
|
|
|
|
|
|
|
|
|
|
// Next, simulate video suspension due to pacer queue overrun.
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->OnBitrateUpdated(0, 0, 1);
|
2017-06-27 07:06:52 -07:00
|
|
|
|
|
|
|
|
// Skip ahead until a new periodic parameter update should have occured.
|
|
|
|
|
timestamp_ms += vcm::VCMProcessTimer::kDefaultProcessIntervalMs;
|
|
|
|
|
fake_clock_.AdvanceTimeMicros(
|
|
|
|
|
vcm::VCMProcessTimer::kDefaultProcessIntervalMs *
|
|
|
|
|
rtc::kNumMicrosecsPerMillisec);
|
|
|
|
|
|
|
|
|
|
// Bitrate observer should not be called.
|
|
|
|
|
EXPECT_CALL(bitrate_observer, OnBitrateAllocationUpdated(_)).Times(0);
|
|
|
|
|
video_source_.IncomingCapturedFrame(
|
|
|
|
|
CreateFrame(timestamp_ms, kFrameWidth, kFrameHeight));
|
|
|
|
|
ExpectDroppedFrame();
|
|
|
|
|
|
2017-08-03 08:27:51 -07:00
|
|
|
video_stream_encoder_->Stop();
|
2017-06-27 07:06:52 -07:00
|
|
|
}
|
2017-06-16 06:53:48 -07:00
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
} // namespace webrtc
|