OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_H_ | |
6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_H_ | |
7 | |
8 #include <list> | |
9 #include <string> | |
10 | |
11 #include "media/capture/capture_export.h" | |
12 | |
13 namespace media { | |
14 | |
15 // A Java counterpart will be generated for this enum. | |
16 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.media | |
17 enum class VideoCaptureApiType { | |
18 LINUX_V4L2_SINGLE_PLANE, | |
19 WINDOWS_MEDIA_FOUNDATION, | |
20 WINDOWS_DIRECT_SHOW, | |
21 MACOSX_AVFOUNDATION, | |
22 MACOSX_DECKLINK, | |
23 ANDROID_API1, | |
24 ANDROID_API2_LEGACY, | |
25 ANDROID_API2_FULL, | |
26 ANDROID_API2_LIMITED, | |
27 ANDROID_TANGO, | |
28 API_TYPE_UNKNOWN | |
29 }; | |
30 | |
31 enum class VideoCaptureTransportType { | |
32 // For AVFoundation Api, identify devices that are built-in or USB. | |
33 MACOSX_USB_OR_BUILT_IN, | |
34 OTHER_TRANSPORT | |
emircan
2016/07/25 22:56:40
Can we split OTHER_TRANSPORT into two: MACOSX_OTHE
chfremer
2016/07/26 16:56:35
I initially had the same thought, but then I could
| |
35 }; | |
36 | |
37 // Represents information about a capture device as returned by a | |
38 // VideoCaptureDeviceFactory. | |
39 // |device_id| represents a unique id of a physical device. Since the same | |
40 // physical device may be accessible through different APIs |capture_api| | |
41 // disambiguates the API. | |
emircan
2016/07/25 22:56:40
Earlier there was a comment about using VideoCaptu
chfremer
2016/07/26 16:56:35
I believe you are referring to this:
// You shou
| |
42 struct CAPTURE_EXPORT VideoCaptureDeviceDescriptor { | |
43 public: | |
44 VideoCaptureDeviceDescriptor(); | |
45 VideoCaptureDeviceDescriptor(const VideoCaptureDeviceDescriptor& other); | |
46 ~VideoCaptureDeviceDescriptor(); | |
47 | |
48 // These operators are needed due to storing the name in an STL container. | |
49 // In the shared build, all methods from the STL container will be exported | |
50 // so even though they're not used, they're still depended upon. | |
51 bool operator==(const VideoCaptureDeviceDescriptor& other) const { | |
52 return (other.device_id == device_id) && (other.capture_api == capture_api); | |
53 } | |
54 bool operator<(const VideoCaptureDeviceDescriptor& other) const { | |
55 if (device_id < other.device_id) | |
56 return true; | |
57 return capture_api < other.capture_api; | |
58 } | |
59 | |
60 const char* GetCaptureApiTypeString() const; | |
61 | |
62 std::string friendly_name; | |
emircan
2016/07/25 22:56:40
s/friendly_name/name/? Or drop a comment about why
chfremer
2016/07/26 16:56:35
I chose this, because in the original code in Vide
emircan
2016/07/28 21:23:01
|display_name| sgtm
chfremer
2016/07/29 18:09:50
Done.
| |
63 std::string device_id; | |
64 VideoCaptureApiType capture_api; | |
65 VideoCaptureTransportType transport_type; | |
66 | |
67 // Allow generated copy constructor and assignment. | |
emircan
2016/07/25 22:56:40
This comment is unnecessary.
chfremer
2016/07/26 16:56:35
removed
| |
68 }; | |
69 | |
70 typedef std::list<VideoCaptureDeviceDescriptor> VideoCaptureDeviceDescriptors; | |
71 | |
72 } // namespace media | |
73 | |
74 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_H_ | |
OLD | NEW |