| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_ | 5 #ifndef MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_ |
| 6 #define MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_ | 6 #define MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_ |
| 7 | 7 |
| 8 #include "media/base/video_frame.h" | 8 #include "media/base/video_frame.h" |
| 9 | 9 |
| 10 // FFmpeg types. | 10 // FFmpeg types. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // Initialized the engine. On successful Initialization, state() should | 34 // Initialized the engine. On successful Initialization, state() should |
| 35 // return kNormal. | 35 // return kNormal. |
| 36 virtual void Initialize(AVStream* stream, Task* done_cb) = 0; | 36 virtual void Initialize(AVStream* stream, Task* done_cb) = 0; |
| 37 | 37 |
| 38 // Decodes one frame of video with the given buffer. Returns false if there | 38 // Decodes one frame of video with the given buffer. Returns false if there |
| 39 // was a decode error, or a zero-byte frame was produced. | 39 // was a decode error, or a zero-byte frame was produced. |
| 40 // | 40 // |
| 41 // TODO(ajwong): Should this function just allocate a new yuv_frame and return | 41 // TODO(ajwong): Should this function just allocate a new yuv_frame and return |
| 42 // it via a "GetNextFrame()" method or similar? | 42 // it via a "GetNextFrame()" method or similar? |
| 43 virtual void DecodeFrame(Buffer* buffer, AVFrame* yuv_frame, | 43 virtual void DecodeFrame(Buffer* buffer, |
| 44 scoped_refptr<VideoFrame>* video_frame, |
| 44 bool* got_result, Task* done_cb) = 0; | 45 bool* got_result, Task* done_cb) = 0; |
| 45 | 46 |
| 46 // Flushes the decode engine of any buffered input packets. | 47 // Flushes the decode engine of any buffered input packets. |
| 47 virtual void Flush(Task* done_cb) = 0; | 48 virtual void Flush(Task* done_cb) = 0; |
| 48 | 49 |
| 49 // Returns the VideoSurface::Format of the resulting |yuv_frame| from | 50 // Returns the VideoSurface::Format of the resulting |yuv_frame| from |
| 50 // DecodeFrame(). | 51 // DecodeFrame(). |
| 51 virtual VideoFrame::Format GetSurfaceFormat() const = 0; | 52 virtual VideoFrame::Format GetSurfaceFormat() const = 0; |
| 52 | 53 |
| 53 // Returns the current state of the decode engine. | 54 // Returns the current state of the decode engine. |
| 54 virtual State state() const = 0; | 55 virtual State state() const = 0; |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 } // namespace media | 58 } // namespace media |
| 58 | 59 |
| 59 #endif // MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_ | 60 #endif // MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_ |
| OLD | NEW |