diff options
author | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-07 19:48:17 +0000 |
---|---|---|
committer | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-07 19:48:17 +0000 |
commit | a13da24116e78e759c17ca410e2a7fd39f66c280 (patch) | |
tree | e2ad91811cbe823a4ab18aa988c9a4f655842d94 /content/renderer | |
parent | 0385fc680515fe21df6fc1cbb091e7a041230368 (diff) | |
download | chromium_src-a13da24116e78e759c17ca410e2a7fd39f66c280.zip chromium_src-a13da24116e78e759c17ca410e2a7fd39f66c280.tar.gz chromium_src-a13da24116e78e759c17ca410e2a7fd39f66c280.tar.bz2 |
Delete GpuVideoService and move GpuVideoDecodeAccelerator ownership to stubs
This CL divvies up the GpuVideoService functionality among the relevant
classes.
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/7292010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91742 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r-- | content/renderer/gpu/gpu_video_decode_accelerator_host.cc | 33 | ||||
-rw-r--r-- | content/renderer/gpu/gpu_video_decode_accelerator_host.h | 4 | ||||
-rw-r--r-- | content/renderer/gpu/gpu_video_service_host.cc | 1 |
3 files changed, 10 insertions, 28 deletions
diff --git a/content/renderer/gpu/gpu_video_decode_accelerator_host.cc b/content/renderer/gpu/gpu_video_decode_accelerator_host.cc index 6aed720..1184fad 100644 --- a/content/renderer/gpu/gpu_video_decode_accelerator_host.cc +++ b/content/renderer/gpu/gpu_video_decode_accelerator_host.cc @@ -30,7 +30,6 @@ GpuVideoDecodeAcceleratorHost::GpuVideoDecodeAcceleratorHost( : router_(router), ipc_sender_(ipc_sender), decoder_host_id_(decoder_host_id), - decoder_id_(-1), command_buffer_route_id_(command_buffer_route_id), cmd_buffer_helper_(cmd_buffer_helper), client_(client) { @@ -55,8 +54,6 @@ bool GpuVideoDecodeAcceleratorHost::OnMessageReceived(const IPC::Message& msg) { OnBitstreamBufferProcessed) IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers, OnProvidePictureBuffer) - IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_CreateDone, - OnCreateDone) IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_InitializeDone, OnInitializeDone) IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_PictureReady, @@ -98,11 +95,9 @@ bool GpuVideoDecodeAcceleratorHost::Initialize( DCHECK(CalledOnValidThread()); router_->AddRoute(decoder_host_id_, this); - // Temporarily save configs for after create is done and we're - // ready to initialize. - configs_ = configs; - if (!ipc_sender_->Send(new GpuChannelMsg_CreateVideoDecoder( - decoder_host_id_, command_buffer_route_id_, configs))) { + // Tell GPU Channel to create and initialize a video decoder. + if (!ipc_sender_->Send(new GpuCommandBufferMsg_CreateVideoDecoder( + command_buffer_route_id_, decoder_host_id_, configs))) { LOG(ERROR) << "Send(GpuChannelMsg_CreateVideoDecoder) failed"; return false; } @@ -113,7 +108,7 @@ void GpuVideoDecodeAcceleratorHost::Decode( const media::BitstreamBuffer& bitstream_buffer) { DCHECK(CalledOnValidThread()); if (!ipc_sender_->Send(new AcceleratedVideoDecoderMsg_Decode( - decoder_id_, SyncTokens(), bitstream_buffer.handle(), + command_buffer_route_id_, SyncTokens(), bitstream_buffer.handle(), bitstream_buffer.id(), bitstream_buffer.size()))) { DLOG(ERROR) << "Send(AcceleratedVideoDecoderMsg_Decode) failed"; // TODO(fischman/vrk): signal error to client. @@ -134,8 +129,9 @@ void GpuVideoDecodeAcceleratorHost::AssignGLESBuffers( buffer_ids.push_back(buffer.id()); sizes.push_back(buffer.size()); } - if (!ipc_sender_->Send(new AcceleratedVideoDecoderMsg_AssignTextures( - decoder_id_, SyncTokens(), buffer_ids, texture_ids, sizes))) { + if (!ipc_sender_->Send(new AcceleratedVideoDecoderMsg_AssignGLESBuffers( + command_buffer_route_id_, SyncTokens(), buffer_ids, texture_ids, + sizes))) { LOG(ERROR) << "Send(AcceleratedVideoDecoderMsg_AssignGLESBuffers) failed"; } } @@ -151,7 +147,7 @@ void GpuVideoDecodeAcceleratorHost::ReusePictureBuffer( int32 picture_buffer_id) { DCHECK(CalledOnValidThread()); if (!ipc_sender_->Send(new AcceleratedVideoDecoderMsg_ReusePictureBuffer( - decoder_id_, SyncTokens(), picture_buffer_id))) { + command_buffer_route_id_, SyncTokens(), picture_buffer_id))) { LOG(ERROR) << "Send(AcceleratedVideoDecoderMsg_ReusePictureBuffer) failed"; } } @@ -159,7 +155,7 @@ void GpuVideoDecodeAcceleratorHost::ReusePictureBuffer( void GpuVideoDecodeAcceleratorHost::Flush() { DCHECK(CalledOnValidThread()); if (!ipc_sender_->Send(new AcceleratedVideoDecoderMsg_Flush( - decoder_id_, SyncTokens()))) { + command_buffer_route_id_, SyncTokens()))) { LOG(ERROR) << "Send(AcceleratedVideoDecoderMsg_Flush) failed"; // TODO(fischman/vrk): signal error to client. return; @@ -169,7 +165,7 @@ void GpuVideoDecodeAcceleratorHost::Flush() { void GpuVideoDecodeAcceleratorHost::Abort() { DCHECK(CalledOnValidThread()); if (!ipc_sender_->Send(new AcceleratedVideoDecoderMsg_Abort( - decoder_id_, SyncTokens()))) { + command_buffer_route_id_, SyncTokens()))) { LOG(ERROR) << "Send(AcceleratedVideoDecoderMsg_Abort) failed"; // TODO(fischman/vrk): signal error to client. return; @@ -199,15 +195,6 @@ void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer( client_->DismissPictureBuffer(picture_buffer_id); } -void GpuVideoDecodeAcceleratorHost::OnCreateDone(int32 decoder_id) { - DCHECK(CalledOnValidThread()); - decoder_id_ = decoder_id; - if (!ipc_sender_->Send(new AcceleratedVideoDecoderMsg_Initialize( - decoder_id_, SyncTokens(), configs_))) { - LOG(ERROR) << "Send(AcceleratedVideoDecoderMsg_Initialize) failed"; - } -} - void GpuVideoDecodeAcceleratorHost::OnInitializeDone() { DCHECK(CalledOnValidThread()); client_->NotifyInitializeDone(); diff --git a/content/renderer/gpu/gpu_video_decode_accelerator_host.h b/content/renderer/gpu/gpu_video_decode_accelerator_host.h index 9012168..9c2d93b 100644 --- a/content/renderer/gpu/gpu_video_decode_accelerator_host.h +++ b/content/renderer/gpu/gpu_video_decode_accelerator_host.h @@ -65,7 +65,6 @@ class GpuVideoDecodeAcceleratorHost void OnProvidePictureBuffer( uint32 num_requested_buffers, const gfx::Size& buffer_size, int32 mem_type); void OnDismissPictureBuffer(int32 picture_buffer_id); - void OnCreateDone(int32 decoder_id); void OnInitializeDone(); void OnPictureReady(int32 picture_buffer_id, int32 bitstream_buffer_id, @@ -103,9 +102,6 @@ class GpuVideoDecodeAcceleratorHost // message processing behind it. gpu::CommandBufferHelper* cmd_buffer_helper_; - // Temporarily store configs here in between Create and Initialize phase. - std::vector<uint32> configs_; - // Reference to the client that will receive callbacks from the decoder. media::VideoDecodeAccelerator::Client* client_; diff --git a/content/renderer/gpu/gpu_video_service_host.cc b/content/renderer/gpu/gpu_video_service_host.cc index 2a39476..12309be 100644 --- a/content/renderer/gpu/gpu_video_service_host.cc +++ b/content/renderer/gpu/gpu_video_service_host.cc @@ -34,7 +34,6 @@ bool GpuVideoServiceHost::OnMessageReceived(const IPC::Message& msg) { switch (msg.type()) { case AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed::ID: case AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers::ID: - case AcceleratedVideoDecoderHostMsg_CreateDone::ID: case AcceleratedVideoDecoderHostMsg_InitializeDone::ID: case AcceleratedVideoDecoderHostMsg_DismissPictureBuffer::ID: case AcceleratedVideoDecoderHostMsg_PictureReady::ID: |