| 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 !defined(WEBRTC_CHROMIUM_BUILD) |
| 188 // TODO(tommi): Remove this hack when we move CreateAudioSource out of |
| 189 // PeerConnection. This is a bit of a strange way to apply local audio |
| 190 // options since it is also applied to all streams/channels, local or remote. |
| 187 if (track_->enabled() && track_->GetSource() && | 191 if (track_->enabled() && track_->GetSource() && |
| 188 !track_->GetSource()->remote()) { | 192 !track_->GetSource()->remote()) { |
| 189 // TODO(xians): Remove this static_cast since we should be able to connect | 193 // TODO(xians): Remove this static_cast since we should be able to connect |
| 190 // a remote audio track to a peer connection. | 194 // a remote audio track to a peer connection. |
| 191 options = static_cast<LocalAudioSource*>(track_->GetSource())->options(); | 195 options = static_cast<LocalAudioSource*>(track_->GetSource())->options(); |
| 192 } | 196 } |
| 197 #endif |
| 193 | 198 |
| 194 // Use the renderer if the audio track has one, otherwise use the sink | 199 // Use the renderer if the audio track has one, otherwise use the sink |
| 195 // adapter owned by this class. | 200 // adapter owned by this class. |
| 196 cricket::AudioRenderer* renderer = | 201 cricket::AudioRenderer* renderer = |
| 197 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); | 202 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); |
| 198 ASSERT(renderer != nullptr); | 203 ASSERT(renderer != nullptr); |
| 199 provider_->SetAudioSend(ssrc_, track_->enabled(), options, renderer); | 204 provider_->SetAudioSend(ssrc_, track_->enabled(), options, renderer); |
| 200 } | 205 } |
| 201 | 206 |
| 202 VideoRtpSender::VideoRtpSender(VideoTrackInterface* track, | 207 VideoRtpSender::VideoRtpSender(VideoTrackInterface* track, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 RTC_DCHECK(!stopped_ && can_send_track()); | 316 RTC_DCHECK(!stopped_ && can_send_track()); |
| 312 const cricket::VideoOptions* options = nullptr; | 317 const cricket::VideoOptions* options = nullptr; |
| 313 VideoSourceInterface* source = track_->GetSource(); | 318 VideoSourceInterface* source = track_->GetSource(); |
| 314 if (track_->enabled() && source) { | 319 if (track_->enabled() && source) { |
| 315 options = source->options(); | 320 options = source->options(); |
| 316 } | 321 } |
| 317 provider_->SetVideoSend(ssrc_, track_->enabled(), options); | 322 provider_->SetVideoSend(ssrc_, track_->enabled(), options); |
| 318 } | 323 } |
| 319 | 324 |
| 320 } // namespace webrtc | 325 } // namespace webrtc |
| OLD | NEW |