diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-17 12:46:54 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-17 12:46:54 +0000 |
commit | 9b98f084607bc1e9185be7f29b52f1e4c0fa498d (patch) | |
tree | 1a742541920858a5cc1d1bb8399a218f53e73392 /media | |
parent | d63b5215c206da43ed352ff09459a0ba3622b727 (diff) | |
download | chromium_src-9b98f084607bc1e9185be7f29b52f1e4c0fa498d.zip chromium_src-9b98f084607bc1e9185be7f29b52f1e4c0fa498d.tar.gz chromium_src-9b98f084607bc1e9185be7f29b52f1e4c0fa498d.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/video/video_decode_context.h | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/media/video/video_decode_context.h b/media/video/video_decode_context.h index 0bea382..795b136 100644 --- a/media/video/video_decode_context.h +++ b/media/video/video_decode_context.h @@ -5,20 +5,23 @@ #ifndef MEDIA_VIDEO_VIDEO_DECODE_CONTEXT_H_ #define MEDIA_VIDEO_VIDEO_DECODE_CONTEXT_H_ -#include "base/callback.h" +#include <vector> + +#include "base/task.h" +#include "media/base/video_frame.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. +// 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. 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 @@ -28,22 +31,26 @@ 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|. |callback| + // Allocate |n| video frames with dimension |width| and |height|. |task| // is called when allocation has completed. - virtual void AllocateVideoFrames(int n, size_t width, size_t height, - AllocationCompleteCallback* callback) = 0; + // + // |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; - // Release video frames allocated by the context. After making this call + // Release all 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; + virtual void ReleaseAllVideoFrames() = 0; - // Destroy this context asynchronously. When the operation is done |callback| + // Destroy this context asynchronously. When the operation is done |task| // is called. // // ReleaseVideoFrames() need to be called with all the video frames allocated // before making this call. - virtual void Destroy(DestructionCompleteCallback* callback) = 0; + virtual void Destroy(Task* task) = 0; }; } // namespace media |