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

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

Issue 1892433002: Moving device description utils from AudioManager[Base] into AudioDeviceDescription; to be shared b… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 4 years, 7 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
« no previous file with comments | « media/audio/android/audio_manager_android.cc ('k') | media/audio/audio_device_description.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_AUDIO_AUDIO_DEVICE_DESCRIPTION_H_
6 #define MEDIA_AUDIO_AUDIO_DEVICE_DESCRIPTION_H_
7
8 #include <string>
9 #include "media/base/media_export.h"
10
11 namespace media {
12
13 // Provides common information on audio device names and ids.
14 class MEDIA_EXPORT AudioDeviceDescription {
15 public:
16 // Unique Id of the generic "default" device. Associated with the localized
17 // name returned from GetDefaultDeviceName().
18 static const char kDefaultDeviceId[];
19
20 // Unique Id of the generic default communications device. Associated with
21 // the localized name returned from GetCommunicationsDeviceName().
22 static const char kCommunicationsDeviceId[];
23
24 // Input device ID used to capture the default system playback stream. When
25 // this device ID is passed to MakeAudioInputStream() the returned
26 // AudioInputStream will be capturing audio currently being played on the
27 // default playback device. At the moment this feature is supported only on
28 // some platforms. AudioInputStream::Intialize() will return an error on
29 // platforms that don't support it. GetInputStreamParameters() must be used
30 // to get the parameters of the loopback device before creating a loopback
31 // stream, otherwise stream initialization may fail.
32 static const char kLoopbackInputDeviceId[];
33
34 // Returns true if |device_id| represents the default device.
35 static bool IsDefaultDevice(const std::string& device_id);
36
37 // If |device_id| is not empty, |session_id| should be ignored and the output
38 // device should be selected basing on |device_id|.
39 // If |device_id| is empty and |session_id| is nonzero, output device
40 // associated with the opened input device designated by |session_id| should
41 // be used.
42 static bool UseSessionIdToSelectDevice(int session_id,
43 const std::string& device_id);
44
45 // Returns the localized name of the generic "default" device.
46 static std::string GetDefaultDeviceName();
47
48 // Returns the localized name of the generic default communications device.
49 // This device is not supported on all platforms.
50 static std::string GetCommunicationsDeviceName();
51
52 private:
53 AudioDeviceDescription() {}
54 ~AudioDeviceDescription() {}
55 };
56
57 } // namespace media
58
59 #endif // MEDIA_AUDIO_AUDIO_DEVICE_DESCRIPTION_H_
OLDNEW
« no previous file with comments | « media/audio/android/audio_manager_android.cc ('k') | media/audio/audio_device_description.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698