henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
henrika | af070d0 | 2019-11-22 14:47:31 +0100 | [diff] [blame] | 14 | #include <deque> |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 15 | #include <string> |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | struct AudioDeviceName { |
henrika | bb55e0b | 2019-11-20 14:40:33 +0100 | [diff] [blame] | 20 | // 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. |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 25 | static const char kDefaultDeviceId[]; |
| 26 | |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 27 | AudioDeviceName() = default; |
Mirko Bonadei | 1c54605 | 2019-02-04 14:50:38 +0100 | [diff] [blame] | 28 | AudioDeviceName(std::string device_name, std::string unique_id); |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 29 | |
| 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 | |
henrika | af070d0 | 2019-11-22 14:47:31 +0100 | [diff] [blame] | 44 | typedef std::deque<AudioDeviceName> AudioDeviceNames; |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 45 | |
| 46 | } // namespace webrtc |
| 47 | |
| 48 | #endif // MODULES_AUDIO_DEVICE_AUDIO_DEVICE_NAME_H_ |