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 #include "media/capture/video/video_capture_device_descriptor.h" | 5 #include "media/capture/video/video_capture_device_descriptor.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace media { | 9 namespace media { |
10 | 10 |
11 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor() | 11 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor() |
12 : capture_api(VideoCaptureApi::UNKNOWN), | 12 : facing(VideoFacingMode::MEDIA_VIDEO_FACING_NONE), |
| 13 capture_api(VideoCaptureApi::UNKNOWN), |
13 transport_type(VideoCaptureTransportType::OTHER_TRANSPORT) {} | 14 transport_type(VideoCaptureTransportType::OTHER_TRANSPORT) {} |
14 | 15 |
15 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor( | 16 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor( |
16 const std::string& display_name, | 17 const std::string& display_name, |
17 const std::string& device_id, | 18 const std::string& device_id, |
18 VideoCaptureApi capture_api, | 19 VideoCaptureApi capture_api, |
19 VideoCaptureTransportType transport_type) | 20 VideoCaptureTransportType transport_type) |
20 : display_name(display_name), | 21 : display_name(display_name), |
21 device_id(device_id), | 22 device_id(device_id), |
| 23 facing(VideoFacingMode::MEDIA_VIDEO_FACING_NONE), |
22 capture_api(capture_api), | 24 capture_api(capture_api), |
23 transport_type(transport_type) {} | 25 transport_type(transport_type) {} |
24 | 26 |
25 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor( | 27 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor( |
26 const std::string& display_name, | 28 const std::string& display_name, |
27 const std::string& device_id, | 29 const std::string& device_id, |
28 const std::string& model_id, | 30 const std::string& model_id, |
29 VideoCaptureApi capture_api, | 31 VideoCaptureApi capture_api, |
30 VideoCaptureTransportType transport_type) | 32 VideoCaptureTransportType transport_type, |
| 33 VideoFacingMode facing) |
31 : display_name(display_name), | 34 : display_name(display_name), |
32 device_id(device_id), | 35 device_id(device_id), |
33 model_id(model_id), | 36 model_id(model_id), |
| 37 facing(facing), |
34 capture_api(capture_api), | 38 capture_api(capture_api), |
35 transport_type(transport_type) {} | 39 transport_type(transport_type) {} |
36 | 40 |
37 VideoCaptureDeviceDescriptor::~VideoCaptureDeviceDescriptor() {} | 41 VideoCaptureDeviceDescriptor::~VideoCaptureDeviceDescriptor() {} |
38 | 42 |
39 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor( | 43 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor( |
40 const VideoCaptureDeviceDescriptor& other) = default; | 44 const VideoCaptureDeviceDescriptor& other) = default; |
41 | 45 |
42 const char* VideoCaptureDeviceDescriptor::GetCaptureApiTypeString() const { | 46 const char* VideoCaptureDeviceDescriptor::GetCaptureApiTypeString() const { |
43 switch (capture_api) { | 47 switch (capture_api) { |
(...skipping 24 matching lines...) Expand all Loading... |
68 } | 72 } |
69 } | 73 } |
70 | 74 |
71 std::string VideoCaptureDeviceDescriptor::GetNameAndModel() const { | 75 std::string VideoCaptureDeviceDescriptor::GetNameAndModel() const { |
72 if (model_id.empty()) | 76 if (model_id.empty()) |
73 return display_name; | 77 return display_name; |
74 return display_name + " (" + model_id + ")"; | 78 return display_name + " (" + model_id + ")"; |
75 } | 79 } |
76 | 80 |
77 } // namespace media | 81 } // namespace media |
OLD | NEW |