| 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. |
| 253 // TODO(grunell): Control input debug recording via these functions too. |
| 254 virtual void InitializeOutputDebugRecording( |
| 255 AudioFileWriter::CreateCallback create_audio_file_writer_callback) = 0; |
| 256 |
| 257 // Enable output debug recording. InitializeOutputDebugRecording() must be |
| 258 // before this function. |
| 259 virtual void EnableOutputDebugRecording( |
| 260 const base::FilePath& base_file_name) = 0; |
| 261 |
| 262 // Disable output debug recording. |
| 263 virtual void DisableOutputDebugRecording() = 0; |
| 264 |
| 251 // Gets the name of the audio manager (e.g., Windows, Mac, PulseAudio). | 265 // Gets the name of the audio manager (e.g., Windows, Mac, PulseAudio). |
| 252 virtual const char* GetName() = 0; | 266 virtual const char* GetName() = 0; |
| 253 | 267 |
| 254 // Limits the number of streams that can be created for testing purposes. | 268 // Limits the number of streams that can be created for testing purposes. |
| 255 virtual void SetMaxStreamCountForTesting(int max_input, int max_output); | 269 virtual void SetMaxStreamCountForTesting(int max_input, int max_output); |
| 256 | 270 |
| 257 protected: | 271 protected: |
| 258 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 272 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 259 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); | 273 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); |
| 260 virtual ~AudioManager(); | 274 virtual ~AudioManager(); |
| 261 | 275 |
| 262 private: | 276 private: |
| 263 friend class base::DeleteHelper<AudioManager>; | 277 friend class base::DeleteHelper<AudioManager>; |
| 264 | 278 |
| 265 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 279 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 266 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; | 280 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; |
| 267 DISALLOW_COPY_AND_ASSIGN(AudioManager); | 281 DISALLOW_COPY_AND_ASSIGN(AudioManager); |
| 268 }; | 282 }; |
| 269 | 283 |
| 270 } // namespace media | 284 } // namespace media |
| 271 | 285 |
| 272 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ | 286 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| OLD | NEW |