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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_decode_engine.h
diff --git a/media/filters/video_decode_engine.h b/media/filters/video_decode_engine.h
new file mode 100644
index 0000000000000000000000000000000000000000..f7db1944eb7212cfc6f57d5f8379f3c22708ae5a
--- /dev/null
+++ b/media/filters/video_decode_engine.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#ifndef MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_
+#define MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_
+
+// FFmpeg types.
+//
+// TODO(ajwong): Try to cut the dependency on the FFmpeg types.
+struct AVFrame;
+struct AVStream;
+
+class Task;
+
+namespace media {
+
+class Buffer;
+
+class VideoDecodeEngine {
+ public:
+ enum State {
+ kCreated,
+ kNormal,
+ kError,
+ };
+
+ VideoDecodeEngine() {}
+ virtual ~VideoDecodeEngine() {}
+
+ // Initialized the engine. On successful Initialization, state() should
+ // return kNormal.
+ virtual void Initialize(AVStream* stream, Task* done_cb) = 0;
+
+ // Decodes one frame of video with the given buffer. Returns false if there
+ // was a decode error, or a zero-byte frame was produced.
+ //
+ // TODO(ajwong): Should this function just allocate a new yuv_frame and return
+ // it via a "GetNextFrame()" method or similar?
+ virtual void DecodeFrame(const Buffer& buffer, AVFrame* yuv_frame,
+ bool* got_result, Task* done_cb) = 0;
+
+ // Flushes the decode engine of any buffered input packets.
+ virtual void Flush(Task* done_cb) = 0;
+
+ // Returns the VideoSurface::Format of the resulting |yuv_frame| from
+ // DecodeFrame().
+ virtual VideoSurface::Format GetSurfaceFormat() const = 0;
+
+ // Returns the current state of the decode engine.
+ virtual State state() const = 0;
+
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_VIDEO_DECODE_ENGINE_H_
« 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