| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // PeerConnection. This is a bit of a strange way to apply local audio | 204 // PeerConnection. This is a bit of a strange way to apply local audio |
| 205 // options since it is also applied to all streams/channels, local or remote. | 205 // options since it is also applied to all streams/channels, local or remote. |
| 206 if (track_->enabled() && track_->GetSource() && | 206 if (track_->enabled() && track_->GetSource() && |
| 207 !track_->GetSource()->remote()) { | 207 !track_->GetSource()->remote()) { |
| 208 // TODO(xians): Remove this static_cast since we should be able to connect | 208 // TODO(xians): Remove this static_cast since we should be able to connect |
| 209 // a remote audio track to a peer connection. | 209 // a remote audio track to a peer connection. |
| 210 options = static_cast<LocalAudioSource*>(track_->GetSource())->options(); | 210 options = static_cast<LocalAudioSource*>(track_->GetSource())->options(); |
| 211 } | 211 } |
| 212 #endif | 212 #endif |
| 213 | 213 |
| 214 // Use the renderer if the audio track has one, otherwise use the sink | 214 cricket::AudioRenderer* renderer = sink_adapter_.get(); |
| 215 // adapter owned by this class. | |
| 216 cricket::AudioRenderer* renderer = | |
| 217 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); | |
| 218 ASSERT(renderer != nullptr); | 215 ASSERT(renderer != nullptr); |
| 219 provider_->SetAudioSend(ssrc_, track_->enabled(), options, renderer); | 216 provider_->SetAudioSend(ssrc_, track_->enabled(), options, renderer); |
| 220 } | 217 } |
| 221 | 218 |
| 222 VideoRtpSender::VideoRtpSender(VideoTrackInterface* track, | 219 VideoRtpSender::VideoRtpSender(VideoTrackInterface* track, |
| 223 const std::string& stream_id, | 220 const std::string& stream_id, |
| 224 VideoProviderInterface* provider) | 221 VideoProviderInterface* provider) |
| 225 : id_(track->id()), | 222 : id_(track->id()), |
| 226 stream_id_(stream_id), | 223 stream_id_(stream_id), |
| 227 provider_(provider), | 224 provider_(provider), |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 RTC_DCHECK(!stopped_ && can_send_track()); | 339 RTC_DCHECK(!stopped_ && can_send_track()); |
| 343 const cricket::VideoOptions* options = nullptr; | 340 const cricket::VideoOptions* options = nullptr; |
| 344 VideoSourceInterface* source = track_->GetSource(); | 341 VideoSourceInterface* source = track_->GetSource(); |
| 345 if (track_->enabled() && source) { | 342 if (track_->enabled() && source) { |
| 346 options = source->options(); | 343 options = source->options(); |
| 347 } | 344 } |
| 348 provider_->SetVideoSend(ssrc_, track_->enabled(), options); | 345 provider_->SetVideoSend(ssrc_, track_->enabled(), options); |
| 349 } | 346 } |
| 350 | 347 |
| 351 } // namespace webrtc | 348 } // namespace webrtc |
| OLD | NEW |