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 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 float video_ntp_speed, | 139 float video_ntp_speed, |
140 float video_rtp_speed, | 140 float video_rtp_speed, |
141 float audio_rtp_speed) { | 141 float audio_rtp_speed) { |
142 const char* kSyncGroup = "av_sync"; | 142 const char* kSyncGroup = "av_sync"; |
143 const uint32_t kAudioSendSsrc = 1234; | 143 const uint32_t kAudioSendSsrc = 1234; |
144 const uint32_t kAudioRecvSsrc = 5678; | 144 const uint32_t kAudioRecvSsrc = 5678; |
145 | 145 |
146 metrics::Reset(); | 146 metrics::Reset(); |
147 VoiceEngine* voice_engine = VoiceEngine::Create(); | 147 VoiceEngine* voice_engine = VoiceEngine::Create(); |
148 VoEBase* voe_base = VoEBase::GetInterface(voice_engine); | 148 VoEBase* voe_base = VoEBase::GetInterface(voice_engine); |
149 const std::string audio_filename = | 149 FakeAudioDevice fake_audio_device(Clock::GetRealTimeClock(), audio_rtp_speed, |
150 test::ResourcePath("voice_engine/audio_long16", "pcm"); | 150 48000); |
151 ASSERT_STRNE("", audio_filename.c_str()); | |
152 FakeAudioDevice fake_audio_device(Clock::GetRealTimeClock(), audio_filename, | |
153 audio_rtp_speed); | |
154 EXPECT_EQ(0, voe_base->Init(&fake_audio_device, nullptr, decoder_factory_)); | 151 EXPECT_EQ(0, voe_base->Init(&fake_audio_device, nullptr, decoder_factory_)); |
155 VoEBase::ChannelConfig config; | 152 VoEBase::ChannelConfig config; |
156 config.enable_voice_pacing = true; | 153 config.enable_voice_pacing = true; |
157 int send_channel_id = voe_base->CreateChannel(config); | 154 int send_channel_id = voe_base->CreateChannel(config); |
158 int recv_channel_id = voe_base->CreateChannel(); | 155 int recv_channel_id = voe_base->CreateChannel(); |
159 | 156 |
160 AudioState::Config send_audio_state_config; | 157 AudioState::Config send_audio_state_config; |
161 send_audio_state_config.voice_engine = voice_engine; | 158 send_audio_state_config.voice_engine = voice_engine; |
162 send_audio_state_config.audio_mixer = AudioMixerImpl::Create(); | 159 send_audio_state_config.audio_mixer = AudioMixerImpl::Create(); |
163 Call::Config sender_config(&event_log_); | 160 Call::Config sender_config(&event_log_); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 } | 254 } |
258 EXPECT_EQ(1u, video_receive_streams_.size()); | 255 EXPECT_EQ(1u, video_receive_streams_.size()); |
259 observer.set_receive_stream(video_receive_streams_[0]); | 256 observer.set_receive_stream(video_receive_streams_[0]); |
260 DriftingClock drifting_clock(clock_, video_ntp_speed); | 257 DriftingClock drifting_clock(clock_, video_ntp_speed); |
261 CreateFrameGeneratorCapturerWithDrift(&drifting_clock, video_rtp_speed, | 258 CreateFrameGeneratorCapturerWithDrift(&drifting_clock, video_rtp_speed, |
262 kDefaultFramerate, kDefaultWidth, | 259 kDefaultFramerate, kDefaultWidth, |
263 kDefaultHeight); | 260 kDefaultHeight); |
264 | 261 |
265 Start(); | 262 Start(); |
266 | 263 |
267 fake_audio_device.Start(); | 264 fake_audio_device.StartRecordingPulsedNoise(256); |
| 265 fake_audio_device.StartPlayout(); |
268 audio_receive_stream->Start(); | 266 audio_receive_stream->Start(); |
269 EXPECT_EQ(0, voe_base->StartSend(send_channel_id)); | 267 EXPECT_EQ(0, voe_base->StartSend(send_channel_id)); |
270 | 268 |
271 EXPECT_TRUE(observer.Wait()) | 269 EXPECT_TRUE(observer.Wait()) |
272 << "Timed out while waiting for audio and video to be synchronized."; | 270 << "Timed out while waiting for audio and video to be synchronized."; |
273 | 271 |
274 EXPECT_EQ(0, voe_base->StopSend(send_channel_id)); | 272 EXPECT_EQ(0, voe_base->StopSend(send_channel_id)); |
275 EXPECT_EQ(0, voe_base->StopPlayout(recv_channel_id)); | 273 EXPECT_EQ(0, voe_base->StopPlayout(recv_channel_id)); |
276 fake_audio_device.Stop(); | 274 fake_audio_device.StopRecording(); |
| 275 fake_audio_device.StopPlayout(); |
277 | 276 |
278 Stop(); | 277 Stop(); |
279 video_send_transport.StopSending(); | 278 video_send_transport.StopSending(); |
280 audio_send_transport.StopSending(); | 279 audio_send_transport.StopSending(); |
281 receive_transport.StopSending(); | 280 receive_transport.StopSending(); |
282 | 281 |
283 DestroyStreams(); | 282 DestroyStreams(); |
284 | 283 |
285 sender_call_->DestroyAudioSendStream(audio_send_stream); | 284 sender_call_->DestroyAudioSendStream(audio_send_stream); |
286 receiver_call_->DestroyAudioReceiveStream(audio_receive_stream); | 285 receiver_call_->DestroyAudioReceiveStream(audio_receive_stream); |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 uint32_t last_set_bitrate_kbps_; | 732 uint32_t last_set_bitrate_kbps_; |
734 VideoSendStream* send_stream_; | 733 VideoSendStream* send_stream_; |
735 test::FrameGeneratorCapturer* frame_generator_; | 734 test::FrameGeneratorCapturer* frame_generator_; |
736 VideoEncoderConfig encoder_config_; | 735 VideoEncoderConfig encoder_config_; |
737 } test; | 736 } test; |
738 | 737 |
739 RunBaseTest(&test); | 738 RunBaseTest(&test); |
740 } | 739 } |
741 | 740 |
742 } // namespace webrtc | 741 } // namespace webrtc |
OLD | NEW |