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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "content/browser/media/capture/audio_mirroring_manager.h" | 9 #include "content/browser/media/capture/audio_mirroring_manager.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 void Stop() override { worker_.Stop(); } | 43 void Stop() override { worker_.Stop(); } |
44 void SetVolume(double volume) override {} | 44 void SetVolume(double volume) override {} |
45 void GetVolume(double* volume) override { *volume = 0; } | 45 void GetVolume(double* volume) override { *volume = 0; } |
46 void Close() override { delete this; } | 46 void Close() override { delete this; } |
47 | 47 |
48 private: | 48 private: |
49 ~AudioDiscarder() override {} | 49 ~AudioDiscarder() override {} |
50 | 50 |
51 void FetchAudioData(AudioSourceCallback* callback) { | 51 void FetchAudioData(AudioSourceCallback* callback) { |
52 callback->OnMoreData(audio_bus_.get(), 0); | 52 callback->OnMoreData(audio_bus_.get(), 0, 0); |
53 } | 53 } |
54 | 54 |
55 // Calls FetchAudioData() at regular intervals and discards the data. | 55 // Calls FetchAudioData() at regular intervals and discards the data. |
56 media::FakeAudioWorker worker_; | 56 media::FakeAudioWorker worker_; |
57 scoped_ptr<media::AudioBus> audio_bus_; | 57 scoped_ptr<media::AudioBus> audio_bus_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(AudioDiscarder); | 59 DISALLOW_COPY_AND_ASSIGN(AudioDiscarder); |
60 }; | 60 }; |
61 | 61 |
62 } // namespace | 62 } // namespace |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 is_muting_ = false; | 146 is_muting_ = false; |
147 BrowserThread::PostTask( | 147 BrowserThread::PostTask( |
148 BrowserThread::IO, | 148 BrowserThread::IO, |
149 FROM_HERE, | 149 FROM_HERE, |
150 base::Bind(&AudioMirroringManager::StopMirroring, | 150 base::Bind(&AudioMirroringManager::StopMirroring, |
151 base::Unretained(AudioMirroringManager::GetInstance()), | 151 base::Unretained(AudioMirroringManager::GetInstance()), |
152 destination_)); | 152 destination_)); |
153 } | 153 } |
154 | 154 |
155 } // namespace content | 155 } // namespace content |
OLD | NEW |