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

Side by Side Diff: webrtc/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc

Issue 2769263002: Base screenshare layers on TemporalReferences. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 11 matching lines...) Expand all
22 namespace { 22 namespace {
23 using ::testing::_; 23 using ::testing::_;
24 24
25 constexpr uint32_t kMinBitrateKbps = 50; 25 constexpr uint32_t kMinBitrateKbps = 50;
26 constexpr uint32_t kTargetBitrateKbps = 100; 26 constexpr uint32_t kTargetBitrateKbps = 100;
27 constexpr uint32_t kMaxBitrateKbps = 1000; 27 constexpr uint32_t kMaxBitrateKbps = 1000;
28 constexpr uint32_t kFramerateFps = 5; 28 constexpr uint32_t kFramerateFps = 5;
29 29
30 class MockTemporalLayers : public TemporalLayers { 30 class MockTemporalLayers : public TemporalLayers {
31 public: 31 public:
32 MOCK_METHOD1(EncodeFlags, int(uint32_t)); 32 MOCK_METHOD1(GetLayerConfig, TemporalReferences(uint32_t));
33 MOCK_METHOD3(OnRatesUpdated, std::vector<uint32_t>(int, int, int)); 33 MOCK_METHOD3(OnRatesUpdated, std::vector<uint32_t>(int, int, int));
34 MOCK_METHOD1(UpdateConfiguration, bool(vpx_codec_enc_cfg_t*)); 34 MOCK_METHOD1(UpdateConfiguration, bool(vpx_codec_enc_cfg_t*));
35 MOCK_METHOD3(PopulateCodecSpecific, 35 MOCK_METHOD3(PopulateCodecSpecific,
36 void(bool, CodecSpecificInfoVP8*, uint32_t)); 36 void(bool, CodecSpecificInfoVP8*, uint32_t));
37 MOCK_METHOD3(FrameEncoded, void(unsigned int, uint32_t, int)); 37 MOCK_METHOD2(FrameEncoded, void(unsigned int, int));
38 MOCK_CONST_METHOD0(CurrentLayerId, int()); 38 MOCK_CONST_METHOD0(CurrentLayerId, int());
39 }; 39 };
40 } // namespace 40 } // namespace
41 41
42 class SimulcastRateAllocatorTest : public ::testing::TestWithParam<bool> { 42 class SimulcastRateAllocatorTest : public ::testing::TestWithParam<bool> {
43 public: 43 public:
44 SimulcastRateAllocatorTest() { 44 SimulcastRateAllocatorTest() {
45 memset(&codec_, 0, sizeof(VideoCodec)); 45 memset(&codec_, 0, sizeof(VideoCodec));
46 codec_.minBitrate = kMinBitrateKbps; 46 codec_.minBitrate = kMinBitrateKbps;
47 codec_.targetBitrate = kTargetBitrateKbps; 47 codec_.targetBitrate = kTargetBitrateKbps;
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 allocator_->GetAllocation(kMaxBitrateKbps * 2000, kFramerateFps); 362 allocator_->GetAllocation(kMaxBitrateKbps * 2000, kFramerateFps);
363 363
364 // Fill both TL0 and TL1, but no more. 364 // Fill both TL0 and TL1, but no more.
365 EXPECT_EQ(kMaxBitrateKbps, allocation.get_sum_kbps()); 365 EXPECT_EQ(kMaxBitrateKbps, allocation.get_sum_kbps());
366 EXPECT_EQ(kTargetBitrateKbps, allocation.GetBitrate(0, 0) / 1000); 366 EXPECT_EQ(kTargetBitrateKbps, allocation.GetBitrate(0, 0) / 1000);
367 EXPECT_EQ(kMaxBitrateKbps - kTargetBitrateKbps, 367 EXPECT_EQ(kMaxBitrateKbps - kTargetBitrateKbps,
368 allocation.GetBitrate(0, 1) / 1000); 368 allocation.GetBitrate(0, 1) / 1000);
369 } 369 }
370 370
371 } // namespace webrtc 371 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698