Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: media/audio/win/core_audio_util_win.h

Issue 23618015: Add GetMatchingOutputDeviceID to CoreAudioUtil. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/audio/win/core_audio_util_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // the same controller so it is useful for doing things like determining 73 // the same controller so it is useful for doing things like determining
74 // whether a set of output and input devices belong to the same controller. 74 // whether a set of output and input devices belong to the same controller.
75 // The device enumerator is required as well as the device itself since 75 // The device enumerator is required as well as the device itself since
76 // looking at the device topology is required and we need to open up 76 // looking at the device topology is required and we need to open up
77 // associated devices to determine the controller id. 77 // associated devices to determine the controller id.
78 // If the ID could not be determined for some reason, an empty string is 78 // If the ID could not be determined for some reason, an empty string is
79 // returned. 79 // returned.
80 static std::string GetAudioControllerID(IMMDevice* device, 80 static std::string GetAudioControllerID(IMMDevice* device,
81 IMMDeviceEnumerator* enumerator); 81 IMMDeviceEnumerator* enumerator);
82 82
83 // Accepts an id of an input device and finds a matching output device id.
84 // If the associated hardware does not have an audio output device (e.g.
85 // a webcam with a mic), an empty string is returned.
86 static std::string GetMatchingOutputDeviceID(
87 const std::string& input_device_id);
88
83 // Gets the user-friendly name of the endpoint device which is represented 89 // Gets the user-friendly name of the endpoint device which is represented
84 // by a unique id in |device_id|. 90 // by a unique id in |device_id|.
85 static std::string GetFriendlyName(const std::string& device_id); 91 static std::string GetFriendlyName(const std::string& device_id);
86 92
87 // Returns true if the provided unique |device_id| corresponds to the current 93 // Returns true if the provided unique |device_id| corresponds to the current
88 // default device for the specified by a data-flow direction and role. 94 // default device for the specified by a data-flow direction and role.
89 static bool DeviceIsDefault( 95 static bool DeviceIsDefault(
90 EDataFlow flow, ERole role, const std::string& device_id); 96 EDataFlow flow, ERole role, const std::string& device_id);
91 97
92 // Query if the audio device is a rendering device or a capture device. 98 // Query if the audio device is a rendering device or a capture device.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 200
195 private: 201 private:
196 CoreAudioUtil() {} 202 CoreAudioUtil() {}
197 ~CoreAudioUtil() {} 203 ~CoreAudioUtil() {}
198 DISALLOW_COPY_AND_ASSIGN(CoreAudioUtil); 204 DISALLOW_COPY_AND_ASSIGN(CoreAudioUtil);
199 }; 205 };
200 206
201 } // namespace media 207 } // namespace media
202 208
203 #endif // MEDIA_AUDIO_WIN_CORE_AUDIO_UTIL_WIN_H_ 209 #endif // MEDIA_AUDIO_WIN_CORE_AUDIO_UTIL_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/win/core_audio_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698