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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 typedef AudioMirroringManager::SourceFrameRef SourceFrameRef; | 58 typedef AudioMirroringManager::SourceFrameRef SourceFrameRef; |
59 | 59 |
60 enum State { | 60 enum State { |
61 CONSTRUCTED, | 61 CONSTRUCTED, |
62 OPENED, | 62 OPENED, |
63 MIRRORING, | 63 MIRRORING, |
64 CLOSED | 64 CLOSED |
65 }; | 65 }; |
66 | 66 |
67 virtual ~Impl(); | 67 ~Impl() override; |
68 | 68 |
69 // Notifies the consumer callback that the stream is now dead. | 69 // Notifies the consumer callback that the stream is now dead. |
70 void ReportError(); | 70 void ReportError(); |
71 | 71 |
72 // (Re-)Start/Stop mirroring by posting a call to AudioMirroringManager on the | 72 // (Re-)Start/Stop mirroring by posting a call to AudioMirroringManager on the |
73 // IO BrowserThread. | 73 // IO BrowserThread. |
74 void StartMirroring(); | 74 void StartMirroring(); |
75 void StopMirroring(); | 75 void StopMirroring(); |
76 | 76 |
77 // Invoked on the UI thread to make sure WebContents muting is turned off for | 77 // Invoked on the UI thread to make sure WebContents muting is turned off for |
78 // successful audio capture. | 78 // successful audio capture. |
79 void UnmuteWebContentsAudio(); | 79 void UnmuteWebContentsAudio(); |
80 | 80 |
81 // AudioMirroringManager::MirroringDestination implementation | 81 // AudioMirroringManager::MirroringDestination implementation |
82 virtual void QueryForMatches( | 82 void QueryForMatches(const std::set<SourceFrameRef>& candidates, |
83 const std::set<SourceFrameRef>& candidates, | 83 const MatchesCallback& results_callback) override; |
84 const MatchesCallback& results_callback) override; | |
85 void QueryForMatchesOnUIThread(const std::set<SourceFrameRef>& candidates, | 84 void QueryForMatchesOnUIThread(const std::set<SourceFrameRef>& candidates, |
86 const MatchesCallback& results_callback); | 85 const MatchesCallback& results_callback); |
87 virtual media::AudioOutputStream* AddInput( | 86 media::AudioOutputStream* AddInput( |
88 const media::AudioParameters& params) override; | 87 const media::AudioParameters& params) override; |
89 | 88 |
90 // Callback which is run when |stream| is closed. Deletes |stream|. | 89 // Callback which is run when |stream| is closed. Deletes |stream|. |
91 void ReleaseInput(media::VirtualAudioOutputStream* stream); | 90 void ReleaseInput(media::VirtualAudioOutputStream* stream); |
92 | 91 |
93 // Called by WebContentsTracker when the target of the audio mirroring has | 92 // Called by WebContentsTracker when the target of the audio mirroring has |
94 // changed. | 93 // changed. |
95 void OnTargetChanged(RenderWidgetHost* target); | 94 void OnTargetChanged(RenderWidgetHost* target); |
96 | 95 |
97 // Injected dependencies. | 96 // Injected dependencies. |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 388 |
390 bool WebContentsAudioInputStream::GetAutomaticGainControl() { | 389 bool WebContentsAudioInputStream::GetAutomaticGainControl() { |
391 return impl_->mixer_stream()->GetAutomaticGainControl(); | 390 return impl_->mixer_stream()->GetAutomaticGainControl(); |
392 } | 391 } |
393 | 392 |
394 bool WebContentsAudioInputStream::IsMuted() { | 393 bool WebContentsAudioInputStream::IsMuted() { |
395 return false; | 394 return false; |
396 } | 395 } |
397 | 396 |
398 } // namespace content | 397 } // namespace content |
OLD | NEW |