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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 665 |
666 void ModifyVideoConfigs( | 666 void ModifyVideoConfigs( |
667 VideoSendStream::Config* send_config, | 667 VideoSendStream::Config* send_config, |
668 std::vector<VideoReceiveStream::Config>* receive_configs, | 668 std::vector<VideoReceiveStream::Config>* receive_configs, |
669 VideoEncoderConfig* encoder_config) override { | 669 VideoEncoderConfig* encoder_config) override { |
670 send_config->encoder_settings.encoder = this; | 670 send_config->encoder_settings.encoder = this; |
671 encoder_config->streams[0].min_bitrate_bps = 50000; | 671 encoder_config->streams[0].min_bitrate_bps = 50000; |
672 encoder_config->streams[0].target_bitrate_bps = | 672 encoder_config->streams[0].target_bitrate_bps = |
673 encoder_config->streams[0].max_bitrate_bps = 2000000; | 673 encoder_config->streams[0].max_bitrate_bps = 2000000; |
674 | 674 |
675 encoder_config_ = *encoder_config; | 675 encoder_config_ = encoder_config->Copy(); |
676 } | 676 } |
677 | 677 |
678 void OnVideoStreamsCreated( | 678 void OnVideoStreamsCreated( |
679 VideoSendStream* send_stream, | 679 VideoSendStream* send_stream, |
680 const std::vector<VideoReceiveStream*>& receive_streams) override { | 680 const std::vector<VideoReceiveStream*>& receive_streams) override { |
681 send_stream_ = send_stream; | 681 send_stream_ = send_stream; |
682 } | 682 } |
683 | 683 |
684 void PerformTest() override { | 684 void PerformTest() override { |
685 ASSERT_TRUE(time_to_reconfigure_.Wait(kDefaultTimeoutMs)) | 685 ASSERT_TRUE(time_to_reconfigure_.Wait(kDefaultTimeoutMs)) |
686 << "Timed out before receiving an initial high bitrate."; | 686 << "Timed out before receiving an initial high bitrate."; |
687 encoder_config_.streams[0].width *= 2; | 687 encoder_config_.streams[0].width *= 2; |
688 encoder_config_.streams[0].height *= 2; | 688 encoder_config_.streams[0].height *= 2; |
689 send_stream_->ReconfigureVideoEncoder(encoder_config_); | 689 send_stream_->ReconfigureVideoEncoder(encoder_config_.Copy()); |
690 EXPECT_TRUE(Wait()) | 690 EXPECT_TRUE(Wait()) |
691 << "Timed out while waiting for a couple of high bitrate estimates " | 691 << "Timed out while waiting for a couple of high bitrate estimates " |
692 "after reconfiguring the send stream."; | 692 "after reconfiguring the send stream."; |
693 } | 693 } |
694 | 694 |
695 private: | 695 private: |
696 rtc::Event time_to_reconfigure_; | 696 rtc::Event time_to_reconfigure_; |
697 int encoder_inits_; | 697 int encoder_inits_; |
698 uint32_t last_set_bitrate_; | 698 uint32_t last_set_bitrate_; |
699 VideoSendStream* send_stream_; | 699 VideoSendStream* send_stream_; |
700 VideoEncoderConfig encoder_config_; | 700 VideoEncoderConfig encoder_config_; |
701 } test; | 701 } test; |
702 | 702 |
703 RunBaseTest(&test); | 703 RunBaseTest(&test); |
704 } | 704 } |
705 | 705 |
706 } // namespace webrtc | 706 } // namespace webrtc |
OLD | NEW |