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

Side by Side Diff: webrtc/voice_engine/test/auto_test/fakes/conference_transport.cc

Issue 2948763002: Allow an external audio processing module to be used in WebRTC (Closed)
Patch Set: tracking linux32_rel issue Created 3 years, 6 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 rtp_header_parser_(webrtc::RtpHeaderParser::Create()) { 48 rtp_header_parser_(webrtc::RtpHeaderParser::Create()) {
49 rtp_header_parser_-> 49 rtp_header_parser_->
50 RegisterRtpHeaderExtension(webrtc::kRtpExtensionAudioLevel, 50 RegisterRtpHeaderExtension(webrtc::kRtpExtensionAudioLevel,
51 kAudioLevelHeaderId); 51 kAudioLevelHeaderId);
52 52
53 local_voe_ = webrtc::VoiceEngine::Create(); 53 local_voe_ = webrtc::VoiceEngine::Create();
54 local_base_ = webrtc::VoEBase::GetInterface(local_voe_); 54 local_base_ = webrtc::VoEBase::GetInterface(local_voe_);
55 local_network_ = webrtc::VoENetwork::GetInterface(local_voe_); 55 local_network_ = webrtc::VoENetwork::GetInterface(local_voe_);
56 local_rtp_rtcp_ = webrtc::VoERTP_RTCP::GetInterface(local_voe_); 56 local_rtp_rtcp_ = webrtc::VoERTP_RTCP::GetInterface(local_voe_);
57 57
58 local_apm_ = webrtc::AudioProcessing::Create();
59 local_base_->Init(nullptr, local_apm_.get(), nullptr);
60
58 // In principle, we can use one VoiceEngine to achieve the same goal. Well, in 61 // In principle, we can use one VoiceEngine to achieve the same goal. Well, in
59 // here, we use two engines to make it more like reality. 62 // here, we use two engines to make it more like reality.
60 remote_voe_ = webrtc::VoiceEngine::Create(); 63 remote_voe_ = webrtc::VoiceEngine::Create();
61 remote_base_ = webrtc::VoEBase::GetInterface(remote_voe_); 64 remote_base_ = webrtc::VoEBase::GetInterface(remote_voe_);
62 remote_codec_ = webrtc::VoECodec::GetInterface(remote_voe_); 65 remote_codec_ = webrtc::VoECodec::GetInterface(remote_voe_);
63 remote_network_ = webrtc::VoENetwork::GetInterface(remote_voe_); 66 remote_network_ = webrtc::VoENetwork::GetInterface(remote_voe_);
64 remote_rtp_rtcp_ = webrtc::VoERTP_RTCP::GetInterface(remote_voe_); 67 remote_rtp_rtcp_ = webrtc::VoERTP_RTCP::GetInterface(remote_voe_);
65 remote_file_ = webrtc::VoEFile::GetInterface(remote_voe_); 68 remote_file_ = webrtc::VoEFile::GetInterface(remote_voe_);
66 69
67 EXPECT_EQ(0, local_base_->Init()); 70 remote_apm_.reset(webrtc::AudioProcessing::Create());
71 remote_base_->Init(nullptr, remote_apm_.get(), nullptr);
72
68 local_sender_ = local_base_->CreateChannel(); 73 local_sender_ = local_base_->CreateChannel();
69 static_cast<webrtc::VoiceEngineImpl*>(local_voe_) 74 static_cast<webrtc::VoiceEngineImpl*>(local_voe_)
70 ->GetChannelProxy(local_sender_) 75 ->GetChannelProxy(local_sender_)
71 ->RegisterLegacyReceiveCodecs(); 76 ->RegisterLegacyReceiveCodecs();
72 EXPECT_EQ(0, local_network_->RegisterExternalTransport(local_sender_, *this)); 77 EXPECT_EQ(0, local_network_->RegisterExternalTransport(local_sender_, *this));
73 EXPECT_EQ(0, local_rtp_rtcp_->SetLocalSSRC(local_sender_, kLocalSsrc)); 78 EXPECT_EQ(0, local_rtp_rtcp_->SetLocalSSRC(local_sender_, kLocalSsrc));
74 EXPECT_EQ(0, local_rtp_rtcp_-> 79 EXPECT_EQ(0, local_rtp_rtcp_->
75 SetSendAudioLevelIndicationStatus(local_sender_, true, 80 SetSendAudioLevelIndicationStatus(local_sender_, true,
76 kAudioLevelHeaderId)); 81 kAudioLevelHeaderId));
77
78 EXPECT_EQ(0, local_base_->StartSend(local_sender_)); 82 EXPECT_EQ(0, local_base_->StartSend(local_sender_));
79 83
80 EXPECT_EQ(0, remote_base_->Init());
81 reflector_ = remote_base_->CreateChannel(); 84 reflector_ = remote_base_->CreateChannel();
82 static_cast<webrtc::VoiceEngineImpl*>(remote_voe_) 85 static_cast<webrtc::VoiceEngineImpl*>(remote_voe_)
83 ->GetChannelProxy(reflector_) 86 ->GetChannelProxy(reflector_)
84 ->RegisterLegacyReceiveCodecs(); 87 ->RegisterLegacyReceiveCodecs();
85 EXPECT_EQ(0, remote_network_->RegisterExternalTransport(reflector_, *this)); 88 EXPECT_EQ(0, remote_network_->RegisterExternalTransport(reflector_, *this));
86 EXPECT_EQ(0, remote_rtp_rtcp_->SetLocalSSRC(reflector_, kReflectorSsrc)); 89 EXPECT_EQ(0, remote_rtp_rtcp_->SetLocalSSRC(reflector_, kReflectorSsrc));
87 90
88 thread_.Start(); 91 thread_.Start();
89 thread_.SetPriority(rtc::kHighPriority); 92 thread_.SetPriority(rtc::kHighPriority);
90 } 93 }
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 int dst = GetReceiverChannelForSsrc(id); 298 int dst = GetReceiverChannelForSsrc(id);
296 if (dst == -1) { 299 if (dst == -1) {
297 return false; 300 return false;
298 } 301 }
299 EXPECT_EQ(0, local_rtp_rtcp_->GetRTCPStatistics(dst, *stats)); 302 EXPECT_EQ(0, local_rtp_rtcp_->GetRTCPStatistics(dst, *stats));
300 return true; 303 return true;
301 } 304 }
302 305
303 } // namespace voetest 306 } // namespace voetest
304 } // namespace webrtc 307 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698