Chromium Code Reviews| Index: media/base/filters.h |
| diff --git a/media/base/filters.h b/media/base/filters.h |
| index 1624a60b0ebfd4fab9c88909c3e0c0089a61d9b8..cfa0a4bdf9bd12e399267cc9731583f2037ae472 100644 |
| --- a/media/base/filters.h |
| +++ b/media/base/filters.h |
| @@ -164,22 +164,17 @@ class MEDIA_EXPORT VideoDecoder : public Filter { |
| // Initialize a VideoDecoder with the given DemuxerStream, executing the |
| // callback upon completion. |
| // stats_callback is used to update global pipeline statistics. |
| + // |
| + // TODO(scherkus): switch to PipelineStatus callback. |
| virtual void Initialize(DemuxerStream* stream, const base::Closure& callback, |
| const StatisticsCallback& stats_callback) = 0; |
| - // Renderer provides an output buffer for Decoder to write to. These buffers |
| - // will be recycled to renderer via the permanent callback. |
| + // Request a frame to be decoded and returned via the provided callback. |
| + // Only one read may be in flight at any given time. |
| // |
| - // We could also pass empty pointer here to let decoder provide buffers pool. |
| - virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame) = 0; |
| - |
| - // Installs a permanent callback for passing decoded video output. |
| - // |
| - // A NULL frame represents a decoding error. |
| - typedef base::Callback<void(scoped_refptr<VideoFrame>)> ConsumeVideoFrameCB; |
| - void set_consume_video_frame_callback(const ConsumeVideoFrameCB& callback) { |
| - consume_video_frame_callback_ = callback; |
| - } |
| + // Frames will be non-NULL yet may be end of stream frames. |
| + typedef base::Callback<void(scoped_refptr<VideoFrame>)> FrameReadyCB; |
|
acolwell GONE FROM CHROMIUM
2011/11/01 18:31:03
Rename to ReadCB or ReadCallback? This is just to
Ami GONE FROM CHROMIUM
2011/11/01 22:17:40
FWIW, we decided a long time ago to use *CB for th
scherkus (not reviewing)
2011/11/03 04:55:59
Renamed to ReadCB (I am fond of the shortness!) bu
|
| + virtual void Read(const FrameReadyCB& callback) = 0; |
| // Returns the natural width and height of decoded video in pixels. |
| // |
| @@ -191,19 +186,8 @@ class MEDIA_EXPORT VideoDecoder : public Filter { |
| virtual gfx::Size natural_size() = 0; |
| protected: |
| - // Executes the permanent callback to pass off decoded video. |
| - // |
| - // TODO(scherkus): name this ConsumeVideoFrame() once we fix the TODO in |
|
Ami GONE FROM CHROMIUM
2011/11/01 22:17:40
I, for one, welcome our new reduced-craxy overlord
|
| - // VideoDecodeEngine::EventHandler to remove ConsumeVideoFrame() from there. |
| - void VideoFrameReady(scoped_refptr<VideoFrame> frame) { |
| - consume_video_frame_callback_.Run(frame); |
| - } |
| - |
| VideoDecoder(); |
| virtual ~VideoDecoder(); |
| - |
| - private: |
| - ConsumeVideoFrameCB consume_video_frame_callback_; |
| }; |
| @@ -212,6 +196,8 @@ class MEDIA_EXPORT AudioDecoder : public Filter { |
| // Initialize a AudioDecoder with the given DemuxerStream, executing the |
| // callback upon completion. |
| // stats_callback is used to update global pipeline statistics. |
| + // |
| + // TODO(scherkus): switch to PipelineStatus callback. |
| virtual void Initialize(DemuxerStream* stream, const base::Closure& callback, |
| const StatisticsCallback& stats_callback) = 0; |