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

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

Issue 2563653002: Replace AudioManager::GetAudio*DeviceNames with AudioManager::GetAudio*DeviceDescriptions (Closed)
Patch Set: nit fixes Created 4 years 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 {
14 struct AudioDeviceDescription;
15 }
16
13 namespace content { 17 namespace content {
14 18
15 enum MediaDeviceType { 19 enum MediaDeviceType {
16 MEDIA_DEVICE_TYPE_AUDIO_INPUT, 20 MEDIA_DEVICE_TYPE_AUDIO_INPUT,
17 MEDIA_DEVICE_TYPE_VIDEO_INPUT, 21 MEDIA_DEVICE_TYPE_VIDEO_INPUT,
18 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, 22 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT,
19 NUM_MEDIA_DEVICE_TYPES, 23 NUM_MEDIA_DEVICE_TYPES,
20 }; 24 };
21 25
22 struct CONTENT_EXPORT MediaDeviceInfo { 26 struct CONTENT_EXPORT MediaDeviceInfo {
23 MediaDeviceInfo() = default; 27 MediaDeviceInfo() = default;
24 MediaDeviceInfo(const std::string& device_id, 28 MediaDeviceInfo(const std::string& device_id,
25 const std::string& label, 29 const std::string& label,
26 const std::string& group_id); 30 const std::string& group_id);
31 explicit MediaDeviceInfo(
32 const media::AudioDeviceDescription& device_description);
33
27 std::string device_id; 34 std::string device_id;
28 std::string label; 35 std::string label;
29 std::string group_id; 36 std::string group_id;
30 }; 37 };
31 38
32 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>; 39 using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>;
33 40
34 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second); 41 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second);
35 42
36 inline bool IsValidMediaDeviceType(MediaDeviceType type) { 43 inline bool IsValidMediaDeviceType(MediaDeviceType type) {
37 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES; 44 return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES;
38 } 45 }
39 46
40 } // namespace content 47 } // namespace content
41 48
42 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_ 49 #endif // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc ('k') | content/common/media/media_devices.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698