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 // Utility methods for the Core Audio API on Windows. | 5 // Utility methods for the Core Audio API on Windows. |
6 // Always ensure that Core Audio is supported before using these methods. | 6 // Always ensure that Core Audio is supported before using these methods. |
7 // Use media::CoreAudioIsSupported() for this purpose. | 7 // Use media::CoreAudioIsSupported() for this purpose. |
8 // Also, all methods must be called on a valid COM thread. This can be done | 8 // Also, all methods must be called on a valid COM thread. This can be done |
9 // by using the base::win::ScopedCOMInitializer helper class. | 9 // by using the base::win::ScopedCOMInitializer helper class. |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 | 52 |
53 // Creates an IMMDeviceEnumerator interface which provides methods for | 53 // Creates an IMMDeviceEnumerator interface which provides methods for |
54 // enumerating audio endpoint devices. | 54 // enumerating audio endpoint devices. |
55 static ScopedComPtr<IMMDeviceEnumerator> CreateDeviceEnumerator(); | 55 static ScopedComPtr<IMMDeviceEnumerator> CreateDeviceEnumerator(); |
56 | 56 |
57 // Creates a default endpoint device that is specified by a data-flow | 57 // Creates a default endpoint device that is specified by a data-flow |
58 // direction and role, e.g. default render device. | 58 // direction and role, e.g. default render device. |
59 static ScopedComPtr<IMMDevice> CreateDefaultDevice( | 59 static ScopedComPtr<IMMDevice> CreateDefaultDevice( |
60 EDataFlow data_flow, ERole role); | 60 EDataFlow data_flow, ERole role); |
61 | 61 |
62 // Returns the device id of the default output device or an empty string | |
63 // if no such device exists or if the default device has been disabled. | |
henrika (OOO until Aug 14)
2013/09/04 11:11:40
Nit, ...or no output devices exists.
tommi (sloooow) - chröme
2013/09/04 13:06:55
The comment already says "or an empty string if no
| |
64 static std::string GetDefaultOutputDeviceID(); | |
65 | |
62 // Creates an endpoint device that is specified by a unique endpoint device- | 66 // Creates an endpoint device that is specified by a unique endpoint device- |
63 // identification string. | 67 // identification string. |
64 static ScopedComPtr<IMMDevice> CreateDevice(const std::string& device_id); | 68 static ScopedComPtr<IMMDevice> CreateDevice(const std::string& device_id); |
65 | 69 |
66 // Returns the unique ID and user-friendly name of a given endpoint device. | 70 // Returns the unique ID and user-friendly name of a given endpoint device. |
67 // Example: "{0.0.1.00000000}.{8db6020f-18e3-4f25-b6f5-7726c9122574}", and | 71 // Example: "{0.0.1.00000000}.{8db6020f-18e3-4f25-b6f5-7726c9122574}", and |
68 // "Microphone (Realtek High Definition Audio)". | 72 // "Microphone (Realtek High Definition Audio)". |
69 static HRESULT GetDeviceName(IMMDevice* device, AudioDeviceName* name); | 73 static HRESULT GetDeviceName(IMMDevice* device, AudioDeviceName* name); |
70 | 74 |
71 // Returns the device ID/path of the controller (a.k.a. physical device that | 75 // Returns the device ID/path of the controller (a.k.a. physical device that |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 | 204 |
201 private: | 205 private: |
202 CoreAudioUtil() {} | 206 CoreAudioUtil() {} |
203 ~CoreAudioUtil() {} | 207 ~CoreAudioUtil() {} |
204 DISALLOW_COPY_AND_ASSIGN(CoreAudioUtil); | 208 DISALLOW_COPY_AND_ASSIGN(CoreAudioUtil); |
205 }; | 209 }; |
206 | 210 |
207 } // namespace media | 211 } // namespace media |
208 | 212 |
209 #endif // MEDIA_AUDIO_WIN_CORE_AUDIO_UTIL_WIN_H_ | 213 #endif // MEDIA_AUDIO_WIN_CORE_AUDIO_UTIL_WIN_H_ |
OLD | NEW |