| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_ |
| 6 #define MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_ |
| 7 |
| 8 // FFmpeg types. |
| 9 // |
| 10 // TODO(ajwong): Try to cut the dependency on the FFmpeg types. |
| 11 struct AVFrame; |
| 12 struct AVStream; |
| 13 |
| 14 class Task; |
| 15 |
| 16 namespace media { |
| 17 |
| 18 class Buffer; |
| 19 |
| 20 class VideoDecodeEngine { |
| 21 public: |
| 22 enum State { |
| 23 kCreated, |
| 24 kNormal, |
| 25 kError, |
| 26 }; |
| 27 |
| 28 VideoDecodeEngine() {} |
| 29 virtual ~VideoDecodeEngine() {} |
| 30 |
| 31 // Initialized the engine. On successful Initialization, state() should |
| 32 // return kNormal. |
| 33 virtual void Initialize(AVStream* stream, Task* done_cb) = 0; |
| 34 |
| 35 // Decodes one frame of video with the given buffer. Returns false if there |
| 36 // was a decode error, or a zero-byte frame was produced. |
| 37 // |
| 38 // TODO(ajwong): Should this function just allocate a new yuv_frame and return |
| 39 // it via a "GetNextFrame()" method or similar? |
| 40 virtual void DecodeFrame(const Buffer& buffer, AVFrame* yuv_frame, |
| 41 bool* got_result, Task* done_cb) = 0; |
| 42 |
| 43 // Flushes the decode engine of any buffered input packets. |
| 44 virtual void Flush(Task* done_cb) = 0; |
| 45 |
| 46 // Returns the VideoSurface::Format of the resulting |yuv_frame| from |
| 47 // DecodeFrame(). |
| 48 virtual VideoSurface::Format GetSurfaceFormat() const = 0; |
| 49 |
| 50 // Returns the current state of the decode engine. |
| 51 virtual State state() const = 0; |
| 52 |
| 53 }; |
| 54 |
| 55 } // namespace media |
| 56 |
| 57 #endif // MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_ |
| OLD | NEW |