OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // AudioRendererBase takes care of the tricky queuing work and provides simple | 5 // AudioRendererBase takes care of the tricky queuing work and provides simple |
6 // methods for subclasses to peek and poke at audio data. In addition to | 6 // methods for subclasses to peek and poke at audio data. In addition to |
7 // AudioRenderer interface methods this classes doesn't implement, subclasses | 7 // AudioRenderer interface methods this classes doesn't implement, subclasses |
8 // must also implement the following methods: | 8 // must also implement the following methods: |
9 // OnInitialized | 9 // OnInitialized |
10 // OnStop | 10 // OnStop |
11 // | 11 // |
12 // The general assumption is that subclasses start a callback-based audio thread | 12 // The general assumption is that subclasses start a callback-based audio thread |
13 // which needs to be filled with decoded audio data. AudioDecoderBase provides | 13 // which needs to be filled with decoded audio data. AudioDecoderBase provides |
14 // FillBuffer which handles filling the provided buffer, dequeuing items, | 14 // FillBuffer which handles filling the provided buffer, dequeuing items, |
15 // scheduling additional reads and updating the clock. In a sense, | 15 // scheduling additional reads and updating the clock. In a sense, |
16 // AudioRendererBase is the producer and the subclass is the consumer. | 16 // AudioRendererBase is the producer and the subclass is the consumer. |
17 | 17 |
18 #ifndef MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ | 18 #ifndef MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ |
19 #define MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ | 19 #define MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ |
20 | 20 |
21 #include <deque> | 21 #include <deque> |
22 | 22 |
23 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" |
24 #include "media/base/buffers.h" | 24 #include "media/base/buffers.h" |
25 #include "media/base/filters.h" | 25 #include "media/base/filters.h" |
26 #include "media/filters/audio_renderer_algorithm_base.h" | 26 #include "media/filters/audio_renderer_algorithm_base.h" |
27 | 27 |
28 namespace media { | 28 namespace media { |
29 | 29 |
30 class MEDIA_EXPORT AudioRendererBase : public AudioRenderer { | 30 class AudioRendererBase : public AudioRenderer { |
31 public: | 31 public: |
32 AudioRendererBase(); | 32 AudioRendererBase(); |
33 virtual ~AudioRendererBase(); | 33 virtual ~AudioRendererBase(); |
34 | 34 |
35 // Filter implementation. | 35 // Filter implementation. |
36 virtual void Play(FilterCallback* callback); | 36 virtual void Play(FilterCallback* callback); |
37 virtual void Pause(FilterCallback* callback); | 37 virtual void Pause(FilterCallback* callback); |
38 virtual void Stop(FilterCallback* callback); | 38 virtual void Stop(FilterCallback* callback); |
39 | 39 |
40 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb); | 40 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 FilterStatusCB seek_cb_; | 128 FilterStatusCB seek_cb_; |
129 | 129 |
130 base::TimeDelta seek_timestamp_; | 130 base::TimeDelta seek_timestamp_; |
131 | 131 |
132 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase); | 132 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase); |
133 }; | 133 }; |
134 | 134 |
135 } // namespace media | 135 } // namespace media |
136 | 136 |
137 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ | 137 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ |
OLD | NEW |