| 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 30 matching lines...) Expand all  Loading... | 
|   41   // AudioInputStream will be capturing audio currently being played on the |   41   // AudioInputStream will be capturing audio currently being played on the | 
|   42   // default playback device. At the moment this feature is supported only on |   42   // default playback device. At the moment this feature is supported only on | 
|   43   // some platforms. AudioInputStream::Intialize() will return an error on |   43   // some platforms. AudioInputStream::Intialize() will return an error on | 
|   44   // platforms that don't support it. GetInputStreamParameters() must be used |   44   // platforms that don't support it. GetInputStreamParameters() must be used | 
|   45   // to get the parameters of the loopback device before creating a loopback |   45   // to get the parameters of the loopback device before creating a loopback | 
|   46   // stream, otherwise stream initialization may fail. |   46   // stream, otherwise stream initialization may fail. | 
|   47   static const char kLoopbackInputDeviceId[]; |   47   static const char kLoopbackInputDeviceId[]; | 
|   48  |   48  | 
|   49   virtual ~AudioManagerBase(); |   49   virtual ~AudioManagerBase(); | 
|   50  |   50  | 
|   51   virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() OVERRIDE; |   51   virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; | 
|   52   virtual scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() |   52   virtual scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() | 
|   53       OVERRIDE; |   53       override; | 
|   54  |   54  | 
|   55   virtual base::string16 GetAudioInputDeviceModel() OVERRIDE; |   55   virtual base::string16 GetAudioInputDeviceModel() override; | 
|   56  |   56  | 
|   57   virtual void ShowAudioInputSettings() OVERRIDE; |   57   virtual void ShowAudioInputSettings() override; | 
|   58  |   58  | 
|   59   virtual void GetAudioInputDeviceNames( |   59   virtual void GetAudioInputDeviceNames( | 
|   60       AudioDeviceNames* device_names) OVERRIDE; |   60       AudioDeviceNames* device_names) override; | 
|   61  |   61  | 
|   62   virtual void GetAudioOutputDeviceNames( |   62   virtual void GetAudioOutputDeviceNames( | 
|   63       AudioDeviceNames* device_names) OVERRIDE; |   63       AudioDeviceNames* device_names) override; | 
|   64  |   64  | 
|   65   virtual AudioOutputStream* MakeAudioOutputStream( |   65   virtual AudioOutputStream* MakeAudioOutputStream( | 
|   66       const AudioParameters& params, |   66       const AudioParameters& params, | 
|   67       const std::string& device_id) OVERRIDE; |   67       const std::string& device_id) override; | 
|   68  |   68  | 
|   69   virtual AudioInputStream* MakeAudioInputStream( |   69   virtual AudioInputStream* MakeAudioInputStream( | 
|   70       const AudioParameters& params, const std::string& device_id) OVERRIDE; |   70       const AudioParameters& params, const std::string& device_id) override; | 
|   71  |   71  | 
|   72   virtual AudioOutputStream* MakeAudioOutputStreamProxy( |   72   virtual AudioOutputStream* MakeAudioOutputStreamProxy( | 
|   73       const AudioParameters& params, |   73       const AudioParameters& params, | 
|   74       const std::string& device_id) OVERRIDE; |   74       const std::string& device_id) override; | 
|   75  |   75  | 
|   76   // Called internally by the audio stream when it has been closed. |   76   // Called internally by the audio stream when it has been closed. | 
|   77   virtual void ReleaseOutputStream(AudioOutputStream* stream); |   77   virtual void ReleaseOutputStream(AudioOutputStream* stream); | 
|   78   virtual void ReleaseInputStream(AudioInputStream* stream); |   78   virtual void ReleaseInputStream(AudioInputStream* stream); | 
|   79  |   79  | 
|   80   // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy |   80   // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy | 
|   81   // name is also from |AUDIO_PCM_LINEAR|. |   81   // name is also from |AUDIO_PCM_LINEAR|. | 
|   82   virtual AudioOutputStream* MakeLinearOutputStream( |   82   virtual AudioOutputStream* MakeLinearOutputStream( | 
|   83       const AudioParameters& params) = 0; |   83       const AudioParameters& params) = 0; | 
|   84  |   84  | 
|   85   // Creates the output stream for the |AUDIO_PCM_LOW_LATENCY| format. |   85   // Creates the output stream for the |AUDIO_PCM_LOW_LATENCY| format. | 
|   86   virtual AudioOutputStream* MakeLowLatencyOutputStream( |   86   virtual AudioOutputStream* MakeLowLatencyOutputStream( | 
|   87       const AudioParameters& params, |   87       const AudioParameters& params, | 
|   88       const std::string& device_id) = 0; |   88       const std::string& device_id) = 0; | 
|   89  |   89  | 
|   90   // Creates the input stream for the |AUDIO_PCM_LINEAR| format. The legacy |   90   // Creates the input stream for the |AUDIO_PCM_LINEAR| format. The legacy | 
|   91   // name is also from |AUDIO_PCM_LINEAR|. |   91   // name is also from |AUDIO_PCM_LINEAR|. | 
|   92   virtual AudioInputStream* MakeLinearInputStream( |   92   virtual AudioInputStream* MakeLinearInputStream( | 
|   93       const AudioParameters& params, const std::string& device_id) = 0; |   93       const AudioParameters& params, const std::string& device_id) = 0; | 
|   94  |   94  | 
|   95   // Creates the input stream for the |AUDIO_PCM_LOW_LATENCY| format. |   95   // Creates the input stream for the |AUDIO_PCM_LOW_LATENCY| format. | 
|   96   virtual AudioInputStream* MakeLowLatencyInputStream( |   96   virtual AudioInputStream* MakeLowLatencyInputStream( | 
|   97       const AudioParameters& params, const std::string& device_id) = 0; |   97       const AudioParameters& params, const std::string& device_id) = 0; | 
|   98  |   98  | 
|   99   // Listeners will be notified on the GetTaskRunner() task runner. |   99   // Listeners will be notified on the GetTaskRunner() task runner. | 
|  100   virtual void AddOutputDeviceChangeListener( |  100   virtual void AddOutputDeviceChangeListener( | 
|  101       AudioDeviceListener* listener) OVERRIDE; |  101       AudioDeviceListener* listener) override; | 
|  102   virtual void RemoveOutputDeviceChangeListener( |  102   virtual void RemoveOutputDeviceChangeListener( | 
|  103       AudioDeviceListener* listener) OVERRIDE; |  103       AudioDeviceListener* listener) override; | 
|  104  |  104  | 
|  105   virtual AudioParameters GetDefaultOutputStreamParameters() OVERRIDE; |  105   virtual AudioParameters GetDefaultOutputStreamParameters() override; | 
|  106   virtual AudioParameters GetOutputStreamParameters( |  106   virtual AudioParameters GetOutputStreamParameters( | 
|  107       const std::string& device_id) OVERRIDE; |  107       const std::string& device_id) override; | 
|  108  |  108  | 
|  109   virtual AudioParameters GetInputStreamParameters( |  109   virtual AudioParameters GetInputStreamParameters( | 
|  110       const std::string& device_id) OVERRIDE; |  110       const std::string& device_id) override; | 
|  111  |  111  | 
|  112   virtual std::string GetAssociatedOutputDeviceID( |  112   virtual std::string GetAssociatedOutputDeviceID( | 
|  113       const std::string& input_device_id) OVERRIDE; |  113       const std::string& input_device_id) override; | 
|  114  |  114  | 
|  115   virtual scoped_ptr<AudioLog> CreateAudioLog( |  115   virtual scoped_ptr<AudioLog> CreateAudioLog( | 
|  116       AudioLogFactory::AudioComponent component) OVERRIDE; |  116       AudioLogFactory::AudioComponent component) override; | 
|  117  |  117  | 
|  118   virtual void SetHasKeyboardMic() OVERRIDE; |  118   virtual void SetHasKeyboardMic() override; | 
|  119  |  119  | 
|  120   // Get number of input or output streams. |  120   // Get number of input or output streams. | 
|  121   int input_stream_count() const { return num_input_streams_; } |  121   int input_stream_count() const { return num_input_streams_; } | 
|  122   int output_stream_count() const { return num_output_streams_; } |  122   int output_stream_count() const { return num_output_streams_; } | 
|  123  |  123  | 
|  124  protected: |  124  protected: | 
|  125   AudioManagerBase(AudioLogFactory* audio_log_factory); |  125   AudioManagerBase(AudioLogFactory* audio_log_factory); | 
|  126  |  126  | 
|  127   // Shuts down the audio thread and releases all the audio output dispatchers |  127   // Shuts down the audio thread and releases all the audio output dispatchers | 
|  128   // on the audio thread.  All audio streams should be freed before Shutdown() |  128   // on the audio thread.  All audio streams should be freed before Shutdown() | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  195  |  195  | 
|  196   // Proxy for creating AudioLog objects. |  196   // Proxy for creating AudioLog objects. | 
|  197   AudioLogFactory* const audio_log_factory_; |  197   AudioLogFactory* const audio_log_factory_; | 
|  198  |  198  | 
|  199   DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |  199   DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 
|  200 }; |  200 }; | 
|  201  |  201  | 
|  202 }  // namespace media |  202 }  // namespace media | 
|  203  |  203  | 
|  204 #endif  // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |  204 #endif  // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 
| OLD | NEW |