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

Side by Side Diff: webrtc/test/call_test.cc

Issue 1909333002: Switch voice transport to use Call and Stream instead of VoENetwork. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: VoE::Channel external transport fix Created 4 years, 7 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
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 #include "webrtc/base/checks.h" 10 #include "webrtc/base/checks.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Sender-only call delivers to itself. 71 // Sender-only call delivers to itself.
72 send_transport_->SetReceiver(sender_call_->Receiver()); 72 send_transport_->SetReceiver(sender_call_->Receiver());
73 receive_transport_->SetReceiver(nullptr); 73 receive_transport_->SetReceiver(nullptr);
74 } 74 }
75 75
76 CreateSendConfig(num_video_streams_, num_audio_streams_, 76 CreateSendConfig(num_video_streams_, num_audio_streams_,
77 send_transport_.get()); 77 send_transport_.get());
78 if (test->ShouldCreateReceivers()) { 78 if (test->ShouldCreateReceivers()) {
79 CreateMatchingReceiveConfigs(receive_transport_.get()); 79 CreateMatchingReceiveConfigs(receive_transport_.get());
80 } 80 }
81 if (num_audio_streams_ > 0)
82 SetupVoiceEngineTransports(send_transport_.get(), receive_transport_.get());
83
84 if (num_video_streams_ > 0) { 81 if (num_video_streams_ > 0) {
85 test->ModifyVideoConfigs(&video_send_config_, &video_receive_configs_, 82 test->ModifyVideoConfigs(&video_send_config_, &video_receive_configs_,
86 &video_encoder_config_); 83 &video_encoder_config_);
87 } 84 }
88 if (num_audio_streams_ > 0) 85 if (num_audio_streams_ > 0)
89 test->ModifyAudioConfigs(&audio_send_config_, &audio_receive_configs_); 86 test->ModifyAudioConfigs(&audio_send_config_, &audio_receive_configs_);
90 87
91 if (num_video_streams_ > 0) { 88 if (num_video_streams_ > 0) {
92 CreateVideoStreams(); 89 CreateVideoStreams();
93 test->OnVideoStreamsCreated(video_send_stream_, video_receive_streams_); 90 test->OnVideoStreamsCreated(video_send_stream_, video_receive_streams_);
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 317
321 voe_recv_.voice_engine = VoiceEngine::Create(); 318 voe_recv_.voice_engine = VoiceEngine::Create();
322 voe_recv_.base = VoEBase::GetInterface(voe_recv_.voice_engine); 319 voe_recv_.base = VoEBase::GetInterface(voe_recv_.voice_engine);
323 voe_recv_.network = VoENetwork::GetInterface(voe_recv_.voice_engine); 320 voe_recv_.network = VoENetwork::GetInterface(voe_recv_.voice_engine);
324 voe_recv_.codec = VoECodec::GetInterface(voe_recv_.voice_engine); 321 voe_recv_.codec = VoECodec::GetInterface(voe_recv_.voice_engine);
325 EXPECT_EQ(0, voe_recv_.base->Init(fake_recv_audio_device_.get(), nullptr)); 322 EXPECT_EQ(0, voe_recv_.base->Init(fake_recv_audio_device_.get(), nullptr));
326 voe_recv_.channel_id = voe_recv_.base->CreateChannel(); 323 voe_recv_.channel_id = voe_recv_.base->CreateChannel();
327 EXPECT_GE(voe_recv_.channel_id, 0); 324 EXPECT_GE(voe_recv_.channel_id, 0);
328 } 325 }
329 326
330 void CallTest::SetupVoiceEngineTransports(PacketTransport* send_transport,
331 PacketTransport* recv_transport) {
332 voe_send_.transport_adapter.reset(
333 new internal::TransportAdapter(send_transport));
334 voe_send_.transport_adapter->Enable();
335 EXPECT_EQ(0, voe_send_.network->RegisterExternalTransport(
336 voe_send_.channel_id, *voe_send_.transport_adapter.get()));
337
338 voe_recv_.transport_adapter.reset(
339 new internal::TransportAdapter(recv_transport));
340 voe_recv_.transport_adapter->Enable();
341 EXPECT_EQ(0, voe_recv_.network->RegisterExternalTransport(
342 voe_recv_.channel_id, *voe_recv_.transport_adapter.get()));
343 }
344
345 void CallTest::DestroyVoiceEngines() { 327 void CallTest::DestroyVoiceEngines() {
346 voe_recv_.base->DeleteChannel(voe_recv_.channel_id); 328 voe_recv_.base->DeleteChannel(voe_recv_.channel_id);
347 voe_recv_.channel_id = -1; 329 voe_recv_.channel_id = -1;
348 voe_recv_.base->Release(); 330 voe_recv_.base->Release();
349 voe_recv_.base = nullptr; 331 voe_recv_.base = nullptr;
350 voe_recv_.network->Release(); 332 voe_recv_.network->Release();
351 voe_recv_.network = nullptr; 333 voe_recv_.network = nullptr;
352 voe_recv_.codec->Release(); 334 voe_recv_.codec->Release();
353 voe_recv_.codec = nullptr; 335 voe_recv_.codec = nullptr;
354 336
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 432
451 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { 433 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) {
452 } 434 }
453 435
454 bool EndToEndTest::ShouldCreateReceivers() const { 436 bool EndToEndTest::ShouldCreateReceivers() const {
455 return true; 437 return true;
456 } 438 }
457 439
458 } // namespace test 440 } // namespace test
459 } // namespace webrtc 441 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698