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 #include "media/capture/video/video_capture_device_descriptor.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace media { |
| 10 |
| 11 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor() |
| 12 : capture_api(VideoCaptureApiType::API_TYPE_UNKNOWN), |
| 13 transport_type(VideoCaptureTransportType::OTHER_TRANSPORT) {} |
| 14 |
| 15 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor( |
| 16 const std::string friendly_name, |
| 17 const std::string device_id, |
| 18 VideoCaptureApiType capture_api) |
| 19 : friendly_name(friendly_name), |
| 20 device_id(device_id), |
| 21 capture_api(capture_api) {} |
| 22 |
| 23 VideoCaptureDeviceDescriptor::~VideoCaptureDeviceDescriptor() {} |
| 24 |
| 25 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor( |
| 26 const VideoCaptureDeviceDescriptor& other) = default; |
| 27 |
| 28 const char* VideoCaptureDeviceDescriptor::GetCaptureApiTypeString() const { |
| 29 switch (capture_api) { |
| 30 case VideoCaptureApiType::LINUX_V4L2_SINGLE_PLANE: |
| 31 return "V4L2 SPLANE"; |
| 32 case VideoCaptureApiType::WINDOWS_MEDIA_FOUNDATION: |
| 33 return "Media Foundation"; |
| 34 case VideoCaptureApiType::WINDOWS_DIRECT_SHOW: |
| 35 return "Direct Show"; |
| 36 case VideoCaptureApiType::MACOSX_AVFOUNDATION: |
| 37 return "AV Foundation"; |
| 38 case VideoCaptureApiType::MACOSX_DECKLINK: |
| 39 return "DeckLink"; |
| 40 case VideoCaptureApiType::ANDROID_API1: |
| 41 return "Camera API1"; |
| 42 case VideoCaptureApiType::ANDROID_API2_LEGACY: |
| 43 return "Camera API2 Legacy"; |
| 44 case VideoCaptureApiType::ANDROID_API2_FULL: |
| 45 return "Camera API2 Full"; |
| 46 case VideoCaptureApiType::ANDROID_API2_LIMITED: |
| 47 return "Camera API2 Limited"; |
| 48 case VideoCaptureApiType::ANDROID_TANGO: |
| 49 return "Tango API"; |
| 50 default: |
| 51 NOTREACHED() << "Unknown Video Capture API type: " |
| 52 << static_cast<int>(capture_api); |
| 53 return "Unknown API"; |
| 54 } |
| 55 } |
| 56 |
| 57 } // namespace media |
OLD | NEW |