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

Side by Side Diff: media/audio/audio_device_description.h

Issue 2563653002: Replace AudioManager::GetAudio*DeviceNames with AudioManager::GetAudio*DeviceDescriptions (Closed)
Patch Set: fix for windows 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MEDIA_AUDIO_AUDIO_DEVICE_DESCRIPTION_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_DEVICE_DESCRIPTION_H_
6 #define MEDIA_AUDIO_AUDIO_DEVICE_DESCRIPTION_H_ 6 #define MEDIA_AUDIO_AUDIO_DEVICE_DESCRIPTION_H_
7 7
8 #include <list>
8 #include <string> 9 #include <string>
9 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
10 11
11 namespace media { 12 namespace media {
12 13
13 // Provides common information on audio device names and ids. 14 // Provides common information on audio device names and ids.
14 class MEDIA_EXPORT AudioDeviceDescription { 15 struct MEDIA_EXPORT AudioDeviceDescription {
15 public:
16 // Unique Id of the generic "default" device. Associated with the localized 16 // Unique Id of the generic "default" device. Associated with the localized
17 // name returned from GetDefaultDeviceName(). 17 // name returned from GetDefaultDeviceName().
18 static const char kDefaultDeviceId[]; 18 static const char kDefaultDeviceId[];
19 19
20 // Unique Id of the generic default communications device. Associated with 20 // Unique Id of the generic default communications device. Associated with
21 // the localized name returned from GetCommunicationsDeviceName(). 21 // the localized name returned from GetCommunicationsDeviceName().
22 static const char kCommunicationsDeviceId[]; 22 static const char kCommunicationsDeviceId[];
23 23
24 // Input device ID used to capture the default system playback stream. When 24 // Input device ID used to capture the default system playback stream. When
25 // this device ID is passed to MakeAudioInputStream() the returned 25 // this device ID is passed to MakeAudioInputStream() the returned
(...skipping 20 matching lines...) Expand all
46 static bool UseSessionIdToSelectDevice(int session_id, 46 static bool UseSessionIdToSelectDevice(int session_id,
47 const std::string& device_id); 47 const std::string& device_id);
48 48
49 // Returns the localized name of the generic "default" device. 49 // Returns the localized name of the generic "default" device.
50 static std::string GetDefaultDeviceName(); 50 static std::string GetDefaultDeviceName();
51 51
52 // Returns the localized name of the generic default communications device. 52 // Returns the localized name of the generic default communications device.
53 // This device is not supported on all platforms. 53 // This device is not supported on all platforms.
54 static std::string GetCommunicationsDeviceName(); 54 static std::string GetCommunicationsDeviceName();
55 55
56 private: 56 // AudioDeviceDescription() = default;
57 AudioDeviceDescription() {} 57 // AudioDeviceDescription(const AudioDeviceDescription&) = default;
58 ~AudioDeviceDescription() {} 58 AudioDeviceDescription(const std::string& device_name,
59 const std::string& unique_id,
60 const std::string& group_id);
61
62 ~AudioDeviceDescription() = default;
63
64 std::string device_name; // Friendly name of the device.
65 std::string unique_id; // Unique identifier for the device.
66 std::string group_id; // Group identifier.
mcasas 2016/12/08 16:37:01 These three should be const, right?
o1ka 2016/12/09 14:56:30 Not really. It's a standard Chrome-style structure
59 }; 67 };
60 68
69 typedef std::list<AudioDeviceDescription> AudioDeviceDescriptions;
Guido Urdaneta 2016/12/08 15:53:37 why list and not vector?
mcasas 2016/12/08 16:37:01 No typedef anymore, use "using"
o1ka 2016/12/09 14:56:30 "using declaration cannot refer to a template spec
o1ka 2016/12/09 14:56:30 Just because AudioDeviceNames are a list as well.
70
61 } // namespace media 71 } // namespace media
62 72
63 #endif // MEDIA_AUDIO_AUDIO_DEVICE_DESCRIPTION_H_ 73 #endif // MEDIA_AUDIO_AUDIO_DEVICE_DESCRIPTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698