OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/common/gpu_messages.h" |
| 6 #include "chrome/gpu/gpu_channel.h" |
| 7 #include "chrome/gpu/gpu_video_decoder.h" |
| 8 |
| 9 void GpuVideoDecoder::OnChannelConnected(int32 peer_pid) { |
| 10 } |
| 11 |
| 12 void GpuVideoDecoder::OnChannelError() { |
| 13 } |
| 14 |
| 15 void GpuVideoDecoder::OnMessageReceived(const IPC::Message& msg) { |
| 16 IPC_BEGIN_MESSAGE_MAP(GpuVideoDecoder, msg) |
| 17 IPC_MESSAGE_HANDLER(GpuVideoDecoderMsg_Initialize, |
| 18 OnInitialize) |
| 19 IPC_MESSAGE_HANDLER(GpuVideoDecoderMsg_Destroy, |
| 20 OnUninitialize) |
| 21 IPC_MESSAGE_HANDLER(GpuVideoDecoderMsg_Flush, |
| 22 OnFlush) |
| 23 IPC_MESSAGE_HANDLER(GpuVideoDecoderMsg_EmptyThisBuffer, |
| 24 OnEmptyThisBuffer) |
| 25 IPC_MESSAGE_HANDLER(GpuVideoDecoderMsg_FillThisBuffer, |
| 26 OnFillThisBuffer) |
| 27 IPC_MESSAGE_HANDLER(GpuVideoDecoderMsg_FillThisBufferDoneACK, |
| 28 OnFillThisBufferDoneACK) |
| 29 IPC_MESSAGE_UNHANDLED_ERROR() |
| 30 IPC_END_MESSAGE_MAP() |
| 31 } |
| 32 |
| 33 GpuVideoDecoder::GpuVideoDecoder( |
| 34 const GpuVideoDecoderInfoParam* param, |
| 35 GpuChannel* channel, |
| 36 base::ProcessHandle handle) |
| 37 : decoder_host_route_id_(param->decoder_host_route_id_), |
| 38 channel_(channel), renderer_handle_(handle) { |
| 39 } |
| 40 |
| 41 void GpuVideoDecoder::OnInitialize(const GpuVideoDecoderInitParam& param) { |
| 42 init_param_ = param; |
| 43 done_param_.success_ = DoInitialize(init_param_, &done_param_); |
| 44 } |
| 45 |
| 46 void GpuVideoDecoder::OnUninitialize() { |
| 47 DoUninitialize(); |
| 48 } |
| 49 |
| 50 void GpuVideoDecoder::OnFlush() { |
| 51 DoFlush(); |
| 52 } |
| 53 |
| 54 void GpuVideoDecoder::OnEmptyThisBuffer( |
| 55 const GpuVideoDecoderInputBufferParam& buffer) { |
| 56 DoEmptyThisBuffer(buffer); |
| 57 } |
| 58 void GpuVideoDecoder::OnFillThisBuffer( |
| 59 const GpuVideoDecoderOutputBufferParam& frame) { |
| 60 DoFillThisBuffer(frame); |
| 61 } |
| 62 |
| 63 void GpuVideoDecoder::OnFillThisBufferDoneACK() { |
| 64 DoFillThisBufferDoneACK(); |
| 65 } |
| 66 |
| 67 void GpuVideoDecoder::SendInitializeDone( |
| 68 const GpuVideoDecoderInitDoneParam& param) { |
| 69 if (!channel_->Send( |
| 70 new GpuVideoDecoderHostMsg_InitializeACK(route_id(), param))) { |
| 71 LOG(ERROR) << "GpuVideoDecoderMsg_InitializeACK failed"; |
| 72 } |
| 73 } |
| 74 |
| 75 void GpuVideoDecoder::SendUninitializeDone() { |
| 76 if (!channel_->Send(new GpuVideoDecoderHostMsg_DestroyACK(route_id()))) { |
| 77 LOG(ERROR) << "GpuVideoDecoderMsg_DestroyACK failed"; |
| 78 } |
| 79 } |
| 80 |
| 81 void GpuVideoDecoder::SendFlushDone() { |
| 82 if (!channel_->Send(new GpuVideoDecoderHostMsg_FlushACK(route_id()))) { |
| 83 LOG(ERROR) << "GpuVideoDecoderMsg_FlushACK failed"; |
| 84 } |
| 85 } |
| 86 |
| 87 void GpuVideoDecoder::SendEmptyBufferDone() { |
| 88 if (!channel_->Send( |
| 89 new GpuVideoDecoderHostMsg_EmptyThisBufferDone(route_id()))) { |
| 90 LOG(ERROR) << "GpuVideoDecoderMsg_EmptyThisBufferDone failed"; |
| 91 } |
| 92 } |
| 93 |
| 94 void GpuVideoDecoder::SendEmptyBufferACK() { |
| 95 if (!channel_->Send( |
| 96 new GpuVideoDecoderHostMsg_EmptyThisBufferACK(route_id()))) { |
| 97 LOG(ERROR) << "GpuVideoDecoderMsg_EmptyThisBufferACK failed"; |
| 98 } |
| 99 } |
| 100 |
| 101 void GpuVideoDecoder::SendFillBufferDone( |
| 102 const GpuVideoDecoderOutputBufferParam& frame) { |
| 103 if (!channel_->Send( |
| 104 new GpuVideoDecoderHostMsg_FillThisBufferDone(route_id(), frame))) { |
| 105 LOG(ERROR) << "GpuVideoDecoderMsg_FillThisBufferDone failed"; |
| 106 } |
| 107 } |
| 108 |
OLD | NEW |