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 | 12 |
13 namespace media { | 13 namespace media { |
14 struct AudioDeviceDescription; | 14 struct AudioDeviceDescription; |
| 15 struct VideoCaptureDeviceDescriptor; |
15 } | 16 } |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 enum MediaDeviceType { | 20 enum MediaDeviceType { |
20 MEDIA_DEVICE_TYPE_AUDIO_INPUT, | 21 MEDIA_DEVICE_TYPE_AUDIO_INPUT, |
21 MEDIA_DEVICE_TYPE_VIDEO_INPUT, | 22 MEDIA_DEVICE_TYPE_VIDEO_INPUT, |
22 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, | 23 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, |
23 NUM_MEDIA_DEVICE_TYPES, | 24 NUM_MEDIA_DEVICE_TYPES, |
24 }; | 25 }; |
25 | 26 |
26 struct CONTENT_EXPORT MediaDeviceInfo { | 27 struct CONTENT_EXPORT MediaDeviceInfo { |
27 MediaDeviceInfo() = default; | 28 MediaDeviceInfo(); |
| 29 ~MediaDeviceInfo(); |
28 MediaDeviceInfo(const std::string& device_id, | 30 MediaDeviceInfo(const std::string& device_id, |
29 const std::string& label, | 31 const std::string& label, |
30 const std::string& group_id); | 32 const std::string& group_id); |
31 explicit MediaDeviceInfo( | 33 explicit MediaDeviceInfo( |
32 const media::AudioDeviceDescription& device_description); | 34 const media::AudioDeviceDescription& device_description); |
33 | 35 |
| 36 explicit MediaDeviceInfo( |
| 37 const media::VideoCaptureDeviceDescriptor& descriptor); |
34 std::string device_id; | 38 std::string device_id; |
35 std::string label; | 39 std::string label; |
36 std::string group_id; | 40 std::string group_id; |
| 41 // Format is "vid:pid". Ex. "E2A1:34D0". |
| 42 std::string model_id; |
37 }; | 43 }; |
38 | 44 |
39 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>; | 45 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>; |
40 | 46 |
41 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second); | 47 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second); |
42 | 48 |
43 inline bool IsValidMediaDeviceType(MediaDeviceType type) { | 49 inline bool IsValidMediaDeviceType(MediaDeviceType type) { |
44 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES; | 50 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES; |
45 } | 51 } |
46 | 52 |
47 } // namespace content | 53 } // namespace content |
48 | 54 |
49 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ | 55 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ |
OLD | NEW |