Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: media/filters/video_decode_engine.h

Issue 465044: Refactor FFmpegVideoDecoder to try and generalize code common to all video decoders. (Closed)
Patch Set: Fix SCOPED_TRACE since VS faults on %zd. Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698