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

Side by Side Diff: content/common/media/media_devices.h

Issue 2609863004: Pass camera facing to WebKit (Closed)
Patch Set: modify settings names Created 3 years, 11 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
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 #ifndef CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ 5 #ifndef CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_
6 #define CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ 6 #define CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 12
13 namespace media { 13 namespace media {
14 struct AudioDeviceDescription; 14 struct AudioDeviceDescription;
15 struct VideoCaptureDeviceDescriptor;
15 } 16 }
16 17
17 namespace content { 18 namespace content {
18 19
19 enum MediaDeviceType { 20 enum MediaDeviceType {
20 MEDIA_DEVICE_TYPE_AUDIO_INPUT, 21 MEDIA_DEVICE_TYPE_AUDIO_INPUT,
21 MEDIA_DEVICE_TYPE_VIDEO_INPUT, 22 MEDIA_DEVICE_TYPE_VIDEO_INPUT,
22 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, 23 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT,
23 NUM_MEDIA_DEVICE_TYPES, 24 NUM_MEDIA_DEVICE_TYPES,
24 }; 25 };
25 26
26 struct CONTENT_EXPORT MediaDeviceInfo { 27 struct CONTENT_EXPORT MediaDeviceInfo {
27 MediaDeviceInfo() = default; 28 MediaDeviceInfo() = default;
28 MediaDeviceInfo(const std::string& device_id, 29 MediaDeviceInfo(const std::string& device_id,
29 const std::string& label, 30 const std::string& label,
30 const std::string& group_id); 31 const std::string& group_id);
31 explicit MediaDeviceInfo( 32 explicit MediaDeviceInfo(
32 const media::AudioDeviceDescription& device_description); 33 const media::AudioDeviceDescription& device_description);
33 34
35 explicit MediaDeviceInfo(
36 const media::VideoCaptureDeviceDescriptor& descriptor);
34 std::string device_id; 37 std::string device_id;
35 std::string label; 38 std::string label;
36 std::string group_id; 39 std::string group_id;
40 // Format is "vid:pid". Ex. "E2A1:34D0".
41 std::string model_id;
jochen (gone - plz use gerrit) 2017/01/05 12:17:59 why not a pair of ints then?
shenghao 2017/01/06 09:43:01 We use the formatted "vid:pid" string as identifie
wuchengli 2017/01/09 08:28:00 Another reason is we'll have non-USB cameras soon.
37 }; 42 };
38 43
39 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>; 44 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>;
40 45
41 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second); 46 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second);
42 47
43 inline bool IsValidMediaDeviceType(MediaDeviceType type) { 48 inline bool IsValidMediaDeviceType(MediaDeviceType type) {
44 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES; 49 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES;
45 } 50 }
46 51
47 } // namespace content 52 } // namespace content
48 53
49 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ 54 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698