Chromium Code Reviews| Index: media/capture/video/video_capture_device_descriptor.cc |
| diff --git a/media/capture/video/video_capture_device_descriptor.cc b/media/capture/video/video_capture_device_descriptor.cc |
| index f1e288cbe32954ee07a9a6de78c723e2a37b3bb2..006a27f27c9a584848b9b7ac855af916d79cc0a6 100644 |
| --- a/media/capture/video/video_capture_device_descriptor.cc |
| +++ b/media/capture/video/video_capture_device_descriptor.cc |
| @@ -43,6 +43,19 @@ VideoCaptureDeviceDescriptor::~VideoCaptureDeviceDescriptor() {} |
| VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor( |
| const VideoCaptureDeviceDescriptor& other) = default; |
| +bool VideoCaptureDeviceDescriptor::operator<( |
| + const VideoCaptureDeviceDescriptor& other) const { |
| + int facing_mapping[NUM_MEDIA_VIDEO_FACING_MODE] = {0}; |
|
Guido Urdaneta
2017/01/25 10:27:23
nit: I don't think you need the {0} initialization
|
| + facing_mapping[MEDIA_VIDEO_FACING_USER] = 2; |
| + facing_mapping[MEDIA_VIDEO_FACING_ENVIRONMENT] = 1; |
| + facing_mapping[MEDIA_VIDEO_FACING_NONE] = 0; |
|
mcasas
2017/01/25 17:35:15
I'd do:
static const int kFacingMapping[] = {0, 1
henryhsu
2017/01/26 02:22:54
Done.
|
| + if (facing_mapping[facing] > facing_mapping[other.facing]) |
| + return true; |
| + if (device_id < other.device_id) |
| + return true; |
| + return capture_api < other.capture_api; |
| +} |
| + |
| const char* VideoCaptureDeviceDescriptor::GetCaptureApiTypeString() const { |
| switch (capture_api) { |
| case VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE: |