| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_INOUT_STREAM_H_ | 8 #define MEDIA_AUDIO_FAKE_AUDIO_INOUT_STREAM_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "base/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "media/audio/audio_io.h" | 16 #include "media/audio/audio_io.h" |
| 17 #include "media/audio/audio_parameters.h" | 17 #include "media/audio/audio_parameters.h" |
| 18 | 18 |
| 19 class FakeAudioInputStream : | 19 class FakeAudioInputStream : |
| 20 public AudioInputStream, | 20 public AudioInputStream, |
| 21 public base::RefCountedThreadSafe<FakeAudioInputStream> { | 21 public base::RefCountedThreadSafe<FakeAudioInputStream> { |
| 22 public: | 22 public: |
| 23 static AudioInputStream* MakeFakeStream(AudioParameters params); | 23 static AudioInputStream* MakeFakeStream(AudioParameters params); |
| 24 | 24 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 40 scoped_array<uint8> buffer_; | 40 scoped_array<uint8> buffer_; |
| 41 int buffer_size_; | 41 int buffer_size_; |
| 42 base::Thread thread_; | 42 base::Thread thread_; |
| 43 base::Time last_callback_time_; | 43 base::Time last_callback_time_; |
| 44 int callback_interval_ms_; | 44 int callback_interval_ms_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream); | 46 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 #endif // MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ | 49 #endif // MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ |
| OLD | NEW |