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

Unified Diff: media/video/video_decode_context.h

Issue 3233003: Add a VideoDecodeContext that provides resources for a VideoDecodeEngine (Closed)
Patch Set: updated API Created 10 years, 4 months 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 | « chrome/renderer/render_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/video_decode_context.h
diff --git a/media/video/video_decode_context.h b/media/video/video_decode_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..0bea38220e3f28a972ed2ec8731f4d759f513682
--- /dev/null
+++ b/media/video/video_decode_context.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2010 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_VIDEO_VIDEO_DECODE_CONTEXT_H_
+#define MEDIA_VIDEO_VIDEO_DECODE_CONTEXT_H_
+
+#include "base/callback.h"
+
+namespace media {
+
+class VideoFrame;
+
+// A VideoDecodeContext provides resources like output video frame storage and
+// hardware decoder handle to a VideoDecodeEngine, it hides all the platform and
+// subsystem details from the decode engine.
+class VideoDecodeContext {
+ public:
+ typedef Callback2<int, VideoFrame*[]>::Type AllocationCompleteCallback;
+ typedef Callback0::Type DestructionCompleteCallback;
+
+ virtual ~VideoDecodeContext() {};
+
+ // Obtain a handle to the hardware video decoder device. The type of the
+ // handle is a contract between the implementation of VideoDecodeContext and
+ // VideoDecodeEngine.
+ //
+ // If a hardware device is not needed this method should return NULL.
+ virtual void* GetDevice() = 0;
+
+ // Allocate |n| video frames with dimension |width| and |height|. |callback|
+ // is called when allocation has completed.
+ virtual void AllocateVideoFrames(int n, size_t width, size_t height,
+ AllocationCompleteCallback* callback) = 0;
+
+ // Release video frames allocated by the context. After making this call
+ // VideoDecodeEngine should not use the VideoFrame allocated because they
+ // could be destroyed.
+ virtual void ReleaseVideoFrames(int n, VideoFrame* frames) = 0;
scherkus (not reviewing) 2010/09/03 17:50:14 this is still a bit clumsy so AllocateVideoFrames
+
+ // Destroy this context asynchronously. When the operation is done |callback|
+ // is called.
+ //
+ // ReleaseVideoFrames() need to be called with all the video frames allocated
+ // before making this call.
+ virtual void Destroy(DestructionCompleteCallback* callback) = 0;
+};
+
+} // namespace media
+
+#endif // MEDIA_VIDEO_VIDEO_DECODE_CONTEXT_H_
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698