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 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2543 } | 2543 } |
2544 | 2544 |
2545 void ModifyVideoConfigs( | 2545 void ModifyVideoConfigs( |
2546 VideoSendStream::Config* send_config, | 2546 VideoSendStream::Config* send_config, |
2547 std::vector<VideoReceiveStream::Config>* receive_configs, | 2547 std::vector<VideoReceiveStream::Config>* receive_configs, |
2548 VideoEncoderConfig* encoder_config) override { | 2548 VideoEncoderConfig* encoder_config) override { |
2549 send_config->encoder_settings.encoder = this; | 2549 send_config->encoder_settings.encoder = this; |
2550 RTC_DCHECK_EQ(1u, encoder_config->number_of_streams); | 2550 RTC_DCHECK_EQ(1u, encoder_config->number_of_streams); |
2551 } | 2551 } |
2552 | 2552 |
2553 int32_t SetRateAllocation(const BitrateAllocation& rate_allocation, | 2553 int32_t SetRates(uint32_t new_target_bitrate, uint32_t framerate) override { |
2554 uint32_t framerate) override { | |
2555 // Make sure not to trigger on any default zero bitrates. | 2554 // Make sure not to trigger on any default zero bitrates. |
2556 if (rate_allocation.get_sum_bps() == 0) | 2555 if (new_target_bitrate == 0) |
2557 return 0; | 2556 return 0; |
2558 rtc::CritScope lock(&crit_); | 2557 rtc::CritScope lock(&crit_); |
2559 bitrate_kbps_ = rate_allocation.get_sum_kbps(); | 2558 bitrate_kbps_ = new_target_bitrate; |
2560 observation_complete_.Set(); | 2559 observation_complete_.Set(); |
2561 return 0; | 2560 return 0; |
2562 } | 2561 } |
2563 | 2562 |
2564 void PerformTest() override { | 2563 void PerformTest() override { |
2565 ASSERT_TRUE(Wait()) | 2564 ASSERT_TRUE(Wait()) |
2566 << "Timed out while waiting for encoder SetRates() call."; | 2565 << "Timed out while waiting for encoder SetRates() call."; |
2567 WaitForEncoderTargetBitrateMatchStats(); | 2566 WaitForEncoderTargetBitrateMatchStats(); |
2568 send_stream_->Stop(); | 2567 send_stream_->Stop(); |
2569 WaitForStatsReportZeroTargetBitrate(); | 2568 WaitForStatsReportZeroTargetBitrate(); |
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3910 std::unique_ptr<VideoEncoder> encoder_; | 3909 std::unique_ptr<VideoEncoder> encoder_; |
3911 std::unique_ptr<VideoDecoder> decoder_; | 3910 std::unique_ptr<VideoDecoder> decoder_; |
3912 rtc::CriticalSection crit_; | 3911 rtc::CriticalSection crit_; |
3913 int recorded_frames_ GUARDED_BY(crit_); | 3912 int recorded_frames_ GUARDED_BY(crit_); |
3914 } test(this); | 3913 } test(this); |
3915 | 3914 |
3916 RunBaseTest(&test); | 3915 RunBaseTest(&test); |
3917 } | 3916 } |
3918 | 3917 |
3919 } // namespace webrtc | 3918 } // namespace webrtc |
OLD | NEW |