OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 if (stats_) { | 177 if (stats_) { |
178 stats_->RemoveLocalAudioTrack(track_.get(), ssrc_); | 178 stats_->RemoveLocalAudioTrack(track_.get(), ssrc_); |
179 } | 179 } |
180 } | 180 } |
181 stopped_ = true; | 181 stopped_ = true; |
182 } | 182 } |
183 | 183 |
184 void AudioRtpSender::SetAudioSend() { | 184 void AudioRtpSender::SetAudioSend() { |
185 RTC_DCHECK(!stopped_ && can_send_track()); | 185 RTC_DCHECK(!stopped_ && can_send_track()); |
186 cricket::AudioOptions options; | 186 cricket::AudioOptions options; |
187 if (track_->enabled() && track_->GetSource()) { | 187 if (track_->enabled() && track_->GetSource() && |
188 !track_->GetSource()->remote()) { | |
188 // TODO(xians): Remove this static_cast since we should be able to connect | 189 // TODO(xians): Remove this static_cast since we should be able to connect |
perkj_webrtc
2015/12/15 10:15:31
Should we rephrase this todo to say that we should
tommi
2015/12/15 11:00:54
I'd like to keep the TODO untouched for now so tha
| |
189 // a remote audio track to a peer connection. | 190 // a remote audio track to a peer connection. |
190 options = static_cast<LocalAudioSource*>(track_->GetSource())->options(); | 191 options = static_cast<LocalAudioSource*>(track_->GetSource())->options(); |
191 } | 192 } |
192 | 193 |
193 // Use the renderer if the audio track has one, otherwise use the sink | 194 // Use the renderer if the audio track has one, otherwise use the sink |
194 // adapter owned by this class. | 195 // adapter owned by this class. |
195 cricket::AudioRenderer* renderer = | 196 cricket::AudioRenderer* renderer = |
196 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); | 197 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); |
197 ASSERT(renderer != nullptr); | 198 ASSERT(renderer != nullptr); |
198 provider_->SetAudioSend(ssrc_, track_->enabled(), options, renderer); | 199 provider_->SetAudioSend(ssrc_, track_->enabled(), options, renderer); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 RTC_DCHECK(!stopped_ && can_send_track()); | 311 RTC_DCHECK(!stopped_ && can_send_track()); |
311 const cricket::VideoOptions* options = nullptr; | 312 const cricket::VideoOptions* options = nullptr; |
312 VideoSourceInterface* source = track_->GetSource(); | 313 VideoSourceInterface* source = track_->GetSource(); |
313 if (track_->enabled() && source) { | 314 if (track_->enabled() && source) { |
314 options = source->options(); | 315 options = source->options(); |
315 } | 316 } |
316 provider_->SetVideoSend(ssrc_, track_->enabled(), options); | 317 provider_->SetVideoSend(ssrc_, track_->enabled(), options); |
317 } | 318 } |
318 | 319 |
319 } // namespace webrtc | 320 } // namespace webrtc |
OLD | NEW |