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

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: Fix build errors 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(VideoCaptureApi::UNKNOWN),
13 transport_type(VideoCaptureTransportType::OTHER_TRANSPORT) {}
14
15 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor(
16 const std::string& display_name,
17 const std::string& device_id,
18 VideoCaptureApi capture_api,
19 VideoCaptureTransportType transport_type)
20 : display_name(display_name),
21 device_id(device_id),
22 capture_api(capture_api),
23 transport_type(transport_type) {}
24
25 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor(
26 const std::string& display_name,
27 const std::string& device_id,
28 const std::string& model_id,
29 VideoCaptureApi capture_api,
30 VideoCaptureTransportType transport_type)
31 : display_name(display_name),
32 device_id(device_id),
33 model_id(model_id),
34 capture_api(capture_api),
35 transport_type(transport_type) {}
36
37 VideoCaptureDeviceDescriptor::~VideoCaptureDeviceDescriptor() {}
38
39 VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor(
40 const VideoCaptureDeviceDescriptor& other) = default;
41
42 const char* VideoCaptureDeviceDescriptor::GetCaptureApiTypeString() const {
43 switch (capture_api) {
44 case VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE:
45 return "V4L2 SPLANE";
46 case VideoCaptureApi::WIN_MEDIA_FOUNDATION:
47 return "Media Foundation";
48 case VideoCaptureApi::WIN_DIRECT_SHOW:
49 return "Direct Show";
50 case VideoCaptureApi::MACOSX_AVFOUNDATION:
51 return "AV Foundation";
52 case VideoCaptureApi::MACOSX_DECKLINK:
53 return "DeckLink";
54 case VideoCaptureApi::ANDROID_API1:
55 return "Camera API1";
56 case VideoCaptureApi::ANDROID_API2_LEGACY:
57 return "Camera API2 Legacy";
58 case VideoCaptureApi::ANDROID_API2_FULL:
59 return "Camera API2 Full";
60 case VideoCaptureApi::ANDROID_API2_LIMITED:
61 return "Camera API2 Limited";
62 case VideoCaptureApi::ANDROID_TANGO:
63 return "Tango API";
64 default:
65 NOTREACHED() << "Unknown Video Capture API type: "
66 << static_cast<int>(capture_api);
67 return "Unknown API";
68 }
69 }
70
71 std::string VideoCaptureDeviceDescriptor::GetNameAndModel() const {
72 if (model_id.empty())
73 return display_name;
74 return display_name + " (" + model_id + ")";
75 }
76
77 } // namespace media
OLDNEW
« no previous file with comments | « media/capture/video/video_capture_device_descriptor.h ('k') | media/capture/video/video_capture_device_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698