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

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

Issue 2609863004: Pass camera facing to WebKit (Closed)
Patch Set: fix trybot errors 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();
29 MediaDeviceInfo(const MediaDeviceInfo& other);
jochen (gone - plz use gerrit) 2017/01/12 11:54:42 why do you need the copy ctor here?
shenghao 2017/01/13 11:09:34 Required by chromium trybot checks. A complex clas
30 ~MediaDeviceInfo();
28 MediaDeviceInfo(const std::string& device_id, 31 MediaDeviceInfo(const std::string& device_id,
29 const std::string& label, 32 const std::string& label,
30 const std::string& group_id); 33 const std::string& group_id);
jochen (gone - plz use gerrit) 2017/01/12 11:54:42 this should also take the model_id
shenghao 2017/01/13 11:09:34 Not every media device has model_id. Ex. Audio dev
31 explicit MediaDeviceInfo( 34 explicit MediaDeviceInfo(
32 const media::AudioDeviceDescription& device_description); 35 const media::AudioDeviceDescription& device_description);
33 36
37 explicit MediaDeviceInfo(
38 const media::VideoCaptureDeviceDescriptor& descriptor);
34 std::string device_id; 39 std::string device_id;
35 std::string label; 40 std::string label;
36 std::string group_id; 41 std::string group_id;
42 // Format is "vid:pid". Ex. "E2A1:34D0".
43 std::string model_id;
37 }; 44 };
38 45
39 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>; 46 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>;
40 47
41 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second); 48 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second);
42 49
43 inline bool IsValidMediaDeviceType(MediaDeviceType type) { 50 inline bool IsValidMediaDeviceType(MediaDeviceType type) {
44 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES; 51 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES;
45 } 52 }
46 53
47 } // namespace content 54 } // namespace content
48 55
49 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ 56 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698