summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authormlloyd@chromium.org <mlloyd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 14:19:15 +0000
committermlloyd@chromium.org <mlloyd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 14:19:15 +0000
commitdc95389fc803581de77c7fb617b1ef4870c9cbd5 (patch)
treeec919d1254ff839c690af9e8327e362bff0a9bac /media
parent425bbb99f4faa4bdf90d9bca09174baa467aeaae (diff)
downloadchromium_src-dc95389fc803581de77c7fb617b1ef4870c9cbd5.zip
chromium_src-dc95389fc803581de77c7fb617b1ef4870c9cbd5.tar.gz
chromium_src-dc95389fc803581de77c7fb617b1ef4870c9cbd5.tar.bz2
Revert 59784 - GpuVideoDecoder to use GpuVideoDevice and IPC messages to complete VideoFrame allocation
GpuVideoDecedoer now sends IPC messages to allocation GL textures. It also uses GpuVideoDevice to create VideoFrames from the GL textures. These GL textures are passed into VideoDecodeEngine. BUG=53714 TEST=Tree is green Review URL: http://codereview.chromium.org/3335019 TBR=hclam@chromium.org Review URL: http://codereview.chromium.org/3451007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/video/video_decode_context.h35
1 files changed, 14 insertions, 21 deletions
diff --git a/media/video/video_decode_context.h b/media/video/video_decode_context.h
index 795b136..0bea382 100644
--- a/media/video/video_decode_context.h
+++ b/media/video/video_decode_context.h
@@ -5,23 +5,20 @@
#ifndef MEDIA_VIDEO_VIDEO_DECODE_CONTEXT_H_
#define MEDIA_VIDEO_VIDEO_DECODE_CONTEXT_H_
-#include <vector>
-
-#include "base/task.h"
-#include "media/base/video_frame.h"
+#include "base/callback.h"
namespace media {
class VideoFrame;
-// A VideoDecodeContext is used by VideoDecodeEngine to provide the following
-// functions:
-//
-// 1. Provides access to hardware video decoding device.
-// 2. Allocate VideoFrame objects that are used to carry the decoded video
-// frames.
+// 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
@@ -31,26 +28,22 @@ class VideoDecodeContext {
// 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|. |task|
+ // Allocate |n| video frames with dimension |width| and |height|. |callback|
// is called when allocation has completed.
- //
- // |frames| is the output parameter for VideFrame(s) allocated.
- virtual void AllocateVideoFrames(
- int n, size_t width, size_t height, VideoFrame::Format format,
- std::vector<scoped_refptr<VideoFrame> >* frames,
- Task* task) = 0;
+ virtual void AllocateVideoFrames(int n, size_t width, size_t height,
+ AllocationCompleteCallback* callback) = 0;
- // Release all video frames allocated by the context. After making this call
+ // 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 ReleaseAllVideoFrames() = 0;
+ virtual void ReleaseVideoFrames(int n, VideoFrame* frames) = 0;
- // Destroy this context asynchronously. When the operation is done |task|
+ // 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(Task* task) = 0;
+ virtual void Destroy(DestructionCompleteCallback* callback) = 0;
};
} // namespace media