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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_set> | 10 #include <unordered_set> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "media/audio/audio_debug_recording_manager.h" | |
19 #include "media/audio/audio_device_name.h" | 20 #include "media/audio/audio_device_name.h" |
20 #include "media/audio/audio_manager.h" | 21 #include "media/audio/audio_manager.h" |
21 #include "media/audio/audio_output_dispatcher.h" | 22 #include "media/audio/audio_output_dispatcher.h" |
22 | 23 |
23 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
24 #include "base/win/scoped_com_initializer.h" | 25 #include "base/win/scoped_com_initializer.h" |
25 #endif | 26 #endif |
26 | 27 |
28 namespace base { | |
29 class FilePath; | |
30 } | |
31 | |
27 namespace media { | 32 namespace media { |
28 | 33 |
29 class AudioOutputDispatcher; | 34 class AudioOutputDispatcher; |
30 | 35 |
31 // AudioManagerBase provides AudioManager functions common for all platforms. | 36 // AudioManagerBase provides AudioManager functions common for all platforms. |
32 class MEDIA_EXPORT AudioManagerBase : public AudioManager { | 37 class MEDIA_EXPORT AudioManagerBase : public AudioManager { |
33 public: | 38 public: |
34 ~AudioManagerBase() override; | 39 ~AudioManagerBase() override; |
35 | 40 |
36 // AudioManager: | 41 // AudioManager: |
(...skipping 23 matching lines...) Expand all Loading... | |
60 | 65 |
61 AudioParameters GetDefaultOutputStreamParameters() override; | 66 AudioParameters GetDefaultOutputStreamParameters() override; |
62 AudioParameters GetOutputStreamParameters( | 67 AudioParameters GetOutputStreamParameters( |
63 const std::string& device_id) override; | 68 const std::string& device_id) override; |
64 AudioParameters GetInputStreamParameters( | 69 AudioParameters GetInputStreamParameters( |
65 const std::string& device_id) override; | 70 const std::string& device_id) override; |
66 std::string GetAssociatedOutputDeviceID( | 71 std::string GetAssociatedOutputDeviceID( |
67 const std::string& input_device_id) override; | 72 const std::string& input_device_id) override; |
68 std::unique_ptr<AudioLog> CreateAudioLog( | 73 std::unique_ptr<AudioLog> CreateAudioLog( |
69 AudioLogFactory::AudioComponent component) override; | 74 AudioLogFactory::AudioComponent component) override; |
75 void InitializeOutputDebugRecording( | |
76 CreateAudioFileWriterCallback create_audio_file_writer_callback) override; | |
77 void EnableOutputDebugRecording( | |
78 const base::FilePath& base_file_name) override; | |
79 void DisableOutputDebugRecording() override; | |
70 | 80 |
71 void SetMaxStreamCountForTesting(int max_input, int max_output) final; | 81 void SetMaxStreamCountForTesting(int max_input, int max_output) final; |
72 | 82 |
73 // AudioManagerBase: | 83 // AudioManagerBase: |
74 | 84 |
75 // Called internally by the audio stream when it has been closed. | 85 // Called internally by the audio stream when it has been closed. |
76 virtual void ReleaseOutputStream(AudioOutputStream* stream); | 86 virtual void ReleaseOutputStream(AudioOutputStream* stream); |
77 virtual void ReleaseInputStream(AudioInputStream* stream); | 87 virtual void ReleaseInputStream(AudioInputStream* stream); |
78 | 88 |
79 // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy | 89 // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 // Contains currently open input streams. | 192 // Contains currently open input streams. |
183 std::unordered_set<AudioInputStream*> input_streams_; | 193 std::unordered_set<AudioInputStream*> input_streams_; |
184 | 194 |
185 // Map of cached AudioOutputDispatcher instances. Must only be touched | 195 // Map of cached AudioOutputDispatcher instances. Must only be touched |
186 // from the audio thread (no locking). | 196 // from the audio thread (no locking). |
187 AudioOutputDispatchers output_dispatchers_; | 197 AudioOutputDispatchers output_dispatchers_; |
188 | 198 |
189 // Proxy for creating AudioLog objects. | 199 // Proxy for creating AudioLog objects. |
190 AudioLogFactory* const audio_log_factory_; | 200 AudioLogFactory* const audio_log_factory_; |
191 | 201 |
202 // Debug recording manager. | |
203 std::unique_ptr<AudioDebugRecordingManager> output_debug_recording_manager_; | |
o1ka
2017/01/31 11:00:11
Why calling it "output"? Won't it work for inputs
Henrik Grunell
2017/02/08 11:29:38
Good point. The "output" filename extension is giv
| |
204 | |
192 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 205 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
193 }; | 206 }; |
194 | 207 |
195 } // namespace media | 208 } // namespace media |
196 | 209 |
197 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 210 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
OLD | NEW |