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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 20 matching lines...) Expand all Loading... |
31 public: | 31 public: |
32 ~AudioManagerBase() override; | 32 ~AudioManagerBase() override; |
33 | 33 |
34 // AudioManager: | 34 // AudioManager: |
35 base::string16 GetAudioInputDeviceModel() override; | 35 base::string16 GetAudioInputDeviceModel() override; |
36 void ShowAudioInputSettings() override; | 36 void ShowAudioInputSettings() override; |
37 void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; | 37 void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; |
38 void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; | 38 void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; |
39 AudioOutputStream* MakeAudioOutputStream( | 39 AudioOutputStream* MakeAudioOutputStream( |
40 const AudioParameters& params, | 40 const AudioParameters& params, |
41 const std::string& device_id, | 41 const std::string& device_id) override; |
42 const LogCallback& log_callback) override; | 42 AudioInputStream* MakeAudioInputStream(const AudioParameters& params, |
43 AudioInputStream* MakeAudioInputStream( | 43 const std::string& device_id) override; |
44 const AudioParameters& params, | |
45 const std::string& device_id, | |
46 const LogCallback& log_callback) override; | |
47 AudioOutputStream* MakeAudioOutputStreamProxy( | 44 AudioOutputStream* MakeAudioOutputStreamProxy( |
48 const AudioParameters& params, | 45 const AudioParameters& params, |
49 const std::string& device_id) override; | 46 const std::string& device_id) override; |
50 | 47 |
51 // Listeners will be notified on the GetTaskRunner() task runner. | 48 // Listeners will be notified on the GetTaskRunner() task runner. |
52 void AddOutputDeviceChangeListener(AudioDeviceListener* listener) override; | 49 void AddOutputDeviceChangeListener(AudioDeviceListener* listener) override; |
53 void RemoveOutputDeviceChangeListener(AudioDeviceListener* listener) override; | 50 void RemoveOutputDeviceChangeListener(AudioDeviceListener* listener) override; |
54 | 51 |
55 AudioParameters GetDefaultOutputStreamParameters() override; | 52 AudioParameters GetDefaultOutputStreamParameters() override; |
56 AudioParameters GetOutputStreamParameters( | 53 AudioParameters GetOutputStreamParameters( |
57 const std::string& device_id) override; | 54 const std::string& device_id) override; |
58 AudioParameters GetInputStreamParameters( | 55 AudioParameters GetInputStreamParameters( |
59 const std::string& device_id) override; | 56 const std::string& device_id) override; |
60 std::string GetAssociatedOutputDeviceID( | 57 std::string GetAssociatedOutputDeviceID( |
61 const std::string& input_device_id) override; | 58 const std::string& input_device_id) override; |
62 std::unique_ptr<AudioLog> CreateAudioLog( | 59 std::unique_ptr<AudioLog> CreateAudioLog( |
63 AudioLogFactory::AudioComponent component) override; | 60 AudioLogFactory::AudioComponent component) override; |
64 | 61 |
65 // AudioManagerBase: | 62 // AudioManagerBase: |
66 | 63 |
67 // Called internally by the audio stream when it has been closed. | 64 // Called internally by the audio stream when it has been closed. |
68 virtual void ReleaseOutputStream(AudioOutputStream* stream); | 65 virtual void ReleaseOutputStream(AudioOutputStream* stream); |
69 virtual void ReleaseInputStream(AudioInputStream* stream); | 66 virtual void ReleaseInputStream(AudioInputStream* stream); |
70 | 67 |
71 // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy | 68 // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy |
72 // name is also from |AUDIO_PCM_LINEAR|. | 69 // name is also from |AUDIO_PCM_LINEAR|. |
73 virtual AudioOutputStream* MakeLinearOutputStream( | 70 virtual AudioOutputStream* MakeLinearOutputStream( |
74 const AudioParameters& params, | 71 const AudioParameters& params) = 0; |
75 const LogCallback& log_callback) = 0; | |
76 | 72 |
77 // Creates the output stream for the |AUDIO_PCM_LOW_LATENCY| format. | 73 // Creates the output stream for the |AUDIO_PCM_LOW_LATENCY| format. |
78 virtual AudioOutputStream* MakeLowLatencyOutputStream( | 74 virtual AudioOutputStream* MakeLowLatencyOutputStream( |
79 const AudioParameters& params, | 75 const AudioParameters& params, |
80 const std::string& device_id, | 76 const std::string& device_id) = 0; |
81 const LogCallback& log_callback) = 0; | |
82 | 77 |
83 // Creates the input stream for the |AUDIO_PCM_LINEAR| format. The legacy | 78 // Creates the input stream for the |AUDIO_PCM_LINEAR| format. The legacy |
84 // name is also from |AUDIO_PCM_LINEAR|. | 79 // name is also from |AUDIO_PCM_LINEAR|. |
85 virtual AudioInputStream* MakeLinearInputStream( | 80 virtual AudioInputStream* MakeLinearInputStream( |
86 const AudioParameters& params, | 81 const AudioParameters& params, const std::string& device_id) = 0; |
87 const std::string& device_id, | |
88 const LogCallback& log_callback) = 0; | |
89 | 82 |
90 // Creates the input stream for the |AUDIO_PCM_LOW_LATENCY| format. | 83 // Creates the input stream for the |AUDIO_PCM_LOW_LATENCY| format. |
91 virtual AudioInputStream* MakeLowLatencyInputStream( | 84 virtual AudioInputStream* MakeLowLatencyInputStream( |
92 const AudioParameters& params, | 85 const AudioParameters& params, const std::string& device_id) = 0; |
93 const std::string& device_id, | |
94 const LogCallback& log_callback) = 0; | |
95 | 86 |
96 // Get number of input or output streams. | 87 // Get number of input or output streams. |
97 int input_stream_count() const { return num_input_streams_; } | 88 int input_stream_count() const { return num_input_streams_; } |
98 int output_stream_count() const { return num_output_streams_; } | 89 int output_stream_count() const { return num_output_streams_; } |
99 | 90 |
100 protected: | 91 protected: |
101 AudioManagerBase( | 92 AudioManagerBase( |
102 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 93 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
103 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, | 94 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, |
104 AudioLogFactory* audio_log_factory); | 95 AudioLogFactory* audio_log_factory); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 154 |
164 // Proxy for creating AudioLog objects. | 155 // Proxy for creating AudioLog objects. |
165 AudioLogFactory* const audio_log_factory_; | 156 AudioLogFactory* const audio_log_factory_; |
166 | 157 |
167 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 158 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
168 }; | 159 }; |
169 | 160 |
170 } // namespace media | 161 } // namespace media |
171 | 162 |
172 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 163 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
OLD | NEW |