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