| 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 MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_H_ |
| 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_H_ | 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 VideoFacingMode facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE); | 59 VideoFacingMode facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE); |
| 60 VideoCaptureDeviceDescriptor(const VideoCaptureDeviceDescriptor& other); | 60 VideoCaptureDeviceDescriptor(const VideoCaptureDeviceDescriptor& other); |
| 61 ~VideoCaptureDeviceDescriptor(); | 61 ~VideoCaptureDeviceDescriptor(); |
| 62 | 62 |
| 63 // These operators are needed due to storing the name in an STL container. | 63 // These operators are needed due to storing the name in an STL container. |
| 64 // In the shared build, all methods from the STL container will be exported | 64 // In the shared build, all methods from the STL container will be exported |
| 65 // so even though they're not used, they're still depended upon. | 65 // so even though they're not used, they're still depended upon. |
| 66 bool operator==(const VideoCaptureDeviceDescriptor& other) const { | 66 bool operator==(const VideoCaptureDeviceDescriptor& other) const { |
| 67 return (other.device_id == device_id) && (other.capture_api == capture_api); | 67 return (other.device_id == device_id) && (other.capture_api == capture_api); |
| 68 } | 68 } |
| 69 bool operator<(const VideoCaptureDeviceDescriptor& other) const { | 69 bool operator<(const VideoCaptureDeviceDescriptor& other) const; |
| 70 if (device_id < other.device_id) | |
| 71 return true; | |
| 72 return capture_api < other.capture_api; | |
| 73 } | |
| 74 | 70 |
| 75 const char* GetCaptureApiTypeString() const; | 71 const char* GetCaptureApiTypeString() const; |
| 76 // Friendly name of a device, plus the model identifier in parentheses. | 72 // Friendly name of a device, plus the model identifier in parentheses. |
| 77 std::string GetNameAndModel() const; | 73 std::string GetNameAndModel() const; |
| 78 | 74 |
| 79 std::string display_name; // Name that is intended for display in the UI | 75 std::string display_name; // Name that is intended for display in the UI |
| 80 std::string device_id; | 76 std::string device_id; |
| 81 // A unique hardware identifier of the capture device. | 77 // A unique hardware identifier of the capture device. |
| 82 // It is of the form "[vid]:[pid]" when a USB device is detected, and empty | 78 // It is of the form "[vid]:[pid]" when a USB device is detected, and empty |
| 83 // otherwise. | 79 // otherwise. |
| 84 std::string model_id; | 80 std::string model_id; |
| 85 | 81 |
| 86 VideoFacingMode facing; | 82 VideoFacingMode facing; |
| 87 | 83 |
| 88 VideoCaptureApi capture_api; | 84 VideoCaptureApi capture_api; |
| 89 VideoCaptureTransportType transport_type; | 85 VideoCaptureTransportType transport_type; |
| 90 }; | 86 }; |
| 91 | 87 |
| 92 using VideoCaptureDeviceDescriptors = std::vector<VideoCaptureDeviceDescriptor>; | 88 using VideoCaptureDeviceDescriptors = std::vector<VideoCaptureDeviceDescriptor>; |
| 93 | 89 |
| 94 } // namespace media | 90 } // namespace media |
| 95 | 91 |
| 96 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_H_ | 92 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_H_ |
| OLD | NEW |