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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 base::SharedMemoryHandle handle = channel_->ShareToGpuProcess( | 122 base::SharedMemoryHandle handle = channel_->ShareToGpuProcess( |
123 bitstream_buffer.handle()); | 123 bitstream_buffer.handle()); |
124 if (!base::SharedMemory::IsHandleValid(handle)) { | 124 if (!base::SharedMemory::IsHandleValid(handle)) { |
125 NOTREACHED() << "Failed to duplicate buffer handler"; | 125 NOTREACHED() << "Failed to duplicate buffer handler"; |
126 return; | 126 return; |
127 } | 127 } |
128 | 128 |
129 AcceleratedVideoDecoderMsg_Decode_Params params; | 129 AcceleratedVideoDecoderMsg_Decode_Params params; |
130 params.bitstream_buffer_id = bitstream_buffer.id(); | 130 params.bitstream_buffer_id = bitstream_buffer.id(); |
131 params.buffer_handle = handle; | 131 params.buffer_handle = handle; |
132 params.size = bitstream_buffer.size(); | 132 params.size = base::checked_cast<uint32>(bitstream_buffer.size()); |
Pawel Osciak
2015/12/31 02:05:53
We've just switched to standard integer types. Ple
Owen Lin
2016/01/04 08:54:17
Acknowledged.
| |
133 params.offset = base::checked_cast<uint32>(bitstream_buffer.offset()); | |
133 params.presentation_timestamp = bitstream_buffer.presentation_timestamp(); | 134 params.presentation_timestamp = bitstream_buffer.presentation_timestamp(); |
134 params.key_id = bitstream_buffer.key_id(); | 135 params.key_id = bitstream_buffer.key_id(); |
135 params.iv = bitstream_buffer.iv(); | 136 params.iv = bitstream_buffer.iv(); |
136 params.subsamples = bitstream_buffer.subsamples(); | 137 params.subsamples = bitstream_buffer.subsamples(); |
137 | 138 |
138 Send(new AcceleratedVideoDecoderMsg_Decode(decoder_route_id_, params)); | 139 Send(new AcceleratedVideoDecoderMsg_Decode(decoder_route_id_, params)); |
139 } | 140 } |
140 | 141 |
141 void GpuVideoDecodeAcceleratorHost::AssignPictureBuffers( | 142 void GpuVideoDecodeAcceleratorHost::AssignPictureBuffers( |
142 const std::vector<media::PictureBuffer>& buffers) { | 143 const std::vector<media::PictureBuffer>& buffers) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 weak_this_factory_.InvalidateWeakPtrs(); | 283 weak_this_factory_.InvalidateWeakPtrs(); |
283 | 284 |
284 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the | 285 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the |
285 // last thing done on this stack! | 286 // last thing done on this stack! |
286 media::VideoDecodeAccelerator::Client* client = NULL; | 287 media::VideoDecodeAccelerator::Client* client = NULL; |
287 std::swap(client, client_); | 288 std::swap(client, client_); |
288 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); | 289 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); |
289 } | 290 } |
290 | 291 |
291 } // namespace content | 292 } // namespace content |
OLD | NEW |