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