Chromium Code Reviews| Index: media/base/video_decoder.h |
| diff --git a/media/base/video_decoder.h b/media/base/video_decoder.h |
| index 226b7b2f01f6e4ac4e2f9fd5a6e35b00476f37f5..7dfc9bd6176069bafbb40667a9f8d31118698cd8 100644 |
| --- a/media/base/video_decoder.h |
| +++ b/media/base/video_decoder.h |
| @@ -25,11 +25,16 @@ class MEDIA_EXPORT VideoDecoder { |
| enum Status { |
| kOk, // Everything went as planned. |
| kAborted, // Decode was aborted as a result of Reset() being called. |
| - kNotEnoughData, // Not enough data to produce a video frame. |
| kDecodeError, // Decoding error happened. |
| kDecryptError // Decrypting error happened. |
| }; |
| + // Callback to return decode frames. |
| + typedef base::Callback<void(const scoped_refptr<VideoFrame>&)> OutputCB; |
| + |
| + // Callback type for Decode(). |
| + typedef base::Callback<void(Status status)> DecodeCB; |
| + |
| VideoDecoder(); |
| virtual ~VideoDecoder(); |
| @@ -44,7 +49,8 @@ class MEDIA_EXPORT VideoDecoder { |
| // |status_cb| is executed. |
| virtual void Initialize(const VideoDecoderConfig& config, |
| bool low_delay, |
| - const PipelineStatusCB& status_cb) = 0; |
| + const PipelineStatusCB& status_cb, |
| + const OutputCB& output_cb) = 0; |
| // Requests a |buffer| to be decoded. The status of the decoder and decoded |
| // frame are returned via the provided callback. Some decoders may allow |
| @@ -62,18 +68,9 @@ class MEDIA_EXPORT VideoDecoder { |
| // - Non-EOS (end of stream) frame contains decoded video data. |
| // - EOS frame indicates the end of the stream. |
| // Otherwise the returned frame must be NULL. |
|
xhwang
2014/05/29 22:15:14
This whole comment block needs to be updated.
Sergey Ulanov
2014/06/03 00:08:11
Done.
|
| - typedef base::Callback<void(Status, |
| - const scoped_refptr<VideoFrame>&)> DecodeCB; |
| virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
| const DecodeCB& decode_cb) = 0; |
| - // Some VideoDecoders may queue up multiple VideoFrames from a single |
| - // DecoderBuffer, if we have any such queued frames this will return the next |
| - // one. Otherwise we return a NULL VideoFrame. |
| - // |
| - // TODO(xhwang): Revisit this method. |
| - virtual scoped_refptr<VideoFrame> GetDecodeOutput(); |
| - |
| // Resets decoder state, fulfilling all pending DecodeCB and dropping extra |
| // queued decoded data. After this call, the decoder is back to an initialized |
| // clean state. |