Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(783)

Side by Side Diff: content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc

Issue 310013002: Fix the race when the WebRtcAudioDeviceImpl goes away before capturers stop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed unittests Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698