| 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 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class 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, FilterCallback* callback); | 40 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb); |
| 41 | 41 |
| 42 // AudioRenderer implementation. | 42 // AudioRenderer implementation. |
| 43 virtual void Initialize(AudioDecoder* decoder, FilterCallback* callback); | 43 virtual void Initialize(AudioDecoder* decoder, FilterCallback* callback); |
| 44 virtual bool HasEnded(); | 44 virtual bool HasEnded(); |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 // Subclasses should return true if they were able to initialize, false | 47 // Subclasses should return true if they were able to initialize, false |
| 48 // otherwise. | 48 // otherwise. |
| 49 virtual bool OnInitialize(const AudioDecoderConfig& config) = 0; | 49 virtual bool OnInitialize(const AudioDecoderConfig& config) = 0; |
| 50 | 50 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // | 118 // |
| 119 // We use size_t since we compare against std::deque::size(). | 119 // We use size_t since we compare against std::deque::size(). |
| 120 size_t pending_reads_; | 120 size_t pending_reads_; |
| 121 | 121 |
| 122 // Audio time at end of last call to FillBuffer(). | 122 // Audio time at end of last call to FillBuffer(). |
| 123 // TODO(ralphl): Update this value after seeking. | 123 // TODO(ralphl): Update this value after seeking. |
| 124 base::TimeDelta last_fill_buffer_time_; | 124 base::TimeDelta last_fill_buffer_time_; |
| 125 | 125 |
| 126 // Filter callbacks. | 126 // Filter callbacks. |
| 127 scoped_ptr<FilterCallback> pause_callback_; | 127 scoped_ptr<FilterCallback> pause_callback_; |
| 128 scoped_ptr<FilterCallback> seek_callback_; | 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 |