| 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/browser/media/capture/web_contents_audio_muter.h" | 5 #include "content/browser/media/capture/web_contents_audio_muter.h" |
| 6 | 6 |
| 7 #include <set> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" |
| 10 #include "content/browser/media/capture/audio_mirroring_manager.h" | 13 #include "content/browser/media/capture/audio_mirroring_manager.h" |
| 11 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/render_frame_host.h" | 15 #include "content/public/browser/render_frame_host.h" |
| 13 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 14 #include "media/audio/audio_io.h" | 17 #include "media/audio/audio_io.h" |
| 15 #include "media/audio/audio_manager.h" | 18 #include "media/audio/audio_manager.h" |
| 16 #include "media/audio/fake_audio_worker.h" | 19 #include "media/audio/fake_audio_worker.h" |
| 17 #include "media/base/bind_to_current_loop.h" | 20 #include "media/base/bind_to_current_loop.h" |
| 18 | 21 |
| 19 namespace content { | 22 namespace content { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 43 } | 46 } |
| 44 void Stop() override { worker_.Stop(); } | 47 void Stop() override { worker_.Stop(); } |
| 45 void SetVolume(double volume) override {} | 48 void SetVolume(double volume) override {} |
| 46 void GetVolume(double* volume) override { *volume = 0; } | 49 void GetVolume(double* volume) override { *volume = 0; } |
| 47 void Close() override { delete this; } | 50 void Close() override { delete this; } |
| 48 | 51 |
| 49 private: | 52 private: |
| 50 ~AudioDiscarder() override {} | 53 ~AudioDiscarder() override {} |
| 51 | 54 |
| 52 void FetchAudioData(AudioSourceCallback* callback) { | 55 void FetchAudioData(AudioSourceCallback* callback) { |
| 53 callback->OnMoreData(audio_bus_.get(), 0, 0); | 56 callback->OnMoreData(audio_bus_.get(), 0, base::TimeDelta(), 0); |
| 54 } | 57 } |
| 55 | 58 |
| 56 // Calls FetchAudioData() at regular intervals and discards the data. | 59 // Calls FetchAudioData() at regular intervals and discards the data. |
| 57 media::FakeAudioWorker worker_; | 60 media::FakeAudioWorker worker_; |
| 58 std::unique_ptr<media::AudioBus> audio_bus_; | 61 std::unique_ptr<media::AudioBus> audio_bus_; |
| 59 | 62 |
| 60 DISALLOW_COPY_AND_ASSIGN(AudioDiscarder); | 63 DISALLOW_COPY_AND_ASSIGN(AudioDiscarder); |
| 61 }; | 64 }; |
| 62 | 65 |
| 63 } // namespace | 66 } // namespace |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 return; | 154 return; |
| 152 is_muting_ = false; | 155 is_muting_ = false; |
| 153 BrowserThread::PostTask( | 156 BrowserThread::PostTask( |
| 154 BrowserThread::IO, FROM_HERE, | 157 BrowserThread::IO, FROM_HERE, |
| 155 base::Bind(&AudioMirroringManager::StopMirroring, | 158 base::Bind(&AudioMirroringManager::StopMirroring, |
| 156 base::Unretained(AudioMirroringManager::GetInstance()), | 159 base::Unretained(AudioMirroringManager::GetInstance()), |
| 157 base::RetainedRef(destination_))); | 160 base::RetainedRef(destination_))); |
| 158 } | 161 } |
| 159 | 162 |
| 160 } // namespace content | 163 } // namespace content |
| OLD | NEW |