• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
14 #include <deque>
15 #include <string>
16 
17 namespace webrtc {
18 
19 struct AudioDeviceName {
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.
25   static const char kDefaultDeviceId[];
26 
27   AudioDeviceName() = default;
28   AudioDeviceName(std::string device_name, std::string unique_id);
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 
44 typedef std::deque<AudioDeviceName> AudioDeviceNames;
45 
46 }  // namespace webrtc
47 
48 #endif  // MODULES_AUDIO_DEVICE_AUDIO_DEVICE_NAME_H_
49