diff options
author | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-10 01:05:41 +0000 |
---|---|---|
committer | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-10 01:05:41 +0000 |
commit | ee68378a4c92a66b80288a42e584dbd9b4e89619 (patch) | |
tree | 866beac2a4023529ade2e91c39d2d7f6312e7db3 /chrome/gpu/gpu_video_decoder.h | |
parent | b2df464d2783521f8fabbbe76f74a4129dd8417e (diff) | |
download | chromium_src-ee68378a4c92a66b80288a42e584dbd9b4e89619.zip chromium_src-ee68378a4c92a66b80288a42e584dbd9b4e89619.tar.gz chromium_src-ee68378a4c92a66b80288a42e584dbd9b4e89619.tar.bz2 |
1. ipc_video_decoder.cc/h is media pipeline filter which use the gpu decoder facilities in video stack. it is only enabled when (a) hardware composition is on (b) hardware decoding command line is on (c) h264 codec is specified.
2. gpu_video_service.cc/h is a singleton in gpu process which provide video services for renderer process, through it we could create decoder. ( in my imagination, in the future, we could create encoder or capturer too)
3. gpu_video_decoder.cc/h. abstract interface for hardware decoder.
4. gpu_video_service_host.cc/h is singleton in renderer process which provide proxy for gpu_video_service.
5. gpu_video_decoder_host.cc/h is proxy for gpu_video_decoder. (1 to 1 map).basically there is one global GpuVideoService in GPU process, one GpuVideoServiceHost in Renderer process. for each renderer process, there are could be multiple renderer view, each could had multiple GpuVideoDecoderHost the connect to GpuVideoDeocder through GPUCHannelHOst/GpuChannel.
6. gpu_video_common.cc/h: IPC message definition and pickle/marshaling support.
ISSUES:
1. in media pipeline, we need let decoder to determine if bit stream filter should be used instead of let command line to determine it.
2. stop readback from D3D surface use ANGLE.
3. Flush logic still need fine tuning.
4. CreateThread in GpuVideoDecoder, and post message in message handler, and derived classs handle message loop. ?
5. Error handling.
6. Input ring buffer implementation. Current impl is naive.
7.Add output queue for MFT decoder.
8. Query Capabilities at GetVideoServices()...
BUG=None
TEST=Windows7
Review URL: http://codereview.chromium.org/2873089
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu/gpu_video_decoder.h')
-rw-r--r-- | chrome/gpu/gpu_video_decoder.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/chrome/gpu/gpu_video_decoder.h b/chrome/gpu/gpu_video_decoder.h new file mode 100644 index 0000000..62170fe --- /dev/null +++ b/chrome/gpu/gpu_video_decoder.h @@ -0,0 +1,76 @@ +// 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 CHROME_GPU_GPU_VIDEO_DECODER_H_ +#define CHROME_GPU_GPU_VIDEO_DECODER_H_ + +#include "base/basictypes.h" +#include "base/callback.h" +#include "base/ref_counted.h" +#include "base/scoped_ptr.h" +#include "chrome/common/gpu_video_common.h" +#include "ipc/ipc_channel.h" + +class GpuChannel; + +class GpuVideoDecoder + : public IPC::Channel::Listener, + public base::RefCountedThreadSafe<GpuVideoDecoder> { + + public: + // IPC::Channel::Listener. + virtual void OnChannelConnected(int32 peer_pid); + virtual void OnChannelError(); + virtual void OnMessageReceived(const IPC::Message& message); + + virtual bool DoInitialize(const GpuVideoDecoderInitParam& init_param, + GpuVideoDecoderInitDoneParam* done_param) = 0; + virtual bool DoUninitialize() = 0; + virtual void DoFlush() = 0; + virtual void DoEmptyThisBuffer( + const GpuVideoDecoderInputBufferParam& buffer) = 0; + virtual void DoFillThisBuffer( + const GpuVideoDecoderOutputBufferParam& frame) = 0; + virtual void DoFillThisBufferDoneACK() = 0; + + GpuVideoDecoder(const GpuVideoDecoderInfoParam* param, + GpuChannel* channel_, + base::ProcessHandle handle); + virtual ~GpuVideoDecoder() {} + + protected: + // Output message helper. + void SendInitializeDone(const GpuVideoDecoderInitDoneParam& param); + void SendUninitializeDone(); + void SendFlushDone(); + void SendEmptyBufferDone(); + void SendEmptyBufferACK(); + void SendFillBufferDone(const GpuVideoDecoderOutputBufferParam& frame); + + int32 route_id() { return decoder_host_route_id_; } + + int32 decoder_host_route_id_; + GpuChannel* channel_; + base::ProcessHandle renderer_handle_; + + GpuVideoDecoderInitParam init_param_; + GpuVideoDecoderInitDoneParam done_param_; + + scoped_ptr<base::SharedMemory> input_transfer_buffer_; + scoped_ptr<base::SharedMemory> output_transfer_buffer_; + + private: + // Input message handler. + void OnInitialize(const GpuVideoDecoderInitParam& param); + void OnUninitialize(); + void OnFlush(); + void OnEmptyThisBuffer(const GpuVideoDecoderInputBufferParam& buffer); + void OnFillThisBuffer(const GpuVideoDecoderOutputBufferParam& frame); + void OnFillThisBufferDoneACK(); + + DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); +}; + +#endif // CHROME_GPU_GPU_VIDEO_DECODER_H_ + |