OLD | NEW |
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 Loading... |
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 Loading... |
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(packet, length); |
126 } | 129 } |
127 | 130 |
128 bool AudioSendStream::SendTelephoneEvent(int payload_type, int event, | 131 bool AudioSendStream::SendTelephoneEvent(int payload_type, int event, |
129 int duration_ms) { | 132 int duration_ms) { |
130 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 133 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
131 return channel_proxy_->SetSendTelephoneEventPayloadType(payload_type) && | 134 return channel_proxy_->SetSendTelephoneEventPayloadType(payload_type) && |
132 channel_proxy_->SendTelephoneEventOutband(event, duration_ms); | 135 channel_proxy_->SendTelephoneEventOutband(event, duration_ms); |
133 } | 136 } |
134 | 137 |
135 webrtc::AudioSendStream::Stats AudioSendStream::GetStats() const { | 138 webrtc::AudioSendStream::Stats AudioSendStream::GetStats() const { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 225 |
223 VoiceEngine* AudioSendStream::voice_engine() const { | 226 VoiceEngine* AudioSendStream::voice_engine() const { |
224 internal::AudioState* audio_state = | 227 internal::AudioState* audio_state = |
225 static_cast<internal::AudioState*>(audio_state_.get()); | 228 static_cast<internal::AudioState*>(audio_state_.get()); |
226 VoiceEngine* voice_engine = audio_state->voice_engine(); | 229 VoiceEngine* voice_engine = audio_state->voice_engine(); |
227 RTC_DCHECK(voice_engine); | 230 RTC_DCHECK(voice_engine); |
228 return voice_engine; | 231 return voice_engine; |
229 } | 232 } |
230 } // namespace internal | 233 } // namespace internal |
231 } // namespace webrtc | 234 } // namespace webrtc |
OLD | NEW |