| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 void GpuVideoDecodeAccelerator::OnChannelConnected(int32 peer_pid) { | 104 void GpuVideoDecodeAccelerator::OnChannelConnected(int32 peer_pid) { |
| 105 // TODO(vmr): Do we have to react on channel connections? | 105 // TODO(vmr): Do we have to react on channel connections? |
| 106 } | 106 } |
| 107 | 107 |
| 108 void GpuVideoDecodeAccelerator::OnChannelError() { | 108 void GpuVideoDecodeAccelerator::OnChannelError() { |
| 109 // TODO(vmr): Do we have to react on channel errors? | 109 // TODO(vmr): Do we have to react on channel errors? |
| 110 } | 110 } |
| 111 | 111 |
| 112 void GpuVideoDecodeAccelerator::ProvidePictureBuffers( | 112 void GpuVideoDecodeAccelerator::ProvidePictureBuffers( |
| 113 uint32 requested_num_of_buffers, | 113 uint32 requested_num_of_buffers, const gfx::Size& dimensions) { |
| 114 const gfx::Size& dimensions, | |
| 115 media::VideoDecodeAccelerator::MemoryType type) { | |
| 116 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( | 114 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( |
| 117 host_route_id_, requested_num_of_buffers, dimensions, type))) { | 115 host_route_id_, requested_num_of_buffers, dimensions))) { |
| 118 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) " | 116 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) " |
| 119 << "failed"; | 117 << "failed"; |
| 120 } | 118 } |
| 121 } | 119 } |
| 122 | 120 |
| 123 void GpuVideoDecodeAccelerator::DismissPictureBuffer( | 121 void GpuVideoDecodeAccelerator::DismissPictureBuffer( |
| 124 int32 picture_buffer_id) { | 122 int32 picture_buffer_id) { |
| 125 // Notify client that picture buffer is now unused. | 123 // Notify client that picture buffer is now unused. |
| 126 if (!Send(new AcceleratedVideoDecoderHostMsg_DismissPictureBuffer( | 124 if (!Send(new AcceleratedVideoDecoderHostMsg_DismissPictureBuffer( |
| 127 host_route_id_, picture_buffer_id))) { | 125 host_route_id_, picture_buffer_id))) { |
| 128 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_DismissPictureBuffer) " | 126 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_DismissPictureBuffer) " |
| 129 << "failed"; | 127 << "failed"; |
| 130 } | 128 } |
| 131 } | 129 } |
| 132 | 130 |
| 133 void GpuVideoDecodeAccelerator::PictureReady( | 131 void GpuVideoDecodeAccelerator::PictureReady( |
| 134 const media::Picture& picture) { | 132 const media::Picture& picture) { |
| 135 if (!Send(new AcceleratedVideoDecoderHostMsg_PictureReady( | 133 if (!Send(new AcceleratedVideoDecoderHostMsg_PictureReady( |
| 136 host_route_id_, | 134 host_route_id_, |
| 137 picture.picture_buffer_id(), | 135 picture.picture_buffer_id(), |
| 138 picture.bitstream_buffer_id(), | 136 picture.bitstream_buffer_id()))) { |
| 139 picture.visible_size(), | |
| 140 picture.decoded_size()))) { | |
| 141 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_PictureReady) failed"; | 137 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_PictureReady) failed"; |
| 142 } | 138 } |
| 143 } | 139 } |
| 144 | 140 |
| 145 void GpuVideoDecodeAccelerator::NotifyEndOfStream() { | 141 void GpuVideoDecodeAccelerator::NotifyEndOfStream() { |
| 146 Send(new AcceleratedVideoDecoderHostMsg_EndOfStream(host_route_id_)); | 142 Send(new AcceleratedVideoDecoderHostMsg_EndOfStream(host_route_id_)); |
| 147 } | 143 } |
| 148 | 144 |
| 149 void GpuVideoDecodeAccelerator::NotifyError( | 145 void GpuVideoDecodeAccelerator::NotifyError( |
| 150 media::VideoDecodeAccelerator::Error error) { | 146 media::VideoDecodeAccelerator::Error error) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 243 |
| 248 void GpuVideoDecodeAccelerator::NotifyResetDone() { | 244 void GpuVideoDecodeAccelerator::NotifyResetDone() { |
| 249 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) | 245 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) |
| 250 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; | 246 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; |
| 251 } | 247 } |
| 252 | 248 |
| 253 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 249 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
| 254 DCHECK(sender_); | 250 DCHECK(sender_); |
| 255 return sender_->Send(message); | 251 return sender_->Send(message); |
| 256 } | 252 } |
| OLD | NEW |