Chromium Code Reviews| 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 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 // Returns the device id of an output device that belongs to the same hardware | 234 // Returns the device id of an output device that belongs to the same hardware |
| 235 // as the specified input device. | 235 // as the specified input device. |
| 236 // If the hardware has only an input device (e.g. a webcam), the return value | 236 // If the hardware has only an input device (e.g. a webcam), the return value |
| 237 // will be empty (which the caller can then interpret to be the default output | 237 // will be empty (which the caller can then interpret to be the default output |
| 238 // device). Implementations that don't yet support this feature, must return | 238 // device). Implementations that don't yet support this feature, must return |
| 239 // an empty string. Must be called on the audio worker thread (see | 239 // an empty string. Must be called on the audio worker thread (see |
| 240 // GetWorkerTaskRunner()). | 240 // GetWorkerTaskRunner()). |
| 241 virtual std::string GetAssociatedOutputDeviceID( | 241 virtual std::string GetAssociatedOutputDeviceID( |
| 242 const std::string& input_device_id) = 0; | 242 const std::string& input_device_id) = 0; |
| 243 | 243 |
| 244 // These functions assign group ids to devices based on their device ids. | |
| 245 // The default implementation is an attempt to do this based on | |
| 246 // GetAssociatedOutputDeviceID. | |
| 247 virtual std::string GetGroupIDOutput(std::string output_id) = 0; | |
|
Guido Urdaneta
2016/08/29 13:59:47
rename output_id to output_device_id
| |
| 248 virtual std::string GetGroupIDInput(std::string input_id) = 0; | |
|
Guido Urdaneta
2016/08/29 13:59:47
rename input_id to input_device_id
| |
| 249 | |
| 244 // Create a new AudioLog object for tracking the behavior for one or more | 250 // Create a new AudioLog object for tracking the behavior for one or more |
| 245 // instances of the given component. See AudioLogFactory for more details. | 251 // instances of the given component. See AudioLogFactory for more details. |
| 246 virtual std::unique_ptr<AudioLog> CreateAudioLog( | 252 virtual std::unique_ptr<AudioLog> CreateAudioLog( |
| 247 AudioLogFactory::AudioComponent component) = 0; | 253 AudioLogFactory::AudioComponent component) = 0; |
| 248 | 254 |
| 249 protected: | 255 protected: |
| 250 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 256 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 251 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); | 257 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); |
| 252 virtual ~AudioManager(); | 258 virtual ~AudioManager(); |
| 253 | 259 |
| 254 private: | 260 private: |
| 255 friend class base::DeleteHelper<AudioManager>; | 261 friend class base::DeleteHelper<AudioManager>; |
| 256 | 262 |
| 257 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 263 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 258 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; | 264 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; |
| 259 DISALLOW_COPY_AND_ASSIGN(AudioManager); | 265 DISALLOW_COPY_AND_ASSIGN(AudioManager); |
| 260 }; | 266 }; |
| 261 | 267 |
| 262 } // namespace media | 268 } // namespace media |
| 263 | 269 |
| 264 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ | 270 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| OLD | NEW |