OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 ? last_set_bitrate_kbps_ | 656 ? last_set_bitrate_kbps_ |
657 : kInitialBitrateKbps; | 657 : kInitialBitrateKbps; |
658 EXPECT_EQ(expected_bitrate, config->startBitrate) | 658 EXPECT_EQ(expected_bitrate, config->startBitrate) |
659 << "Encoder not initialized at expected bitrate."; | 659 << "Encoder not initialized at expected bitrate."; |
660 EXPECT_EQ(kDefaultWidth, config->width); | 660 EXPECT_EQ(kDefaultWidth, config->width); |
661 EXPECT_EQ(kDefaultHeight, config->height); | 661 EXPECT_EQ(kDefaultHeight, config->height); |
662 } else if (encoder_inits_ == 2) { | 662 } else if (encoder_inits_ == 2) { |
663 EXPECT_EQ(2 * kDefaultWidth, config->width); | 663 EXPECT_EQ(2 * kDefaultWidth, config->width); |
664 EXPECT_EQ(2 * kDefaultHeight, config->height); | 664 EXPECT_EQ(2 * kDefaultHeight, config->height); |
665 EXPECT_GE(last_set_bitrate_kbps_, kReconfigureThresholdKbps); | 665 EXPECT_GE(last_set_bitrate_kbps_, kReconfigureThresholdKbps); |
666 EXPECT_NEAR(config->startBitrate, last_set_bitrate_kbps_, | 666 EXPECT_GT( |
667 kPermittedReconfiguredBitrateDiffKbps) | 667 config->startBitrate, |
| 668 last_set_bitrate_kbps_ - kPermittedReconfiguredBitrateDiffKbps) |
668 << "Encoder reconfigured with bitrate too far away from last set."; | 669 << "Encoder reconfigured with bitrate too far away from last set."; |
669 observation_complete_.Set(); | 670 observation_complete_.Set(); |
670 } | 671 } |
671 return FakeEncoder::InitEncode(config, number_of_cores, max_payload_size); | 672 return FakeEncoder::InitEncode(config, number_of_cores, max_payload_size); |
672 } | 673 } |
673 | 674 |
674 int32_t SetRateAllocation(const BitrateAllocation& rate_allocation, | 675 int32_t SetRateAllocation(const BitrateAllocation& rate_allocation, |
675 uint32_t framerate) override { | 676 uint32_t framerate) override { |
676 last_set_bitrate_kbps_ = rate_allocation.get_sum_kbps(); | 677 last_set_bitrate_kbps_ = rate_allocation.get_sum_kbps(); |
677 if (encoder_inits_ == 1 && | 678 if (encoder_inits_ == 1 && |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 uint32_t last_set_bitrate_kbps_; | 728 uint32_t last_set_bitrate_kbps_; |
728 VideoSendStream* send_stream_; | 729 VideoSendStream* send_stream_; |
729 test::FrameGeneratorCapturer* frame_generator_; | 730 test::FrameGeneratorCapturer* frame_generator_; |
730 VideoEncoderConfig encoder_config_; | 731 VideoEncoderConfig encoder_config_; |
731 } test; | 732 } test; |
732 | 733 |
733 RunBaseTest(&test); | 734 RunBaseTest(&test); |
734 } | 735 } |
735 | 736 |
736 } // namespace webrtc | 737 } // namespace webrtc |
OLD | NEW |