 Chromium Code Reviews
 Chromium Code Reviews Issue 1576913002:
  Remove cast to LocalAudioSource from AudioRtpSender.  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master
    
  
    Issue 1576913002:
  Remove cast to LocalAudioSource from AudioRtpSender.  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 provider_->SetAudioSend(ssrc_, false, options, nullptr); | 176 provider_->SetAudioSend(ssrc_, false, options, nullptr); | 
| 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; | |
| 187 if (track_->enabled() && track_->GetSource() && | |
| 188 !track_->GetSource()->remote()) { | |
| 189 // TODO(xians): Remove this static_cast since we should be able to connect | |
| 190 // a remote audio track to a peer connection. | |
| 191 options = static_cast<LocalAudioSource*>(track_->GetSource())->options(); | |
| 192 } | |
| 193 | |
| 194 // Use the renderer if the audio track has one, otherwise use the sink | 186 // Use the renderer if the audio track has one, otherwise use the sink | 
| 195 // adapter owned by this class. | 187 // adapter owned by this class. | 
| 196 cricket::AudioRenderer* renderer = | 188 cricket::AudioRenderer* renderer = | 
| 197 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); | 189 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); | 
| 198 ASSERT(renderer != nullptr); | 190 ASSERT(renderer != nullptr); | 
| 199 provider_->SetAudioSend(ssrc_, track_->enabled(), options, renderer); | 191 provider_->SetAudioSend(ssrc_, track_->enabled(), cricket::AudioOptions(), | 
| 192 renderer); | |
| 
the sun
2016/01/11 14:49:31
Are you sure these options are always empty? Is th
 
tommi
2016/01/14 16:24:11
In the case of Chrome, these options usually conta
 
the sun
2016/01/18 15:01:32
Non-Chrome clients use the VoE APM instance, e.g.
 | |
| 200 } | 193 } | 
| 201 | 194 | 
| 202 VideoRtpSender::VideoRtpSender(VideoTrackInterface* track, | 195 VideoRtpSender::VideoRtpSender(VideoTrackInterface* track, | 
| 203 const std::string& stream_id, | 196 const std::string& stream_id, | 
| 204 VideoProviderInterface* provider) | 197 VideoProviderInterface* provider) | 
| 205 : id_(track->id()), | 198 : id_(track->id()), | 
| 206 stream_id_(stream_id), | 199 stream_id_(stream_id), | 
| 207 provider_(provider), | 200 provider_(provider), | 
| 208 track_(track), | 201 track_(track), | 
| 209 cached_track_enabled_(track->enabled()) { | 202 cached_track_enabled_(track->enabled()) { | 
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 RTC_DCHECK(!stopped_ && can_send_track()); | 304 RTC_DCHECK(!stopped_ && can_send_track()); | 
| 312 const cricket::VideoOptions* options = nullptr; | 305 const cricket::VideoOptions* options = nullptr; | 
| 313 VideoSourceInterface* source = track_->GetSource(); | 306 VideoSourceInterface* source = track_->GetSource(); | 
| 314 if (track_->enabled() && source) { | 307 if (track_->enabled() && source) { | 
| 315 options = source->options(); | 308 options = source->options(); | 
| 316 } | 309 } | 
| 317 provider_->SetVideoSend(ssrc_, track_->enabled(), options); | 310 provider_->SetVideoSend(ssrc_, track_->enabled(), options); | 
| 318 } | 311 } | 
| 319 | 312 | 
| 320 } // namespace webrtc | 313 } // namespace webrtc | 
| OLD | NEW |