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 // Filters are connected in a strongly typed manner, with downstream filters | 5 // Filters are connected in a strongly typed manner, with downstream filters |
6 // always reading data from upstream filters. Upstream filters have no clue | 6 // always reading data from upstream filters. Upstream filters have no clue |
7 // who is actually reading from them, and return the results via callbacks. | 7 // who is actually reading from them, and return the results via callbacks. |
8 // | 8 // |
9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer | 9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer |
10 // DataSource <- Demuxer < | 10 // DataSource <- Demuxer < |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Initialize a VideoRenderer with the given VideoDecoder, executing the | 114 // Initialize a VideoRenderer with the given VideoDecoder, executing the |
115 // callback upon completion. | 115 // callback upon completion. |
116 virtual void Initialize(const scoped_refptr<VideoDecoder>& decoder, | 116 virtual void Initialize(const scoped_refptr<VideoDecoder>& decoder, |
117 const PipelineStatusCB& status_cb, | 117 const PipelineStatusCB& status_cb, |
118 const StatisticsCB& statistics_cb, | 118 const StatisticsCB& statistics_cb, |
119 const TimeCB& time_cb) = 0; | 119 const TimeCB& time_cb) = 0; |
120 | 120 |
121 // Returns true if this filter has received and processed an end-of-stream | 121 // Returns true if this filter has received and processed an end-of-stream |
122 // buffer. | 122 // buffer. |
123 virtual bool HasEnded() = 0; | 123 virtual bool HasEnded() = 0; |
| 124 |
| 125 protected: |
| 126 virtual ~VideoRenderer() {} |
124 }; | 127 }; |
125 | 128 |
126 class MEDIA_EXPORT AudioRenderer : public Filter { | 129 class MEDIA_EXPORT AudioRenderer : public Filter { |
127 public: | 130 public: |
128 // Used to update the pipeline's clock time. The first parameter is the | 131 // Used to update the pipeline's clock time. The first parameter is the |
129 // current time, and the second parameter is the time that the clock must not | 132 // current time, and the second parameter is the time that the clock must not |
130 // exceed. | 133 // exceed. |
131 typedef base::Callback<void(base::TimeDelta, base::TimeDelta)> TimeCB; | 134 typedef base::Callback<void(base::TimeDelta, base::TimeDelta)> TimeCB; |
132 | 135 |
133 // Initialize a AudioRenderer with the given AudioDecoder, executing the | 136 // Initialize a AudioRenderer with the given AudioDecoder, executing the |
(...skipping 11 matching lines...) Expand all Loading... |
145 // buffer. | 148 // buffer. |
146 virtual bool HasEnded() = 0; | 149 virtual bool HasEnded() = 0; |
147 | 150 |
148 // Sets the output volume. | 151 // Sets the output volume. |
149 virtual void SetVolume(float volume) = 0; | 152 virtual void SetVolume(float volume) = 0; |
150 | 153 |
151 // Resumes playback after underflow occurs. | 154 // Resumes playback after underflow occurs. |
152 // |buffer_more_audio| is set to true if you want to increase the size of the | 155 // |buffer_more_audio| is set to true if you want to increase the size of the |
153 // decoded audio buffer. | 156 // decoded audio buffer. |
154 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0; | 157 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0; |
| 158 |
| 159 protected: |
| 160 virtual ~AudioRenderer() {} |
155 }; | 161 }; |
156 | 162 |
157 } // namespace media | 163 } // namespace media |
158 | 164 |
159 #endif // MEDIA_BASE_FILTERS_H_ | 165 #endif // MEDIA_BASE_FILTERS_H_ |
OLD | NEW |