OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/media/capture/web_contents_audio_input_stream.h" | 5 #include "content/browser/media/capture/web_contents_audio_input_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 DCHECK(thread_checker_.CalledOnValidThread()); | 221 DCHECK(thread_checker_.CalledOnValidThread()); |
222 | 222 |
223 // TODO(miu): Need clean-up of AudioInputCallback interface in a future | 223 // TODO(miu): Need clean-up of AudioInputCallback interface in a future |
224 // change, since its only implementation ignores the first argument entirely | 224 // change, since its only implementation ignores the first argument entirely |
225 callback_->OnError(NULL); | 225 callback_->OnError(NULL); |
226 } | 226 } |
227 | 227 |
228 void WebContentsAudioInputStream::Impl::StartMirroring() { | 228 void WebContentsAudioInputStream::Impl::StartMirroring() { |
229 DCHECK(thread_checker_.CalledOnValidThread()); | 229 DCHECK(thread_checker_.CalledOnValidThread()); |
230 | 230 |
231 BrowserThread::PostTask( | 231 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
232 BrowserThread::IO, | 232 base::Bind(&AudioMirroringManager::StartMirroring, |
233 FROM_HERE, | 233 base::Unretained(mirroring_manager_), |
234 base::Bind(&AudioMirroringManager::StartMirroring, | 234 base::RetainedRef(this))); |
235 base::Unretained(mirroring_manager_), | |
236 make_scoped_refptr(this))); | |
237 } | 235 } |
238 | 236 |
239 void WebContentsAudioInputStream::Impl::StopMirroring() { | 237 void WebContentsAudioInputStream::Impl::StopMirroring() { |
240 DCHECK(thread_checker_.CalledOnValidThread()); | 238 DCHECK(thread_checker_.CalledOnValidThread()); |
241 | 239 |
242 BrowserThread::PostTask( | 240 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
243 BrowserThread::IO, | 241 base::Bind(&AudioMirroringManager::StopMirroring, |
244 FROM_HERE, | 242 base::Unretained(mirroring_manager_), |
245 base::Bind(&AudioMirroringManager::StopMirroring, | 243 base::RetainedRef(this))); |
246 base::Unretained(mirroring_manager_), | |
247 make_scoped_refptr(this))); | |
248 } | 244 } |
249 | 245 |
250 void WebContentsAudioInputStream::Impl::UnmuteWebContentsAudio() { | 246 void WebContentsAudioInputStream::Impl::UnmuteWebContentsAudio() { |
251 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 247 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
252 | 248 |
253 WebContents* const contents = tracker_->web_contents(); | 249 WebContents* const contents = tracker_->web_contents(); |
254 if (contents) | 250 if (contents) |
255 contents->SetAudioMuted(false); | 251 contents->SetAudioMuted(false); |
256 } | 252 } |
257 | 253 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 384 |
389 bool WebContentsAudioInputStream::GetAutomaticGainControl() { | 385 bool WebContentsAudioInputStream::GetAutomaticGainControl() { |
390 return impl_->mixer_stream()->GetAutomaticGainControl(); | 386 return impl_->mixer_stream()->GetAutomaticGainControl(); |
391 } | 387 } |
392 | 388 |
393 bool WebContentsAudioInputStream::IsMuted() { | 389 bool WebContentsAudioInputStream::IsMuted() { |
394 return false; | 390 return false; |
395 } | 391 } |
396 | 392 |
397 } // namespace content | 393 } // namespace content |
OLD | NEW |