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

Side by Side Diff: webrtc/audio/audio_send_stream.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: Remove VoENetwork from perf test. Created 4 years, 8 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); 69 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
70 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); 70 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id);
71 channel_proxy_->RegisterSenderCongestionControlObjects( 71 channel_proxy_->RegisterSenderCongestionControlObjects(
72 congestion_controller->pacer(), 72 congestion_controller->pacer(),
73 congestion_controller->GetTransportFeedbackObserver(), 73 congestion_controller->GetTransportFeedbackObserver(),
74 congestion_controller->packet_router()); 74 congestion_controller->packet_router());
75 channel_proxy_->SetRTCPStatus(true); 75 channel_proxy_->SetRTCPStatus(true);
76 channel_proxy_->SetLocalSSRC(config.rtp.ssrc); 76 channel_proxy_->SetLocalSSRC(config.rtp.ssrc);
77 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name); 77 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name);
78 78
79 channel_proxy_->RegisterExternalTransport(config.send_transport);
80
79 for (const auto& extension : config.rtp.extensions) { 81 for (const auto& extension : config.rtp.extensions) {
80 if (extension.name == RtpExtension::kAbsSendTime) { 82 if (extension.name == RtpExtension::kAbsSendTime) {
81 channel_proxy_->SetSendAbsoluteSenderTimeStatus(true, extension.id); 83 channel_proxy_->SetSendAbsoluteSenderTimeStatus(true, extension.id);
82 } else if (extension.name == RtpExtension::kAudioLevel) { 84 } else if (extension.name == RtpExtension::kAudioLevel) {
83 channel_proxy_->SetSendAudioLevelIndicationStatus(true, extension.id); 85 channel_proxy_->SetSendAudioLevelIndicationStatus(true, extension.id);
84 } else if (extension.name == RtpExtension::kTransportSequenceNumber) { 86 } else if (extension.name == RtpExtension::kTransportSequenceNumber) {
85 channel_proxy_->EnableSendTransportSequenceNumber(extension.id); 87 channel_proxy_->EnableSendTransportSequenceNumber(extension.id);
86 } else { 88 } else {
87 RTC_NOTREACHED() << "Registering unsupported RTP extension."; 89 RTC_NOTREACHED() << "Registering unsupported RTP extension.";
88 } 90 }
89 } 91 }
90 } 92 }
91 93
92 AudioSendStream::~AudioSendStream() { 94 AudioSendStream::~AudioSendStream() {
93 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 95 RTC_DCHECK(thread_checker_.CalledOnValidThread());
94 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString(); 96 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString();
97 channel_proxy_->DeRegisterExternalTransport();
95 channel_proxy_->ResetCongestionControlObjects(); 98 channel_proxy_->ResetCongestionControlObjects();
96 } 99 }
97 100
98 void AudioSendStream::Start() { 101 void AudioSendStream::Start() {
99 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 102 RTC_DCHECK(thread_checker_.CalledOnValidThread());
100 ScopedVoEInterface<VoEBase> base(voice_engine()); 103 ScopedVoEInterface<VoEBase> base(voice_engine());
101 int error = base->StartSend(config_.voe_channel_id); 104 int error = base->StartSend(config_.voe_channel_id);
102 if (error != 0) { 105 if (error != 0) {
103 LOG(LS_ERROR) << "AudioSendStream::Start failed with error: " << error; 106 LOG(LS_ERROR) << "AudioSendStream::Start failed with error: " << error;
104 } 107 }
(...skipping 10 matching lines...) Expand all
115 118
116 void AudioSendStream::SignalNetworkState(NetworkState state) { 119 void AudioSendStream::SignalNetworkState(NetworkState state) {
117 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 120 RTC_DCHECK(thread_checker_.CalledOnValidThread());
118 } 121 }
119 122
120 bool AudioSendStream::DeliverRtcp(const uint8_t* packet, size_t length) { 123 bool AudioSendStream::DeliverRtcp(const uint8_t* packet, size_t length) {
121 // TODO(solenberg): Tests call this function on a network thread, libjingle 124 // TODO(solenberg): Tests call this function on a network thread, libjingle
122 // calls on the worker thread. We should move towards always using a network 125 // calls on the worker thread. We should move towards always using a network
123 // thread. Then this check can be enabled. 126 // thread. Then this check can be enabled.
124 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); 127 // RTC_DCHECK(!thread_checker_.CalledOnValidThread());
125 return false; 128 return channel_proxy_->ReceivedRTCPPacket(static_cast<const uint8_t*>(packet),
the sun 2016/04/22 12:40:31 Looks like this cast is not needed anymore?
mflodman 2016/04/27 13:42:17 Done.
129 length) == 0;
126 } 130 }
127 131
128 bool AudioSendStream::SendTelephoneEvent(int payload_type, int event, 132 bool AudioSendStream::SendTelephoneEvent(int payload_type, int event,
129 int duration_ms) { 133 int duration_ms) {
130 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 134 RTC_DCHECK(thread_checker_.CalledOnValidThread());
131 return channel_proxy_->SetSendTelephoneEventPayloadType(payload_type) && 135 return channel_proxy_->SetSendTelephoneEventPayloadType(payload_type) &&
132 channel_proxy_->SendTelephoneEventOutband(event, duration_ms); 136 channel_proxy_->SendTelephoneEventOutband(event, duration_ms);
133 } 137 }
134 138
135 webrtc::AudioSendStream::Stats AudioSendStream::GetStats() const { 139 webrtc::AudioSendStream::Stats AudioSendStream::GetStats() const {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 226
223 VoiceEngine* AudioSendStream::voice_engine() const { 227 VoiceEngine* AudioSendStream::voice_engine() const {
224 internal::AudioState* audio_state = 228 internal::AudioState* audio_state =
225 static_cast<internal::AudioState*>(audio_state_.get()); 229 static_cast<internal::AudioState*>(audio_state_.get());
226 VoiceEngine* voice_engine = audio_state->voice_engine(); 230 VoiceEngine* voice_engine = audio_state->voice_engine();
227 RTC_DCHECK(voice_engine); 231 RTC_DCHECK(voice_engine);
228 return voice_engine; 232 return voice_engine;
229 } 233 }
230 } // namespace internal 234 } // namespace internal
231 } // namespace webrtc 235 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698