summaryrefslogtreecommitdiffstats
path: root/media/video
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 23:09:13 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 23:09:13 +0000
commit68c665ed1c84aa8373ffeb8905d3b61e126490db (patch)
tree0fbbed508bb8c2aa65ec7f9e8b69c26f25c030e8 /media/video
parente37397a176eac68e8b18b2708e4ee41e131af0bf (diff)
downloadchromium_src-68c665ed1c84aa8373ffeb8905d3b61e126490db.zip
chromium_src-68c665ed1c84aa8373ffeb8905d3b61e126490db.tar.gz
chromium_src-68c665ed1c84aa8373ffeb8905d3b61e126490db.tar.bz2
Add a VideoDecodeContext that provides resources for a VideoDecodeEngine
Also define a Gles2VideoDecodeContext to be used in the chrome renderer. BUG=53714 TEST=none Review URL: http://codereview.chromium.org/3233003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/video')
-rw-r--r--media/video/video_decode_context.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/media/video/video_decode_context.h b/media/video/video_decode_context.h
new file mode 100644
index 0000000..0bea382
--- /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;
+
+ // 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_