Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Side by Side Diff: media/capture/video/video_capture_device_descriptor.cc

Issue 2169013002: Change class VideoCaptureDevice::Name to struct VideoCaptureDeviceDescriptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed emircan's comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698