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(const std::string& output_device_id) = 0; | |
248 virtual std::string GetGroupIDInput(const std::string& input_device_id) = 0; | |
249 | |
250 // Create a new AudioLog object for tracking the behavior for one or more | 244 // Create a new AudioLog object for tracking the behavior for one or more |
251 // instances of the given component. See AudioLogFactory for more details. | 245 // instances of the given component. See AudioLogFactory for more details. |
252 virtual std::unique_ptr<AudioLog> CreateAudioLog( | 246 virtual std::unique_ptr<AudioLog> CreateAudioLog( |
253 AudioLogFactory::AudioComponent component) = 0; | 247 AudioLogFactory::AudioComponent component) = 0; |
254 | 248 |
255 protected: | 249 protected: |
256 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 250 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
257 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); | 251 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); |
258 virtual ~AudioManager(); | 252 virtual ~AudioManager(); |
259 | 253 |
260 private: | 254 private: |
261 friend class base::DeleteHelper<AudioManager>; | 255 friend class base::DeleteHelper<AudioManager>; |
262 | 256 |
263 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 257 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
264 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; | 258 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; |
265 DISALLOW_COPY_AND_ASSIGN(AudioManager); | 259 DISALLOW_COPY_AND_ASSIGN(AudioManager); |
266 }; | 260 }; |
267 | 261 |
268 } // namespace media | 262 } // namespace media |
269 | 263 |
270 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ | 264 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ |
OLD | NEW |