| 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 // A fake implementation of AudioInputStream, useful for testing purpose. | 5 // A fake implementation of AudioInputStream, useful for testing purpose. |
| 6 | 6 |
| 7 #ifndef MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ | 7 #ifndef MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ |
| 8 #define MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ | 8 #define MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "media/audio/audio_io.h" | 15 #include "media/audio/audio_io.h" |
| 16 #include "media/audio/audio_parameters.h" | 16 #include "media/audio/audio_parameters.h" |
| 17 #include "media/audio/fake_audio_worker.h" | 17 #include "media/audio/fake_audio_worker.h" |
| 18 | 18 |
| 19 namespace media { | 19 namespace media { |
| 20 | 20 |
| 21 class AudioBus; | 21 class AudioBus; |
| 22 class AudioManagerBase; | 22 class AudioManagerBase; |
| 23 class SimpleSource; | 23 class SimpleSource; |
| 24 | 24 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 53 // TODO(hclam): Make this non-static. To do this we'll need to fix | 53 // TODO(hclam): Make this non-static. To do this we'll need to fix |
| 54 // crbug.com/159053 such that video capture device is aware of audio | 54 // crbug.com/159053 such that video capture device is aware of audio |
| 55 // input stream. | 55 // input stream. |
| 56 static void BeepOnce(); | 56 static void BeepOnce(); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 FakeAudioInputStream(AudioManagerBase* manager, | 59 FakeAudioInputStream(AudioManagerBase* manager, |
| 60 const AudioParameters& params); | 60 const AudioParameters& params); |
| 61 ~FakeAudioInputStream() override; | 61 ~FakeAudioInputStream() override; |
| 62 | 62 |
| 63 scoped_ptr<AudioOutputStream::AudioSourceCallback> ChooseSource(); | 63 std::unique_ptr<AudioOutputStream::AudioSourceCallback> ChooseSource(); |
| 64 void ReadAudioFromSource(); | 64 void ReadAudioFromSource(); |
| 65 | 65 |
| 66 AudioManagerBase* audio_manager_; | 66 AudioManagerBase* audio_manager_; |
| 67 AudioInputCallback* callback_; | 67 AudioInputCallback* callback_; |
| 68 FakeAudioWorker fake_audio_worker_; | 68 FakeAudioWorker fake_audio_worker_; |
| 69 AudioParameters params_; | 69 AudioParameters params_; |
| 70 | 70 |
| 71 scoped_ptr<AudioOutputStream::AudioSourceCallback> audio_source_; | 71 std::unique_ptr<AudioOutputStream::AudioSourceCallback> audio_source_; |
| 72 scoped_ptr<media::AudioBus> audio_bus_; | 72 std::unique_ptr<media::AudioBus> audio_bus_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream); | 74 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace media | 77 } // namespace media |
| 78 | 78 |
| 79 #endif // MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ | 79 #endif // MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ |
| OLD | NEW |