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

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

Issue 195763008: Revert 255158 "Avoid hitting the thread check when WebRtcAudioRe..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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
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
186 renderer_ = NULL; 180 renderer_ = NULL;
187 playing_ = false; 181 playing_ = false;
188 } 182 }
189 183
190 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( 184 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback(
191 webrtc::AudioTransport* audio_callback) { 185 webrtc::AudioTransport* audio_callback) {
192 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()"; 186 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()";
193 DCHECK(thread_checker_.CalledOnValidThread()); 187 DCHECK(thread_checker_.CalledOnValidThread());
194 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL); 188 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL);
195 audio_transport_callback_ = audio_callback; 189 audio_transport_callback_ = audio_callback;
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 return; 533 return;
540 534
541 default_capturer->StartAecDump(aec_dump_file_); 535 default_capturer->StartAecDump(aec_dump_file_);
542 536
543 // Invalidate the |aec_dump_file_| since the ownership of the file has been 537 // Invalidate the |aec_dump_file_| since the ownership of the file has been
544 // passed to WebRtc. 538 // passed to WebRtc.
545 aec_dump_file_ = base::kInvalidPlatformFileValue; 539 aec_dump_file_ = base::kInvalidPlatformFileValue;
546 } 540 }
547 541
548 } // namespace content 542 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/renderer/media/webrtc_audio_device_impl.h ('k') | trunk/src/content/renderer/media/webrtc_audio_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698