diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 02:23:31 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 02:23:31 +0000 |
commit | f37619e85e12e0692fe106e1f6b3a8ac6267fc74 (patch) | |
tree | bc9b9737feaea32c90d3e137c787ce7661b43e77 /chrome/gpu/gpu_video_decoder.h | |
parent | 91bfaaef281c73e3792a3c96df37920c8a5370a5 (diff) | |
download | chromium_src-f37619e85e12e0692fe106e1f6b3a8ac6267fc74.zip chromium_src-f37619e85e12e0692fe106e1f6b3a8ac6267fc74.tar.gz chromium_src-f37619e85e12e0692fe106e1f6b3a8ac6267fc74.tar.bz2 |
Implement video frame exchange in GpuVideoDecoder and tests
Implement ProduceVideoFrame() in GpuVideoDecoder and unit tests for testing
the loginc in GpuVideoDecoder.
BUG=53714
TEST=unit_tests --gtest_filter=GpuVideoDecoder*
Review URL: http://codereview.chromium.org/3414003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu/gpu_video_decoder.h')
-rw-r--r-- | chrome/gpu/gpu_video_decoder.h | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/chrome/gpu/gpu_video_decoder.h b/chrome/gpu/gpu_video_decoder.h index d4c9b09..f975eb8 100644 --- a/chrome/gpu/gpu_video_decoder.h +++ b/chrome/gpu/gpu_video_decoder.h @@ -90,8 +90,15 @@ class GpuVideoDecoder public IPC::Channel::Listener, public media::VideoDecodeEngine::EventHandler, public media::VideoDecodeContext { - public: + // Constructor and destructor. + GpuVideoDecoder(MessageLoop* message_loop, + const GpuVideoDecoderInfoParam* param, + IPC::Message::Sender* sender, + base::ProcessHandle handle, + gpu::gles2::GLES2Decoder* decoder); + virtual ~GpuVideoDecoder() {} + // IPC::Channel::Listener implementation. virtual void OnChannelConnected(int32 peer_pid); virtual void OnChannelError(); @@ -118,12 +125,9 @@ class GpuVideoDecoder Task* task); virtual void Destroy(Task* task); - // Constructor and destructor. - GpuVideoDecoder(const GpuVideoDecoderInfoParam* param, - GpuChannel* channel_, - base::ProcessHandle handle, - gpu::gles2::GLES2Decoder* decoder); - virtual ~GpuVideoDecoder() {} + // These methods are used in unit test only. + void SetVideoDecodeEngine(media::VideoDecodeEngine* engine); + void SetGpuVideoDevice(GpuVideoDevice* device); private: struct PendingAllocation { @@ -146,8 +150,7 @@ class GpuVideoDecoder void OnUninitialize(); void OnFlush(); void OnEmptyThisBuffer(const GpuVideoDecoderInputBufferParam& buffer); - void OnFillThisBuffer(const GpuVideoDecoderOutputBufferParam& param); - void OnFillThisBufferDoneACK(); + void OnProduceVideoFrame(int32 frame_id); void OnVideoFrameAllocated(int32 frame_id, std::vector<uint32> textures); // Helper methods for sending messages to the Renderer process. @@ -156,18 +159,21 @@ class GpuVideoDecoder void SendFlushDone(); void SendEmptyBufferDone(); void SendEmptyBufferACK(); - void SendFillBufferDone(const GpuVideoDecoderOutputBufferParam& param); + void SendConsumeVideoFrame(int32 frame_id, int64 timestamp, int64 duration, + int32 flags); void SendAllocateVideoFrames( int n, size_t width, size_t height, media::VideoFrame::Format format); void SendReleaseAllVideoFrames(); + // The message loop that this object should run on. + MessageLoop* message_loop_; + int32 decoder_host_route_id_; // Used only in system memory path. i.e. Remove this later. scoped_refptr<VideoFrame> frame_; - int32 pending_output_requests_; - GpuChannel* channel_; + IPC::Message::Sender* sender_; base::ProcessHandle renderer_handle_; // The GLES2 decoder has the context associated with this decoder. This object @@ -189,6 +195,7 @@ class GpuVideoDecoder // Contains the mapping between a |frame_id| and VideoFrame generated by // GpuVideoDevice from the associated GL textures. + // TODO(hclam): Using a faster data structure than map. typedef std::map<int32, scoped_refptr<media::VideoFrame> > VideoFrameMap; VideoFrameMap video_frame_map_; |