OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MANAGER_BASE_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "base/win/scoped_com_initializer.h" | 21 #include "base/win/scoped_com_initializer.h" |
22 #endif | 22 #endif |
23 | 23 |
24 namespace media { | 24 namespace media { |
25 | 25 |
26 class AudioOutputDispatcher; | 26 class AudioOutputDispatcher; |
27 | 27 |
28 // AudioManagerBase provides AudioManager functions common for all platforms. | 28 // AudioManagerBase provides AudioManager functions common for all platforms. |
29 class MEDIA_EXPORT AudioManagerBase : public AudioManager { | 29 class MEDIA_EXPORT AudioManagerBase : public AudioManager { |
30 public: | 30 public: |
31 // TODO(sergeyu): The constants below belong to AudioManager interface, not | 31 // TODO(ajm): Move these strings to AudioManager. |
ajm
2015/09/15 00:04:25
I indeed intend to do this in a follow-up. Avoided
| |
32 // to the base implementation. | 32 // Unique Id of the generic "default" device. Associated with the localized |
33 // name returned from GetDefaultDeviceName(). | |
34 static const char kDefaultDeviceId[]; | |
ajm
2015/09/15 00:04:25
The DeviceIDs aren't exposed to users so don't nee
| |
33 | 35 |
34 // Name of the generic "default" device. | 36 // Unique Id of the generic default communications device. Associated with |
35 static const char kDefaultDeviceName[]; | 37 // the localized name returned from GetCommunicationsDeviceName(). |
36 // Unique Id of the generic "default" device. | |
37 static const char kDefaultDeviceId[]; | |
38 // Unique Id of the generic default communications device (where supported). | |
39 static const char kCommunicationsDeviceId[]; | 38 static const char kCommunicationsDeviceId[]; |
40 // Name of the generic default communications device (where supported). | |
41 static const char kCommunicationsDeviceName[]; | |
42 | 39 |
43 // Input device ID used to capture the default system playback stream. When | 40 // Input device ID used to capture the default system playback stream. When |
44 // this device ID is passed to MakeAudioInputStream() the returned | 41 // this device ID is passed to MakeAudioInputStream() the returned |
45 // AudioInputStream will be capturing audio currently being played on the | 42 // AudioInputStream will be capturing audio currently being played on the |
46 // default playback device. At the moment this feature is supported only on | 43 // default playback device. At the moment this feature is supported only on |
47 // some platforms. AudioInputStream::Intialize() will return an error on | 44 // some platforms. AudioInputStream::Intialize() will return an error on |
48 // platforms that don't support it. GetInputStreamParameters() must be used | 45 // platforms that don't support it. GetInputStreamParameters() must be used |
49 // to get the parameters of the loopback device before creating a loopback | 46 // to get the parameters of the loopback device before creating a loopback |
50 // stream, otherwise stream initialization may fail. | 47 // stream, otherwise stream initialization may fail. |
51 static const char kLoopbackInputDeviceId[]; | 48 static const char kLoopbackInputDeviceId[]; |
52 | 49 |
53 ~AudioManagerBase() override; | 50 ~AudioManagerBase() override; |
54 | 51 |
55 // AudioManager: | 52 // AudioManager: |
56 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; | 53 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; |
57 scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override; | 54 scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override; |
58 base::string16 GetAudioInputDeviceModel() override; | 55 base::string16 GetAudioInputDeviceModel() override; |
59 void ShowAudioInputSettings() override; | 56 void ShowAudioInputSettings() override; |
60 void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; | 57 void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; |
61 void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; | 58 void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; |
59 std::string GetDefaultDeviceName() const override; | |
60 std::string GetCommunicationsDeviceName() const override; | |
61 | |
62 AudioOutputStream* MakeAudioOutputStream( | 62 AudioOutputStream* MakeAudioOutputStream( |
63 const AudioParameters& params, | 63 const AudioParameters& params, |
64 const std::string& device_id) override; | 64 const std::string& device_id) override; |
65 AudioInputStream* MakeAudioInputStream(const AudioParameters& params, | 65 AudioInputStream* MakeAudioInputStream(const AudioParameters& params, |
66 const std::string& device_id) override; | 66 const std::string& device_id) override; |
67 AudioOutputStream* MakeAudioOutputStreamProxy( | 67 AudioOutputStream* MakeAudioOutputStreamProxy( |
68 const AudioParameters& params, | 68 const AudioParameters& params, |
69 const std::string& device_id) override; | 69 const std::string& device_id) override; |
70 | 70 |
71 // Listeners will be notified on the GetTaskRunner() task runner. | 71 // Listeners will be notified on the GetTaskRunner() task runner. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 | 186 |
187 // Proxy for creating AudioLog objects. | 187 // Proxy for creating AudioLog objects. |
188 AudioLogFactory* const audio_log_factory_; | 188 AudioLogFactory* const audio_log_factory_; |
189 | 189 |
190 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 190 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
191 }; | 191 }; |
192 | 192 |
193 } // namespace media | 193 } // namespace media |
194 | 194 |
195 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 195 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
OLD | NEW |