Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: test/call_test.cc

Issue 3019593002: Reland of Add full stack tests for MediaCodec.
Patch Set: Created 3 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/call_test.h ('k') | video/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 24 matching lines...) Expand all
35 event_log_(RtcEventLog::CreateNull()), 35 event_log_(RtcEventLog::CreateNull()),
36 sender_call_transport_controller_(nullptr), 36 sender_call_transport_controller_(nullptr),
37 video_send_config_(nullptr), 37 video_send_config_(nullptr),
38 video_send_stream_(nullptr), 38 video_send_stream_(nullptr),
39 audio_send_config_(nullptr), 39 audio_send_config_(nullptr),
40 audio_send_stream_(nullptr), 40 audio_send_stream_(nullptr),
41 fake_encoder_(clock_), 41 fake_encoder_(clock_),
42 num_video_streams_(1), 42 num_video_streams_(1),
43 num_audio_streams_(0), 43 num_audio_streams_(0),
44 num_flexfec_streams_(0), 44 num_flexfec_streams_(0),
45 decoder_factory_(CreateBuiltinAudioDecoderFactory()), 45 audio_decoder_factory_(CreateBuiltinAudioDecoderFactory()),
46 encoder_factory_(CreateBuiltinAudioEncoderFactory()), 46 audio_encoder_factory_(CreateBuiltinAudioEncoderFactory()),
47 task_queue_("CallTestTaskQueue"), 47 task_queue_("CallTestTaskQueue"),
48 fake_send_audio_device_(nullptr), 48 fake_send_audio_device_(nullptr),
49 fake_recv_audio_device_(nullptr) {} 49 fake_recv_audio_device_(nullptr) {}
50 50
51 CallTest::~CallTest() { 51 CallTest::~CallTest() {
52 task_queue_.SendTask([this]() { 52 task_queue_.SendTask([this]() {
53 fake_send_audio_device_.reset(); 53 fake_send_audio_device_.reset();
54 fake_recv_audio_device_.reset(); 54 fake_recv_audio_device_.reset();
55 frame_generator_capturer_.reset(); 55 frame_generator_capturer_.reset();
56 }); 56 });
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 RtpExtension::kVideoRotationUri, kVideoRotationRtpExtensionId)); 216 RtpExtension::kVideoRotationUri, kVideoRotationRtpExtensionId));
217 } 217 }
218 218
219 if (num_audio_streams > 0) { 219 if (num_audio_streams > 0) {
220 audio_send_config_ = AudioSendStream::Config(send_transport); 220 audio_send_config_ = AudioSendStream::Config(send_transport);
221 audio_send_config_.voe_channel_id = voe_send_.channel_id; 221 audio_send_config_.voe_channel_id = voe_send_.channel_id;
222 audio_send_config_.rtp.ssrc = kAudioSendSsrc; 222 audio_send_config_.rtp.ssrc = kAudioSendSsrc;
223 audio_send_config_.send_codec_spec = 223 audio_send_config_.send_codec_spec =
224 rtc::Optional<AudioSendStream::Config::SendCodecSpec>( 224 rtc::Optional<AudioSendStream::Config::SendCodecSpec>(
225 {kAudioSendPayloadType, {"opus", 48000, 2, {{"stereo", "1"}}}}); 225 {kAudioSendPayloadType, {"opus", 48000, 2, {{"stereo", "1"}}}});
226 audio_send_config_.encoder_factory = encoder_factory_; 226 audio_send_config_.encoder_factory = audio_encoder_factory_;
227 } 227 }
228 228
229 // TODO(brandtr): Update this when we support multistream protection. 229 // TODO(brandtr): Update this when we support multistream protection.
230 if (num_flexfec_streams > 0) { 230 if (num_flexfec_streams > 0) {
231 video_send_config_.rtp.flexfec.payload_type = kFlexfecPayloadType; 231 video_send_config_.rtp.flexfec.payload_type = kFlexfecPayloadType;
232 video_send_config_.rtp.flexfec.ssrc = kFlexfecSendSsrc; 232 video_send_config_.rtp.flexfec.ssrc = kFlexfecSendSsrc;
233 video_send_config_.rtp.flexfec.protected_media_ssrcs = {kVideoSendSsrcs[0]}; 233 video_send_config_.rtp.flexfec.protected_media_ssrcs = {kVideoSendSsrcs[0]};
234 } 234 }
235 } 235 }
236 236
(...skipping 22 matching lines...) Expand all
259 } 259 }
260 260
261 RTC_DCHECK_GE(1, num_audio_streams_); 261 RTC_DCHECK_GE(1, num_audio_streams_);
262 if (num_audio_streams_ == 1) { 262 if (num_audio_streams_ == 1) {
263 RTC_DCHECK_LE(0, voe_send_.channel_id); 263 RTC_DCHECK_LE(0, voe_send_.channel_id);
264 AudioReceiveStream::Config audio_config; 264 AudioReceiveStream::Config audio_config;
265 audio_config.rtp.local_ssrc = kReceiverLocalAudioSsrc; 265 audio_config.rtp.local_ssrc = kReceiverLocalAudioSsrc;
266 audio_config.rtcp_send_transport = rtcp_send_transport; 266 audio_config.rtcp_send_transport = rtcp_send_transport;
267 audio_config.voe_channel_id = voe_recv_.channel_id; 267 audio_config.voe_channel_id = voe_recv_.channel_id;
268 audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc; 268 audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc;
269 audio_config.decoder_factory = decoder_factory_; 269 audio_config.decoder_factory = audio_decoder_factory_;
270 audio_config.decoder_map = {{kAudioSendPayloadType, {"opus", 48000, 2}}}; 270 audio_config.decoder_map = {{kAudioSendPayloadType, {"opus", 48000, 2}}};
271 audio_receive_configs_.push_back(audio_config); 271 audio_receive_configs_.push_back(audio_config);
272 } 272 }
273 273
274 // TODO(brandtr): Update this when we support multistream protection. 274 // TODO(brandtr): Update this when we support multistream protection.
275 RTC_DCHECK(num_flexfec_streams_ <= 1); 275 RTC_DCHECK(num_flexfec_streams_ <= 1);
276 if (num_flexfec_streams_ == 1) { 276 if (num_flexfec_streams_ == 1) {
277 FlexfecReceiveStream::Config config(rtcp_send_transport); 277 FlexfecReceiveStream::Config config(rtcp_send_transport);
278 config.payload_type = kFlexfecPayloadType; 278 config.payload_type = kFlexfecPayloadType;
279 config.remote_ssrc = kFlexfecSendSsrc; 279 config.remote_ssrc = kFlexfecSendSsrc;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } 419 }
420 420
421 void CallTest::SetFakeVideoCaptureRotation(VideoRotation rotation) { 421 void CallTest::SetFakeVideoCaptureRotation(VideoRotation rotation) {
422 frame_generator_capturer_->SetFakeRotation(rotation); 422 frame_generator_capturer_->SetFakeRotation(rotation);
423 } 423 }
424 424
425 void CallTest::CreateVoiceEngines() { 425 void CallTest::CreateVoiceEngines() {
426 voe_send_.voice_engine = VoiceEngine::Create(); 426 voe_send_.voice_engine = VoiceEngine::Create();
427 voe_send_.base = VoEBase::GetInterface(voe_send_.voice_engine); 427 voe_send_.base = VoEBase::GetInterface(voe_send_.voice_engine);
428 EXPECT_EQ(0, voe_send_.base->Init(fake_send_audio_device_.get(), 428 EXPECT_EQ(0, voe_send_.base->Init(fake_send_audio_device_.get(),
429 apm_send_.get(), decoder_factory_)); 429 apm_send_.get(), audio_decoder_factory_));
430 VoEBase::ChannelConfig config; 430 VoEBase::ChannelConfig config;
431 config.enable_voice_pacing = true; 431 config.enable_voice_pacing = true;
432 voe_send_.channel_id = voe_send_.base->CreateChannel(config); 432 voe_send_.channel_id = voe_send_.base->CreateChannel(config);
433 EXPECT_GE(voe_send_.channel_id, 0); 433 EXPECT_GE(voe_send_.channel_id, 0);
434 434
435 voe_recv_.voice_engine = VoiceEngine::Create(); 435 voe_recv_.voice_engine = VoiceEngine::Create();
436 voe_recv_.base = VoEBase::GetInterface(voe_recv_.voice_engine); 436 voe_recv_.base = VoEBase::GetInterface(voe_recv_.voice_engine);
437 EXPECT_EQ(0, voe_recv_.base->Init(fake_recv_audio_device_.get(), 437 EXPECT_EQ(0, voe_recv_.base->Init(fake_recv_audio_device_.get(),
438 apm_recv_.get(), decoder_factory_)); 438 apm_recv_.get(), audio_decoder_factory_));
439 voe_recv_.channel_id = voe_recv_.base->CreateChannel(); 439 voe_recv_.channel_id = voe_recv_.base->CreateChannel();
440 EXPECT_GE(voe_recv_.channel_id, 0); 440 EXPECT_GE(voe_recv_.channel_id, 0);
441 } 441 }
442 442
443 void CallTest::DestroyVoiceEngines() { 443 void CallTest::DestroyVoiceEngines() {
444 voe_recv_.base->DeleteChannel(voe_recv_.channel_id); 444 voe_recv_.base->DeleteChannel(voe_recv_.channel_id);
445 voe_recv_.channel_id = -1; 445 voe_recv_.channel_id = -1;
446 voe_recv_.base->Release(); 446 voe_recv_.base->Release();
447 voe_recv_.base = nullptr; 447 voe_recv_.base = nullptr;
448 448
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 603
604 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { 604 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) {
605 } 605 }
606 606
607 bool EndToEndTest::ShouldCreateReceivers() const { 607 bool EndToEndTest::ShouldCreateReceivers() const {
608 return true; 608 return true;
609 } 609 }
610 610
611 } // namespace test 611 } // namespace test
612 } // namespace webrtc 612 } // namespace webrtc
OLDNEW
« no previous file with comments | « test/call_test.h ('k') | video/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698