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 "content/public/common/media_stream_request.h" | |
12 | 13 |
13 namespace media { | 14 namespace media { |
14 struct AudioDeviceDescription; | 15 struct AudioDeviceDescription; |
16 struct VideoCaptureDeviceDescriptor; | |
15 } | 17 } |
16 | 18 |
17 namespace content { | 19 namespace content { |
18 | 20 |
19 enum MediaDeviceType { | 21 enum MediaDeviceType { |
20 MEDIA_DEVICE_TYPE_AUDIO_INPUT, | 22 MEDIA_DEVICE_TYPE_AUDIO_INPUT, |
21 MEDIA_DEVICE_TYPE_VIDEO_INPUT, | 23 MEDIA_DEVICE_TYPE_VIDEO_INPUT, |
22 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, | 24 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, |
23 NUM_MEDIA_DEVICE_TYPES, | 25 NUM_MEDIA_DEVICE_TYPES, |
24 }; | 26 }; |
25 | 27 |
26 struct CONTENT_EXPORT MediaDeviceInfo { | 28 struct CONTENT_EXPORT MediaDeviceInfo { |
27 MediaDeviceInfo() = default; | 29 MediaDeviceInfo(); |
30 MediaDeviceInfo(const MediaDeviceInfo& other); | |
31 ~MediaDeviceInfo(); | |
28 MediaDeviceInfo(const std::string& device_id, | 32 MediaDeviceInfo(const std::string& device_id, |
29 const std::string& label, | 33 const std::string& label, |
30 const std::string& group_id); | 34 const std::string& group_id); |
31 explicit MediaDeviceInfo( | 35 explicit MediaDeviceInfo( |
32 const media::AudioDeviceDescription& device_description); | 36 const media::AudioDeviceDescription& device_description); |
33 | 37 |
38 explicit MediaDeviceInfo( | |
39 const media::VideoCaptureDeviceDescriptor& descriptor); | |
34 std::string device_id; | 40 std::string device_id; |
35 std::string label; | 41 std::string label; |
36 std::string group_id; | 42 std::string group_id; |
43 media::VideoFacingMode facing; | |
Guido Urdaneta
2017/01/19 10:29:41
Don't add the facing field here.
To properly suppo
| |
37 }; | 44 }; |
38 | 45 |
39 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>; | 46 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>; |
40 | 47 |
41 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second); | 48 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second); |
42 | 49 |
43 inline bool IsValidMediaDeviceType(MediaDeviceType type) { | 50 inline bool IsValidMediaDeviceType(MediaDeviceType type) { |
44 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES; | 51 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES; |
45 } | 52 } |
46 | 53 |
47 } // namespace content | 54 } // namespace content |
48 | 55 |
49 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ | 56 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ |
OLD | NEW |