device_enumeration_win.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
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
3// found in the LICENSE file.
4
5#ifndef MEDIA_AUDIO_WIN_DEVICE_ENUMERATION_WIN_H_
6#define MEDIA_AUDIO_WIN_DEVICE_ENUMERATION_WIN_H_
7
8#include <string>
9
10#include "media/audio/audio_device_name.h"
11
12namespace media {
13
14// Returns a list of audio input device structures (name and unique device ID)
15// using the MMDevice API which is supported on Windows Vista and higher.
16// Example record in the output list:
17// - device_name: "Microphone (Realtek High Definition Audio)".
18// - unique_id: "{0.0.1.00000000}.{8db6020f-18e3-4f25-b6f5-7726c9122574}"
19// This method must be called from a COM thread using MTA.
20bool GetInputDeviceNamesWin(media::AudioDeviceNames* device_names);
21
22// Returns a list of audio input device structures (name and unique device ID)
23// using the WaveIn API which is supported on Windows XP and higher.
24// Example record in the output list:
25// - device_name: "Microphone (Realtek High Defini".
26// - unique_id: "Microphone (Realtek High Defini" (same as friendly name).
27bool GetInputDeviceNamesWinXP(media::AudioDeviceNames* device_names);
28
29// Converts a device ID generated by |GetInputDeviceNamesWin()| to the
30// corresponding ID by |GetInputDeviceNamesWinXP()|. Returns an empty string on
31// failure.
32// Example input and output:
33// - input ID: "{0.0.1.00000000}.{8db6020f-18e3-4f25-b6f5-7726c9122574}"
34// - output ID: "Microphone (Realtek High Defini"
35std::string ConvertToWinXPDeviceId(const std::string& device_id);
36
37}  // namespace media
38
39#endif  // MEDIA_AUDIO_WIN_DEVICE_ENUMERATION_WIN_H_
40
41