OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/atomic_ref_count.h" | 11 #include "base/atomic_ref_count.h" |
DaleCurtis
2013/06/04 18:28:05
Cleanup includes.
no longer working on chromium
2013/06/05 09:30:11
Done.
| |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
17 #include "media/audio/audio_manager.h" | 17 #include "media/audio/audio_manager.h" |
18 | 18 |
19 #include "media/audio/audio_output_dispatcher.h" | 19 #include "media/audio/audio_output_dispatcher.h" |
20 | 20 |
21 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 const AudioParameters& params, | 53 const AudioParameters& params, |
54 const std::string& input_device_id) OVERRIDE; | 54 const std::string& input_device_id) OVERRIDE; |
55 | 55 |
56 virtual AudioInputStream* MakeAudioInputStream( | 56 virtual AudioInputStream* MakeAudioInputStream( |
57 const AudioParameters& params, const std::string& device_id) OVERRIDE; | 57 const AudioParameters& params, const std::string& device_id) OVERRIDE; |
58 | 58 |
59 virtual AudioOutputStream* MakeAudioOutputStreamProxy( | 59 virtual AudioOutputStream* MakeAudioOutputStreamProxy( |
60 const AudioParameters& params, | 60 const AudioParameters& params, |
61 const std::string& input_device_id) OVERRIDE; | 61 const std::string& input_device_id) OVERRIDE; |
62 | 62 |
63 virtual bool IsRecordingInProcess() OVERRIDE; | |
64 | |
65 // Called internally by the audio stream when it has been closed. | 63 // Called internally by the audio stream when it has been closed. |
66 virtual void ReleaseOutputStream(AudioOutputStream* stream); | 64 virtual void ReleaseOutputStream(AudioOutputStream* stream); |
67 virtual void ReleaseInputStream(AudioInputStream* stream); | 65 virtual void ReleaseInputStream(AudioInputStream* stream); |
68 | 66 |
69 void IncreaseActiveInputStreamCount(); | |
70 void DecreaseActiveInputStreamCount(); | |
71 | |
72 // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy | 67 // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy |
73 // name is also from |AUDIO_PCM_LINEAR|. | 68 // name is also from |AUDIO_PCM_LINEAR|. |
74 virtual AudioOutputStream* MakeLinearOutputStream( | 69 virtual AudioOutputStream* MakeLinearOutputStream( |
75 const AudioParameters& params) = 0; | 70 const AudioParameters& params) = 0; |
76 | 71 |
77 // Creates the output stream for the |AUDIO_PCM_LOW_LATENCY| format. | 72 // Creates the output stream for the |AUDIO_PCM_LOW_LATENCY| format. |
78 // |input_device_id| is used by unified IO to open the correct input device. | 73 // |input_device_id| is used by unified IO to open the correct input device. |
79 virtual AudioOutputStream* MakeLowLatencyOutputStream( | 74 virtual AudioOutputStream* MakeLowLatencyOutputStream( |
80 const AudioParameters& params, const std::string& input_device_id) = 0; | 75 const AudioParameters& params, const std::string& input_device_id) = 0; |
81 | 76 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 | 124 |
130 private: | 125 private: |
131 struct DispatcherParams; | 126 struct DispatcherParams; |
132 typedef ScopedVector<DispatcherParams> AudioOutputDispatchers; | 127 typedef ScopedVector<DispatcherParams> AudioOutputDispatchers; |
133 | 128 |
134 class CompareByParams; | 129 class CompareByParams; |
135 | 130 |
136 // Called by Shutdown(). | 131 // Called by Shutdown(). |
137 void ShutdownOnAudioThread(); | 132 void ShutdownOnAudioThread(); |
138 | 133 |
139 // Counts the number of active input streams to find out if something else | |
140 // is currently recording in Chrome. | |
141 base::AtomicRefCount num_active_input_streams_; | |
142 | |
143 // Max number of open output streams, modified by | 134 // Max number of open output streams, modified by |
144 // SetMaxOutputStreamsAllowed(). | 135 // SetMaxOutputStreamsAllowed(). |
145 int max_num_output_streams_; | 136 int max_num_output_streams_; |
146 | 137 |
147 // Max number of open input streams. | 138 // Max number of open input streams. |
148 int max_num_input_streams_; | 139 int max_num_input_streams_; |
149 | 140 |
150 // Number of currently open output streams. | 141 // Number of currently open output streams. |
151 int num_output_streams_; | 142 int num_output_streams_; |
152 | 143 |
(...skipping 15 matching lines...) Expand all Loading... | |
168 // Map of cached AudioOutputDispatcher instances. Must only be touched | 159 // Map of cached AudioOutputDispatcher instances. Must only be touched |
169 // from the audio thread (no locking). | 160 // from the audio thread (no locking). |
170 AudioOutputDispatchers output_dispatchers_; | 161 AudioOutputDispatchers output_dispatchers_; |
171 | 162 |
172 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 163 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
173 }; | 164 }; |
174 | 165 |
175 } // namespace media | 166 } // namespace media |
176 | 167 |
177 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 168 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
OLD | NEW |