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 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2601 } | 2601 } |
2602 | 2602 |
2603 void ModifyVideoConfigs( | 2603 void ModifyVideoConfigs( |
2604 VideoSendStream::Config* send_config, | 2604 VideoSendStream::Config* send_config, |
2605 std::vector<VideoReceiveStream::Config>* receive_configs, | 2605 std::vector<VideoReceiveStream::Config>* receive_configs, |
2606 VideoEncoderConfig* encoder_config) override { | 2606 VideoEncoderConfig* encoder_config) override { |
2607 send_config->encoder_settings.encoder = this; | 2607 send_config->encoder_settings.encoder = this; |
2608 RTC_DCHECK_EQ(1u, encoder_config->number_of_streams); | 2608 RTC_DCHECK_EQ(1u, encoder_config->number_of_streams); |
2609 } | 2609 } |
2610 | 2610 |
2611 int32_t SetRates(uint32_t new_target_bitrate, uint32_t framerate) override { | 2611 int32_t SetRateAllocation(const BitrateAllocation& rate_allocation, |
| 2612 uint32_t framerate) override { |
2612 // Make sure not to trigger on any default zero bitrates. | 2613 // Make sure not to trigger on any default zero bitrates. |
2613 if (new_target_bitrate == 0) | 2614 if (rate_allocation.get_sum_bps() == 0) |
2614 return 0; | 2615 return 0; |
2615 rtc::CritScope lock(&crit_); | 2616 rtc::CritScope lock(&crit_); |
2616 bitrate_kbps_ = new_target_bitrate; | 2617 bitrate_kbps_ = rate_allocation.get_sum_kbps(); |
2617 observation_complete_.Set(); | 2618 observation_complete_.Set(); |
2618 return 0; | 2619 return 0; |
2619 } | 2620 } |
2620 | 2621 |
2621 void PerformTest() override { | 2622 void PerformTest() override { |
2622 ASSERT_TRUE(Wait()) | 2623 ASSERT_TRUE(Wait()) |
2623 << "Timed out while waiting for encoder SetRates() call."; | 2624 << "Timed out while waiting for encoder SetRates() call."; |
2624 WaitForEncoderTargetBitrateMatchStats(); | 2625 WaitForEncoderTargetBitrateMatchStats(); |
2625 send_stream_->Stop(); | 2626 send_stream_->Stop(); |
2626 WaitForStatsReportZeroTargetBitrate(); | 2627 WaitForStatsReportZeroTargetBitrate(); |
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3967 std::unique_ptr<VideoEncoder> encoder_; | 3968 std::unique_ptr<VideoEncoder> encoder_; |
3968 std::unique_ptr<VideoDecoder> decoder_; | 3969 std::unique_ptr<VideoDecoder> decoder_; |
3969 rtc::CriticalSection crit_; | 3970 rtc::CriticalSection crit_; |
3970 int recorded_frames_ GUARDED_BY(crit_); | 3971 int recorded_frames_ GUARDED_BY(crit_); |
3971 } test(this); | 3972 } test(this); |
3972 | 3973 |
3973 RunBaseTest(&test); | 3974 RunBaseTest(&test); |
3974 } | 3975 } |
3975 | 3976 |
3976 } // namespace webrtc | 3977 } // namespace webrtc |
OLD | NEW |