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 AudioOutputStream. It is used for testing purpose. | 5 // A fake implementation of AudioOutputStream. It is used for testing purpose. |
6 // TODO(hclam): Implement a thread in this fake output stream to simulate an | 6 // TODO(hclam): Implement a thread in this fake output stream to simulate an |
7 // audio output stream reading from AudioSourceCallback. | 7 // audio output stream reading from AudioSourceCallback. |
8 | 8 |
9 #ifndef MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_ | 9 #ifndef MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_ |
10 #define MEDIA_AUDIO_FAKE_AUDIO_OUTOUT_STREAM_H_ | 10 #define MEDIA_AUDIO_FAKE_AUDIO_OUTOUT_STREAM_H_ |
11 | 11 |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/memory/scoped_ptr.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 | 17 |
| 18 namespace media { |
| 19 |
18 class AudioManagerBase; | 20 class AudioManagerBase; |
19 | 21 |
20 class MEDIA_EXPORT FakeAudioOutputStream : public AudioOutputStream { | 22 class MEDIA_EXPORT FakeAudioOutputStream : public AudioOutputStream { |
21 public: | 23 public: |
22 static AudioOutputStream* MakeFakeStream(AudioManagerBase* manager, | 24 static AudioOutputStream* MakeFakeStream(AudioManagerBase* manager, |
23 const AudioParameters& params); | 25 const AudioParameters& params); |
24 | 26 |
25 static FakeAudioOutputStream* GetCurrentFakeStream(); | 27 static FakeAudioOutputStream* GetCurrentFakeStream(); |
26 | 28 |
27 virtual bool Open() OVERRIDE; | 29 virtual bool Open() OVERRIDE; |
(...skipping 17 matching lines...) Expand all Loading... |
45 AudioManagerBase* audio_manager_; | 47 AudioManagerBase* audio_manager_; |
46 double volume_; | 48 double volume_; |
47 AudioSourceCallback* callback_; | 49 AudioSourceCallback* callback_; |
48 scoped_array<uint8> buffer_; | 50 scoped_array<uint8> buffer_; |
49 uint32 bytes_per_buffer_; | 51 uint32 bytes_per_buffer_; |
50 bool closed_; | 52 bool closed_; |
51 | 53 |
52 DISALLOW_COPY_AND_ASSIGN(FakeAudioOutputStream); | 54 DISALLOW_COPY_AND_ASSIGN(FakeAudioOutputStream); |
53 }; | 55 }; |
54 | 56 |
| 57 } // namespace media |
| 58 |
55 #endif // MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_ | 59 #endif // MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_ |
OLD | NEW |