| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/client/gpu_video_decode_accelerator_host.h" | 5 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "content/common/gpu/client/gpu_channel_host.h" | 10 #include "content/common/gpu/client/gpu_channel_host.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 if (!channel_) | 110 if (!channel_) |
| 111 return; | 111 return; |
| 112 | 112 |
| 113 base::SharedMemoryHandle handle = channel_->ShareToGpuProcess( | 113 base::SharedMemoryHandle handle = channel_->ShareToGpuProcess( |
| 114 bitstream_buffer.handle()); | 114 bitstream_buffer.handle()); |
| 115 if (!base::SharedMemory::IsHandleValid(handle)) { | 115 if (!base::SharedMemory::IsHandleValid(handle)) { |
| 116 NOTREACHED() << "Failed to duplicate buffer handler"; | 116 NOTREACHED() << "Failed to duplicate buffer handler"; |
| 117 return; | 117 return; |
| 118 } | 118 } |
| 119 | 119 |
| 120 Send(new AcceleratedVideoDecoderMsg_Decode( | 120 AcceleratedVideoDecoderMsg_Decode_Params params; |
| 121 decoder_route_id_, handle, bitstream_buffer.id(), bitstream_buffer.size(), | 121 params.bitstream_buffer_id = bitstream_buffer.id(); |
| 122 bitstream_buffer.presentation_timestamp())); | 122 params.buffer_handle = handle; |
| 123 params.size = bitstream_buffer.size(); |
| 124 params.presentation_timestamp = bitstream_buffer.presentation_timestamp(); |
| 125 params.key_id = bitstream_buffer.key_id(); |
| 126 params.iv = bitstream_buffer.iv(); |
| 127 params.subsamples = bitstream_buffer.subsamples(); |
| 128 |
| 129 Send(new AcceleratedVideoDecoderMsg_Decode(decoder_route_id_, params)); |
| 123 } | 130 } |
| 124 | 131 |
| 125 void GpuVideoDecodeAcceleratorHost::AssignPictureBuffers( | 132 void GpuVideoDecodeAcceleratorHost::AssignPictureBuffers( |
| 126 const std::vector<media::PictureBuffer>& buffers) { | 133 const std::vector<media::PictureBuffer>& buffers) { |
| 127 DCHECK(CalledOnValidThread()); | 134 DCHECK(CalledOnValidThread()); |
| 128 if (!channel_) | 135 if (!channel_) |
| 129 return; | 136 return; |
| 130 // Rearrange data for IPC command. | 137 // Rearrange data for IPC command. |
| 131 std::vector<int32> buffer_ids; | 138 std::vector<int32> buffer_ids; |
| 132 std::vector<uint32> texture_ids; | 139 std::vector<uint32> texture_ids; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 weak_this_factory_.InvalidateWeakPtrs(); | 267 weak_this_factory_.InvalidateWeakPtrs(); |
| 261 | 268 |
| 262 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the | 269 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the |
| 263 // last thing done on this stack! | 270 // last thing done on this stack! |
| 264 media::VideoDecodeAccelerator::Client* client = NULL; | 271 media::VideoDecodeAccelerator::Client* client = NULL; |
| 265 std::swap(client, client_); | 272 std::swap(client, client_); |
| 266 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); | 273 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); |
| 267 } | 274 } |
| 268 | 275 |
| 269 } // namespace content | 276 } // namespace content |
| OLD | NEW |