OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_FAKE_AUDIO_CONSUMER_H_ | 5 #ifndef MEDIA_AUDIO_FAKE_AUDIO_CONSUMER_H_ |
6 #define MEDIA_AUDIO_FAKE_AUDIO_CONSUMER_H_ | 6 #define MEDIA_AUDIO_FAKE_AUDIO_CONSUMER_H_ |
7 | 7 |
8 #include "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 private: | 41 private: |
42 // Task that regularly calls |read_cb_| according to the playback rate as | 42 // Task that regularly calls |read_cb_| according to the playback rate as |
43 // determined by the audio parameters given during construction. Runs on | 43 // determined by the audio parameters given during construction. Runs on |
44 // |message_loop_|. | 44 // |message_loop_|. |
45 void DoRead(); | 45 void DoRead(); |
46 | 46 |
47 scoped_refptr<base::MessageLoopProxy> message_loop_; | 47 scoped_refptr<base::MessageLoopProxy> message_loop_; |
48 ReadCB read_cb_; | 48 ReadCB read_cb_; |
49 scoped_ptr<AudioBus> audio_bus_; | 49 scoped_ptr<AudioBus> audio_bus_; |
50 base::TimeDelta buffer_duration_; | 50 base::TimeDelta buffer_duration_; |
51 base::Time next_read_time_; | 51 base::TimeTicks next_read_time_; |
52 | 52 |
53 // Used to post delayed tasks to the AudioThread that we can cancel. | 53 // Used to post delayed tasks to the AudioThread that we can cancel. |
54 base::CancelableClosure read_task_cb_; | 54 base::CancelableClosure read_task_cb_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(FakeAudioConsumer); | 56 DISALLOW_COPY_AND_ASSIGN(FakeAudioConsumer); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace media | 59 } // namespace media |
60 | 60 |
61 #endif // MEDIA_AUDIO_FAKE_AUDIO_CONSUMER_H_ | 61 #endif // MEDIA_AUDIO_FAKE_AUDIO_CONSUMER_H_ |
OLD | NEW |