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 <functional> | 10 #include <functional> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 Callback callback_; | 96 Callback callback_; |
97 }; | 97 }; |
98 } // namespace | 98 } // namespace |
99 | 99 |
100 static const int kTOFExtensionId = 4; | 100 static const int kTOFExtensionId = 4; |
101 static const int kASTExtensionId = 5; | 101 static const int kASTExtensionId = 5; |
102 | 102 |
103 class BitrateEstimatorTest : public test::CallTest { | 103 class BitrateEstimatorTest : public test::CallTest { |
104 public: | 104 public: |
105 BitrateEstimatorTest() : receive_config_(nullptr) {} | 105 BitrateEstimatorTest() : mock_voice_engine_(decoder_factory_), |
| 106 receive_config_(nullptr) {} |
106 | 107 |
107 virtual ~BitrateEstimatorTest() { EXPECT_TRUE(streams_.empty()); } | 108 virtual ~BitrateEstimatorTest() { EXPECT_TRUE(streams_.empty()); } |
108 | 109 |
109 virtual void SetUp() { | 110 virtual void SetUp() { |
110 AudioState::Config audio_state_config; | 111 AudioState::Config audio_state_config; |
111 audio_state_config.voice_engine = &mock_voice_engine_; | 112 audio_state_config.voice_engine = &mock_voice_engine_; |
112 Call::Config config; | 113 Call::Config config; |
113 config.audio_state = AudioState::Create(audio_state_config); | 114 config.audio_state = AudioState::Create(audio_state_config); |
114 receiver_call_.reset(Call::Create(config)); | 115 receiver_call_.reset(Call::Create(config)); |
115 sender_call_.reset(Call::Create(config)); | 116 sender_call_.reset(Call::Create(config)); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 184 |
184 if (receive_audio) { | 185 if (receive_audio) { |
185 AudioReceiveStream::Config receive_config; | 186 AudioReceiveStream::Config receive_config; |
186 receive_config.rtp.remote_ssrc = test_->video_send_config_.rtp.ssrcs[0]; | 187 receive_config.rtp.remote_ssrc = test_->video_send_config_.rtp.ssrcs[0]; |
187 // Bogus non-default id to prevent hitting a RTC_DCHECK when creating | 188 // Bogus non-default id to prevent hitting a RTC_DCHECK when creating |
188 // the AudioReceiveStream. Every receive stream has to correspond to | 189 // the AudioReceiveStream. Every receive stream has to correspond to |
189 // an underlying channel id. | 190 // an underlying channel id. |
190 receive_config.voe_channel_id = 0; | 191 receive_config.voe_channel_id = 0; |
191 receive_config.rtp.extensions.push_back( | 192 receive_config.rtp.extensions.push_back( |
192 RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId)); | 193 RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId)); |
| 194 receive_config.decoder_factory = test_->decoder_factory_; |
193 audio_receive_stream_ = | 195 audio_receive_stream_ = |
194 test_->receiver_call_->CreateAudioReceiveStream(receive_config); | 196 test_->receiver_call_->CreateAudioReceiveStream(receive_config); |
195 } else { | 197 } else { |
196 VideoReceiveStream::Decoder decoder; | 198 VideoReceiveStream::Decoder decoder; |
197 decoder.decoder = &fake_decoder_; | 199 decoder.decoder = &fake_decoder_; |
198 decoder.payload_type = | 200 decoder.payload_type = |
199 test_->video_send_config_.encoder_settings.payload_type; | 201 test_->video_send_config_.encoder_settings.payload_type; |
200 decoder.payload_name = | 202 decoder.payload_name = |
201 test_->video_send_config_.encoder_settings.payload_name; | 203 test_->video_send_config_.encoder_settings.payload_name; |
202 test_->receive_config_.decoders.clear(); | 204 test_->receive_config_.decoders.clear(); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId); | 325 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId); |
324 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); | 326 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); |
325 receiver_log_.PushExpectedLogLine( | 327 receiver_log_.PushExpectedLogLine( |
326 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); | 328 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); |
327 streams_.push_back(new Stream(this, false)); | 329 streams_.push_back(new Stream(this, false)); |
328 streams_[0]->StopSending(); | 330 streams_[0]->StopSending(); |
329 streams_[1]->StopSending(); | 331 streams_[1]->StopSending(); |
330 EXPECT_TRUE(receiver_log_.Wait()); | 332 EXPECT_TRUE(receiver_log_.Wait()); |
331 } | 333 } |
332 } // namespace webrtc | 334 } // namespace webrtc |
OLD | NEW |