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_channel.cc | |
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_channel.cc')
-rw-r--r-- | chrome/gpu/gpu_channel.cc | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/chrome/gpu/gpu_channel.cc b/chrome/gpu/gpu_channel.cc index 69c66d4..a63faa9 100644 --- a/chrome/gpu/gpu_channel.cc +++ b/chrome/gpu/gpu_channel.cc @@ -17,6 +17,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/gpu_messages.h" #include "chrome/gpu/gpu_thread.h" +#include "chrome/gpu/gpu_video_service.h" #if defined(OS_POSIX) #include "ipc/ipc_channel_posix.h" @@ -88,6 +89,12 @@ void GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { OnCreateOffscreenCommandBuffer) IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer, OnDestroyCommandBuffer) + IPC_MESSAGE_HANDLER(GpuChannelMsg_GetVideoService, + OnGetVideoService) + IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateVideoDecoder, + OnCreateVideoDecoder) + IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyVideoDecoder, + OnDestroyVideoDecoder) IPC_MESSAGE_UNHANDLED_ERROR() IPC_END_MESSAGE_MAP() } @@ -178,6 +185,50 @@ void GpuChannel::OnDestroyCommandBuffer(int32 route_id) { #endif } +void GpuChannel::OnGetVideoService(GpuVideoServiceInfoParam* info) { + info->service_available_ = 0; +#if defined(ENABLE_GPU) +#if defined(OS_WIN) + // TODO(jiesun): Not every windows platforms will support our media + // foundation implementation. Add more check here. + LOG(INFO) << "GpuChannel::OnGetVideoService"; + GpuVideoService* service = GpuVideoService::get(); + if (service == NULL) + return; + + info->video_service_host_route_id_ = GenerateRouteID(); + info->video_service_route_id_ = GenerateRouteID(); + // TODO(jiesun): we could had multiple entries in this routing table. + router_.AddRoute(info->video_service_route_id_, service); + info->service_available_ = 1; +#endif +#endif +} + +void GpuChannel::OnCreateVideoDecoder(GpuVideoDecoderInfoParam* info) { +#if defined(ENABLE_GPU) + LOG(INFO) << "GpuChannel::OnCreateVideoDecoder"; + info->decoder_id_ = -1; + GpuVideoService* service = GpuVideoService::get(); + if (service == NULL) + return; + + info->decoder_host_route_id_ = GenerateRouteID(); + info->decoder_route_id_ = GenerateRouteID(); + service->CreateVideoDecoder(this, &router_, info); +#endif +} + +void GpuChannel::OnDestroyVideoDecoder(int32 decoder_id) { +#if defined(ENABLE_GPU) + LOG(ERROR) << "GpuChannel::OnDestroyVideoDecoder"; + GpuVideoService* service = GpuVideoService::get(); + if (service == NULL) + return; + service->DestroyVideoDecoder(&router_, decoder_id); +#endif +} + bool GpuChannel::Init() { // Check whether we're already initialized. if (channel_.get()) @@ -198,6 +249,7 @@ bool GpuChannel::Init() { channel_name, IPC::Channel::MODE_SERVER, this, NULL, ChildProcess::current()->io_message_loop(), false, ChildProcess::current()->GetShutDownEvent())); + return true; } |