OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ | 5 #ifndef CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ |
6 #define CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ | 6 #define CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "media/audio/audio_device_description.h" | |
Guido Urdaneta
2016/12/08 15:53:37
include not necessary. just declaring media::Audio
o1ka
2016/12/09 14:56:30
Done.
| |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
15 enum MediaDeviceType { | 16 enum MediaDeviceType { |
16 MEDIA_DEVICE_TYPE_AUDIO_INPUT, | 17 MEDIA_DEVICE_TYPE_AUDIO_INPUT, |
17 MEDIA_DEVICE_TYPE_VIDEO_INPUT, | 18 MEDIA_DEVICE_TYPE_VIDEO_INPUT, |
18 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, | 19 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, |
19 NUM_MEDIA_DEVICE_TYPES, | 20 NUM_MEDIA_DEVICE_TYPES, |
20 }; | 21 }; |
21 | 22 |
22 struct CONTENT_EXPORT MediaDeviceInfo { | 23 struct CONTENT_EXPORT MediaDeviceInfo { |
23 MediaDeviceInfo() = default; | 24 MediaDeviceInfo() = default; |
24 MediaDeviceInfo(const std::string& device_id, | 25 MediaDeviceInfo(const std::string& device_id, |
25 const std::string& label, | 26 const std::string& label, |
26 const std::string& group_id); | 27 const std::string& group_id); |
28 explicit MediaDeviceInfo( | |
29 const media::AudioDeviceDescription& device_description); | |
30 | |
27 std::string device_id; | 31 std::string device_id; |
28 std::string label; | 32 std::string label; |
29 std::string group_id; | 33 std::string group_id; |
30 }; | 34 }; |
31 | 35 |
32 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>; | 36 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>; |
33 | 37 |
34 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second); | 38 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second); |
35 | 39 |
36 inline bool IsValidMediaDeviceType(MediaDeviceType type) { | 40 inline bool IsValidMediaDeviceType(MediaDeviceType type) { |
37 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES; | 41 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES; |
38 } | 42 } |
39 | 43 |
40 } // namespace content | 44 } // namespace content |
41 | 45 |
42 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ | 46 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ |
OLD | NEW |