| 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_VIRTUAL_AUDIO_INPUT_STREAM_H_ | 5 #ifndef MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_ |
| 6 #define MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_ | 6 #define MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void SetVolume(double volume) override; | 57 void SetVolume(double volume) override; |
| 58 double GetVolume() override; | 58 double GetVolume() override; |
| 59 bool SetAutomaticGainControl(bool enabled) override; | 59 bool SetAutomaticGainControl(bool enabled) override; |
| 60 bool GetAutomaticGainControl() override; | 60 bool GetAutomaticGainControl() override; |
| 61 bool IsMuted() override; | 61 bool IsMuted() override; |
| 62 | 62 |
| 63 // Attaches a VirtualAudioOutputStream to be used as input. This | 63 // Attaches a VirtualAudioOutputStream to be used as input. This |
| 64 // VirtualAudioInputStream must outlive all attached streams, so any attached | 64 // VirtualAudioInputStream must outlive all attached streams, so any attached |
| 65 // stream must be closed (which causes a detach) before | 65 // stream must be closed (which causes a detach) before |
| 66 // VirtualAudioInputStream is destroyed. | 66 // VirtualAudioInputStream is destroyed. |
| 67 virtual void AddOutputStream(VirtualAudioOutputStream* stream, | 67 virtual void AddOutputStream(AudioConverter::InputCallback* stream, |
| 68 const AudioParameters& output_params); | 68 const AudioParameters& output_params); |
| 69 | 69 |
| 70 // Detaches a VirtualAudioOutputStream and removes it as input. | 70 // Detaches a VirtualAudioOutputStream and removes it as input. |
| 71 virtual void RemoveOutputStream(VirtualAudioOutputStream* stream, | 71 virtual void RemoveOutputStream(AudioConverter::InputCallback* stream, |
| 72 const AudioParameters& output_params); | 72 const AudioParameters& output_params); |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 friend class VirtualAudioInputStreamTest; | 75 friend class VirtualAudioInputStreamTest; |
| 76 | 76 |
| 77 typedef std::map<AudioParameters, LoopbackAudioConverter*> AudioConvertersMap; | 77 typedef std::map<AudioParameters, LoopbackAudioConverter*> AudioConvertersMap; |
| 78 | 78 |
| 79 // Pulls audio data from all attached VirtualAudioOutputStreams, mixes and | 79 // Pulls audio data from all attached VirtualAudioOutputStreams, mixes and |
| 80 // converts the streams into one, and pushes the result to |callback_|. | 80 // converts the streams into one, and pushes the result to |callback_|. |
| 81 // Invoked on the worker thread. | 81 // Invoked on the worker thread. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 111 scoped_ptr<AudioBus> audio_bus_; | 111 scoped_ptr<AudioBus> audio_bus_; |
| 112 | 112 |
| 113 base::ThreadChecker thread_checker_; | 113 base::ThreadChecker thread_checker_; |
| 114 | 114 |
| 115 DISALLOW_COPY_AND_ASSIGN(VirtualAudioInputStream); | 115 DISALLOW_COPY_AND_ASSIGN(VirtualAudioInputStream); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace media | 118 } // namespace media |
| 119 | 119 |
| 120 #endif // MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_ | 120 #endif // MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_ |
| OLD | NEW |