audio_device_name.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #ifndef MODULES_AUDIO_DEVICE_AUDIO_DEVICE_NAME_H_
  11. #define MODULES_AUDIO_DEVICE_AUDIO_DEVICE_NAME_H_
  12. #include <deque>
  13. #include <string>
  14. namespace webrtc {
  15. struct AudioDeviceName {
  16. // Represents a default device. Note that, on Windows there are two different
  17. // types of default devices (Default and Default Communication). They can
  18. // either be two different physical devices or be two different roles for one
  19. // single device. Hence, this id must be combined with a "role parameter" on
  20. // Windows to uniquely identify a default device.
  21. static const char kDefaultDeviceId[];
  22. AudioDeviceName() = default;
  23. AudioDeviceName(std::string device_name, std::string unique_id);
  24. ~AudioDeviceName() = default;
  25. // Support copy and move.
  26. AudioDeviceName(const AudioDeviceName& other) = default;
  27. AudioDeviceName(AudioDeviceName&&) = default;
  28. AudioDeviceName& operator=(const AudioDeviceName&) = default;
  29. AudioDeviceName& operator=(AudioDeviceName&&) = default;
  30. bool IsValid();
  31. std::string device_name; // Friendly name of the device.
  32. std::string unique_id; // Unique identifier for the device.
  33. };
  34. typedef std::deque<AudioDeviceName> AudioDeviceNames;
  35. } // namespace webrtc
  36. #endif // MODULES_AUDIO_DEVICE_AUDIO_DEVICE_NAME_H_