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_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_ |
6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ | 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/sequenced_task_runner_helpers.h" | 14 #include "base/sequenced_task_runner_helpers.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "media/audio/audio_device_description.h" | 17 #include "media/audio/audio_device_description.h" |
| 18 #include "media/audio/audio_file_writer.h" |
18 #include "media/audio/audio_logging.h" | 19 #include "media/audio/audio_logging.h" |
19 #include "media/base/audio_parameters.h" | 20 #include "media/base/audio_parameters.h" |
20 | 21 |
21 namespace base { | 22 namespace base { |
22 class SingleThreadTaskRunner; | 23 class SingleThreadTaskRunner; |
23 } | 24 } |
24 | 25 |
25 namespace media { | 26 namespace media { |
26 | 27 |
27 class AudioInputStream; | 28 class AudioInputStream; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // an empty string. Must be called on the audio worker thread (see | 242 // an empty string. Must be called on the audio worker thread (see |
242 // GetTaskRunner()). | 243 // GetTaskRunner()). |
243 virtual std::string GetAssociatedOutputDeviceID( | 244 virtual std::string GetAssociatedOutputDeviceID( |
244 const std::string& input_device_id) = 0; | 245 const std::string& input_device_id) = 0; |
245 | 246 |
246 // Create a new AudioLog object for tracking the behavior for one or more | 247 // Create a new AudioLog object for tracking the behavior for one or more |
247 // instances of the given component. See AudioLogFactory for more details. | 248 // instances of the given component. See AudioLogFactory for more details. |
248 virtual std::unique_ptr<AudioLog> CreateAudioLog( | 249 virtual std::unique_ptr<AudioLog> CreateAudioLog( |
249 AudioLogFactory::AudioComponent component) = 0; | 250 AudioLogFactory::AudioComponent component) = 0; |
250 | 251 |
| 252 // Initializes output debug recording. Can be called on any thread; will post |
| 253 // to the audio thread if not called on it. |
| 254 // TODO(grunell): Control input debug recording via these functions too. |
| 255 virtual void InitializeOutputDebugRecording( |
| 256 AudioFileWriter::CreateCallback create_audio_file_writer_callback) = 0; |
| 257 |
| 258 // Enable output debug recording. InitializeOutputDebugRecording() must be |
| 259 // called before this function. |
| 260 virtual void EnableOutputDebugRecording( |
| 261 const base::FilePath& base_file_name) = 0; |
| 262 |
| 263 // Disable output debug recording. |
| 264 virtual void DisableOutputDebugRecording() = 0; |
| 265 |
251 // Gets the name of the audio manager (e.g., Windows, Mac, PulseAudio). | 266 // Gets the name of the audio manager (e.g., Windows, Mac, PulseAudio). |
252 virtual const char* GetName() = 0; | 267 virtual const char* GetName() = 0; |
253 | 268 |
254 // Limits the number of streams that can be created for testing purposes. | 269 // Limits the number of streams that can be created for testing purposes. |
255 virtual void SetMaxStreamCountForTesting(int max_input, int max_output); | 270 virtual void SetMaxStreamCountForTesting(int max_input, int max_output); |
256 | 271 |
257 protected: | 272 protected: |
258 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 273 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
259 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); | 274 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); |
260 virtual ~AudioManager(); | 275 virtual ~AudioManager(); |
261 | 276 |
262 private: | 277 private: |
263 friend class base::DeleteHelper<AudioManager>; | 278 friend class base::DeleteHelper<AudioManager>; |
264 | 279 |
265 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 280 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
266 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; | 281 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; |
267 DISALLOW_COPY_AND_ASSIGN(AudioManager); | 282 DISALLOW_COPY_AND_ASSIGN(AudioManager); |
268 }; | 283 }; |
269 | 284 |
270 } // namespace media | 285 } // namespace media |
271 | 286 |
272 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ | 287 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ |
OLD | NEW |