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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 virtual void Initialize(DemuxerStream* stream, | 128 virtual void Initialize(DemuxerStream* stream, |
129 const PipelineStatusCB& callback, | 129 const PipelineStatusCB& callback, |
130 const StatisticsCallback& stats_callback) = 0; | 130 const StatisticsCallback& stats_callback) = 0; |
131 | 131 |
132 // Request a frame to be decoded and returned via the provided callback. | 132 // Request a frame to be decoded and returned via the provided callback. |
133 // Only one read may be in flight at any given time. | 133 // Only one read may be in flight at any given time. |
134 // | 134 // |
135 // Implementations guarantee that the callback will not be called from within | 135 // Implementations guarantee that the callback will not be called from within |
136 // this method. | 136 // this method. |
137 // | 137 // |
138 // Frames will be non-NULL yet may be end of stream frames. | 138 // Non-NULL frames contain decoded video data or may indicate the end of |
139 // the stream. NULL video frames indicate an aborted read. This can happen if | |
140 // the DemuxerStream gets flushed and doesn't have any more data to return. | |
141 // An aborted read indicates a seek will likely happen shortly. | |
Ami GONE FROM CHROMIUM
2012/01/27 23:44:58
I don't like the "likely" in the last sentence her
acolwell GONE FROM CHROMIUM
2012/01/29 03:00:41
Done.
| |
139 typedef base::Callback<void(scoped_refptr<VideoFrame>)> ReadCB; | 142 typedef base::Callback<void(scoped_refptr<VideoFrame>)> ReadCB; |
140 virtual void Read(const ReadCB& callback) = 0; | 143 virtual void Read(const ReadCB& callback) = 0; |
141 | 144 |
142 // Returns the natural width and height of decoded video in pixels. | 145 // Returns the natural width and height of decoded video in pixels. |
143 // | 146 // |
144 // Clients should NOT rely on these values to remain constant. Instead, use | 147 // Clients should NOT rely on these values to remain constant. Instead, use |
145 // the width/height from decoded video frames themselves. | 148 // the width/height from decoded video frames themselves. |
146 // | 149 // |
147 // TODO(scherkus): why not rely on prerolling and decoding a single frame to | 150 // TODO(scherkus): why not rely on prerolling and decoding a single frame to |
148 // get dimensions? | 151 // get dimensions? |
(...skipping 27 matching lines...) Expand all Loading... | |
176 // TODO(scherkus): switch to PipelineStatus callback. | 179 // TODO(scherkus): switch to PipelineStatus callback. |
177 virtual void Initialize(DemuxerStream* stream, const base::Closure& callback, | 180 virtual void Initialize(DemuxerStream* stream, const base::Closure& callback, |
178 const StatisticsCallback& stats_callback) = 0; | 181 const StatisticsCallback& stats_callback) = 0; |
179 | 182 |
180 // Request samples to be decoded and returned via the provided callback. | 183 // Request samples to be decoded and returned via the provided callback. |
181 // Only one read may be in flight at any given time. | 184 // Only one read may be in flight at any given time. |
182 // | 185 // |
183 // Implementations guarantee that the callback will not be called from within | 186 // Implementations guarantee that the callback will not be called from within |
184 // this method. | 187 // this method. |
185 // | 188 // |
186 // Sample buffers will be non-NULL yet may be end of stream buffers. | 189 // Non-NULL sample buffer pointers will contain decoded audio data or may |
190 // indicate the end of the stream. A NULL buffer pointer indicates an aborted | |
191 // Read(). This can happen if the DemuxerStream gets flushed and doesn't have | |
192 // any more data to return. An aborted read indicates a seek will likely | |
193 // happen shortly. | |
187 typedef base::Callback<void(scoped_refptr<Buffer>)> ReadCB; | 194 typedef base::Callback<void(scoped_refptr<Buffer>)> ReadCB; |
188 virtual void Read(const ReadCB& callback) = 0; | 195 virtual void Read(const ReadCB& callback) = 0; |
189 | 196 |
190 // Returns various information about the decoded audio format. | 197 // Returns various information about the decoded audio format. |
191 virtual int bits_per_channel() = 0; | 198 virtual int bits_per_channel() = 0; |
192 virtual ChannelLayout channel_layout() = 0; | 199 virtual ChannelLayout channel_layout() = 0; |
193 virtual int samples_per_second() = 0; | 200 virtual int samples_per_second() = 0; |
194 | 201 |
195 protected: | 202 protected: |
196 AudioDecoder(); | 203 AudioDecoder(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 | 239 |
233 // Resumes playback after underflow occurs. | 240 // Resumes playback after underflow occurs. |
234 // |buffer_more_audio| is set to true if you want to increase the size of the | 241 // |buffer_more_audio| is set to true if you want to increase the size of the |
235 // decoded audio buffer. | 242 // decoded audio buffer. |
236 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0; | 243 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0; |
237 }; | 244 }; |
238 | 245 |
239 } // namespace media | 246 } // namespace media |
240 | 247 |
241 #endif // MEDIA_BASE_FILTERS_H_ | 248 #endif // MEDIA_BASE_FILTERS_H_ |
OLD | NEW |