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

Side by Side Diff: content/renderer/media/webrtc_audio_device_impl.cc

Issue 198303002: Reland "Avoid hitting the thread check when WebRtcAudioRenderer is going away" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « content/renderer/media/webrtc_audio_device_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_audio_device_impl.h" 5 #include "content/renderer/media/webrtc_audio_device_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/platform_file.h" 9 #include "base/platform_file.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 for (PlayoutDataSinkList::const_iterator it = playout_sinks_.begin(); 170 for (PlayoutDataSinkList::const_iterator it = playout_sinks_.begin();
171 it != playout_sinks_.end(); ++it) { 171 it != playout_sinks_.end(); ++it) {
172 (*it)->OnPlayoutData(audio_bus, sample_rate, audio_delay_milliseconds); 172 (*it)->OnPlayoutData(audio_bus, sample_rate, audio_delay_milliseconds);
173 } 173 }
174 } 174 }
175 175
176 void WebRtcAudioDeviceImpl::RemoveAudioRenderer(WebRtcAudioRenderer* renderer) { 176 void WebRtcAudioDeviceImpl::RemoveAudioRenderer(WebRtcAudioRenderer* renderer) {
177 DCHECK(thread_checker_.CalledOnValidThread()); 177 DCHECK(thread_checker_.CalledOnValidThread());
178 DCHECK_EQ(renderer, renderer_); 178 DCHECK_EQ(renderer, renderer_);
179 base::AutoLock auto_lock(lock_); 179 base::AutoLock auto_lock(lock_);
180 // Notify the playout sink of the change.
181 for (PlayoutDataSinkList::const_iterator it = playout_sinks_.begin();
182 it != playout_sinks_.end(); ++it) {
183 (*it)->OnPlayoutDataSourceChanged();
184 }
185
180 renderer_ = NULL; 186 renderer_ = NULL;
181 playing_ = false; 187 playing_ = false;
182 } 188 }
183 189
184 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( 190 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback(
185 webrtc::AudioTransport* audio_callback) { 191 webrtc::AudioTransport* audio_callback) {
186 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()"; 192 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()";
187 DCHECK(thread_checker_.CalledOnValidThread()); 193 DCHECK(thread_checker_.CalledOnValidThread());
188 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL); 194 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL);
189 audio_transport_callback_ = audio_callback; 195 audio_transport_callback_ = audio_callback;
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 return; 539 return;
534 540
535 default_capturer->StartAecDump(aec_dump_file_); 541 default_capturer->StartAecDump(aec_dump_file_);
536 542
537 // Invalidate the |aec_dump_file_| since the ownership of the file has been 543 // Invalidate the |aec_dump_file_| since the ownership of the file has been
538 // passed to WebRtc. 544 // passed to WebRtc.
539 aec_dump_file_ = base::kInvalidPlatformFileValue; 545 aec_dump_file_ = base::kInvalidPlatformFileValue;
540 } 546 }
541 547
542 } // namespace content 548 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_audio_device_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698