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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 | 1006 |
1007 if (retransmission_ssrc_ == kSendRtxSsrcs[0]) { | 1007 if (retransmission_ssrc_ == kSendRtxSsrcs[0]) { |
1008 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]); | 1008 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]); |
1009 send_config->rtp.rtx.payload_type = kSendRtxPayloadType; | 1009 send_config->rtp.rtx.payload_type = kSendRtxPayloadType; |
1010 (*receive_configs)[0].rtp.rtx[payload_type_].ssrc = kSendRtxSsrcs[0]; | 1010 (*receive_configs)[0].rtp.rtx[payload_type_].ssrc = kSendRtxSsrcs[0]; |
1011 (*receive_configs)[0].rtp.rtx[payload_type_].payload_type = | 1011 (*receive_configs)[0].rtp.rtx[payload_type_].payload_type = |
1012 kSendRtxPayloadType; | 1012 kSendRtxPayloadType; |
1013 } | 1013 } |
1014 // Configure encoding and decoding with VP8, since generic packetization | 1014 // Configure encoding and decoding with VP8, since generic packetization |
1015 // doesn't support FEC with NACK. | 1015 // doesn't support FEC with NACK. |
1016 RTC_DCHECK_EQ(1u, (*receive_configs)[0].decoders.size()); | 1016 RTC_DCHECK_EQ(1, (*receive_configs)[0].decoders.size()); |
1017 send_config->encoder_settings.encoder = encoder_.get(); | 1017 send_config->encoder_settings.encoder = encoder_.get(); |
1018 send_config->encoder_settings.payload_name = "VP8"; | 1018 send_config->encoder_settings.payload_name = "VP8"; |
1019 (*receive_configs)[0].decoders[0].payload_name = "VP8"; | 1019 (*receive_configs)[0].decoders[0].payload_name = "VP8"; |
1020 } | 1020 } |
1021 | 1021 |
1022 void PerformTest() override { | 1022 void PerformTest() override { |
1023 EXPECT_TRUE(Wait()) | 1023 EXPECT_TRUE(Wait()) |
1024 << "Timed out while waiting for retransmission to render."; | 1024 << "Timed out while waiting for retransmission to render."; |
1025 } | 1025 } |
1026 | 1026 |
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2621 VideoSendStream* send_stream, | 2621 VideoSendStream* send_stream, |
2622 const std::vector<VideoReceiveStream*>& receive_streams) override { | 2622 const std::vector<VideoReceiveStream*>& receive_streams) override { |
2623 send_stream_ = send_stream; | 2623 send_stream_ = send_stream; |
2624 } | 2624 } |
2625 | 2625 |
2626 void ModifyVideoConfigs( | 2626 void ModifyVideoConfigs( |
2627 VideoSendStream::Config* send_config, | 2627 VideoSendStream::Config* send_config, |
2628 std::vector<VideoReceiveStream::Config>* receive_configs, | 2628 std::vector<VideoReceiveStream::Config>* receive_configs, |
2629 VideoEncoderConfig* encoder_config) override { | 2629 VideoEncoderConfig* encoder_config) override { |
2630 send_config->encoder_settings.encoder = this; | 2630 send_config->encoder_settings.encoder = this; |
2631 RTC_DCHECK_EQ(1u, encoder_config->number_of_streams); | 2631 RTC_DCHECK_EQ(1, encoder_config->number_of_streams); |
2632 } | 2632 } |
2633 | 2633 |
2634 int32_t SetRateAllocation(const BitrateAllocation& rate_allocation, | 2634 int32_t SetRateAllocation(const BitrateAllocation& rate_allocation, |
2635 uint32_t framerate) override { | 2635 uint32_t framerate) override { |
2636 // Make sure not to trigger on any default zero bitrates. | 2636 // Make sure not to trigger on any default zero bitrates. |
2637 if (rate_allocation.get_sum_bps() == 0) | 2637 if (rate_allocation.get_sum_bps() == 0) |
2638 return 0; | 2638 return 0; |
2639 rtc::CritScope lock(&crit_); | 2639 rtc::CritScope lock(&crit_); |
2640 bitrate_kbps_ = rate_allocation.get_sum_kbps(); | 2640 bitrate_kbps_ = rate_allocation.get_sum_kbps(); |
2641 observation_complete_.Set(); | 2641 observation_complete_.Set(); |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3196 private: | 3196 private: |
3197 std::vector<VideoStream> CreateEncoderStreams( | 3197 std::vector<VideoStream> CreateEncoderStreams( |
3198 int width, | 3198 int width, |
3199 int height, | 3199 int height, |
3200 const VideoEncoderConfig& encoder_config) override { | 3200 const VideoEncoderConfig& encoder_config) override { |
3201 std::vector<VideoStream> streams = | 3201 std::vector<VideoStream> streams = |
3202 test::CreateVideoStreams(width, height, encoder_config); | 3202 test::CreateVideoStreams(width, height, encoder_config); |
3203 | 3203 |
3204 if (encoder_config.number_of_streams > 1) { | 3204 if (encoder_config.number_of_streams > 1) { |
3205 // Lower bitrates so that all streams send initially. | 3205 // Lower bitrates so that all streams send initially. |
3206 RTC_DCHECK_EQ(3u, encoder_config.number_of_streams); | 3206 RTC_DCHECK_EQ(3, encoder_config.number_of_streams); |
3207 for (size_t i = 0; i < encoder_config.number_of_streams; ++i) { | 3207 for (size_t i = 0; i < encoder_config.number_of_streams; ++i) { |
3208 streams[i].min_bitrate_bps = 10000; | 3208 streams[i].min_bitrate_bps = 10000; |
3209 streams[i].target_bitrate_bps = 15000; | 3209 streams[i].target_bitrate_bps = 15000; |
3210 streams[i].max_bitrate_bps = 20000; | 3210 streams[i].max_bitrate_bps = 20000; |
3211 } | 3211 } |
3212 } else { | 3212 } else { |
3213 // Use the same total bitrates when sending a single stream to avoid | 3213 // Use the same total bitrates when sending a single stream to avoid |
3214 // lowering | 3214 // lowering |
3215 // the bitrate estimate and requiring a subsequent rampup. | 3215 // the bitrate estimate and requiring a subsequent rampup. |
3216 streams[0].min_bitrate_bps = 3 * 10000; | 3216 streams[0].min_bitrate_bps = 3 * 10000; |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4003 std::unique_ptr<VideoEncoder> encoder_; | 4003 std::unique_ptr<VideoEncoder> encoder_; |
4004 std::unique_ptr<VideoDecoder> decoder_; | 4004 std::unique_ptr<VideoDecoder> decoder_; |
4005 rtc::CriticalSection crit_; | 4005 rtc::CriticalSection crit_; |
4006 int recorded_frames_ GUARDED_BY(crit_); | 4006 int recorded_frames_ GUARDED_BY(crit_); |
4007 } test(this); | 4007 } test(this); |
4008 | 4008 |
4009 RunBaseTest(&test); | 4009 RunBaseTest(&test); |
4010 } | 4010 } |
4011 | 4011 |
4012 } // namespace webrtc | 4012 } // namespace webrtc |
OLD | NEW |