OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" | 5 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/renderer/media/media_stream_audio_processor.h" | 8 #include "content/renderer/media/media_stream_audio_processor.h" |
9 #include "content/renderer/media/webrtc/webrtc_audio_sink_adapter.h" | 9 #include "content/renderer/media/webrtc/webrtc_audio_sink_adapter.h" |
10 #include "content/renderer/media/webrtc_local_audio_track.h" | 10 #include "content/renderer/media/webrtc_local_audio_track.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 std::find(voe_channels_.begin(), voe_channels_.end(), channel_id); | 136 std::find(voe_channels_.begin(), voe_channels_.end(), channel_id); |
137 DCHECK(iter != voe_channels_.end()); | 137 DCHECK(iter != voe_channels_.end()); |
138 voe_channels_.erase(iter); | 138 voe_channels_.erase(iter); |
139 } | 139 } |
140 | 140 |
141 webrtc::AudioSourceInterface* WebRtcLocalAudioTrackAdapter::GetSource() const { | 141 webrtc::AudioSourceInterface* WebRtcLocalAudioTrackAdapter::GetSource() const { |
142 return track_source_; | 142 return track_source_; |
143 } | 143 } |
144 | 144 |
145 cricket::AudioRenderer* WebRtcLocalAudioTrackAdapter::GetRenderer() { | 145 cricket::AudioRenderer* WebRtcLocalAudioTrackAdapter::GetRenderer() { |
146 return this; | 146 // When the audio track processing is enabled, return a NULL so that capture |
| 147 // data goes through Libjingle LocalAudioTrackHandler::LocalAudioSinkAdapter |
| 148 // ==> WebRtcVoiceMediaChannel::WebRtcVoiceChannelRenderer ==> WebRTC. |
| 149 // When the audio track processing is disabled, WebRtcLocalAudioTrackAdapter |
| 150 // is used to pass the channel ids to WebRtcAudioDeviceImpl, the data flow |
| 151 // becomes WebRtcAudioDeviceImpl ==> WebRTC. |
| 152 // TODO(xians): Only return NULL after the APM in WebRTC is deprecated. |
| 153 // See See http://crbug/365672 for details. |
| 154 return MediaStreamAudioProcessor::IsAudioTrackProcessingEnabled()? |
| 155 NULL : this; |
147 } | 156 } |
148 | 157 |
149 } // namespace content | 158 } // namespace content |
OLD | NEW |