blob: baabd781a70b0a188fc6f922308a76fa11c02dfb [file] [log] [blame]
henrika7e6fcea2018-05-18 10:20:58 +02001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef MODULES_AUDIO_DEVICE_AUDIO_DEVICE_NAME_H_
12#define MODULES_AUDIO_DEVICE_AUDIO_DEVICE_NAME_H_
13
henrikaaf070d02019-11-22 14:47:31 +010014#include <deque>
henrika7e6fcea2018-05-18 10:20:58 +020015#include <string>
henrika7e6fcea2018-05-18 10:20:58 +020016
17namespace webrtc {
18
19struct AudioDeviceName {
henrikabb55e0b2019-11-20 14:40:33 +010020 // Represents a default device. Note that, on Windows there are two different
21 // types of default devices (Default and Default Communication). They can
22 // either be two different physical devices or be two different roles for one
23 // single device. Hence, this id must be combined with a "role parameter" on
24 // Windows to uniquely identify a default device.
henrika7e6fcea2018-05-18 10:20:58 +020025 static const char kDefaultDeviceId[];
26
henrika7e6fcea2018-05-18 10:20:58 +020027 AudioDeviceName() = default;
Mirko Bonadei1c546052019-02-04 14:50:38 +010028 AudioDeviceName(std::string device_name, std::string unique_id);
henrika7e6fcea2018-05-18 10:20:58 +020029
30 ~AudioDeviceName() = default;
31
32 // Support copy and move.
33 AudioDeviceName(const AudioDeviceName& other) = default;
34 AudioDeviceName(AudioDeviceName&&) = default;
35 AudioDeviceName& operator=(const AudioDeviceName&) = default;
36 AudioDeviceName& operator=(AudioDeviceName&&) = default;
37
38 bool IsValid();
39
40 std::string device_name; // Friendly name of the device.
41 std::string unique_id; // Unique identifier for the device.
42};
43
henrikaaf070d02019-11-22 14:47:31 +010044typedef std::deque<AudioDeviceName> AudioDeviceNames;
henrika7e6fcea2018-05-18 10:20:58 +020045
46} // namespace webrtc
47
48#endif // MODULES_AUDIO_DEVICE_AUDIO_DEVICE_NAME_H_