Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_jpeg_decode_accelerator_host.h" | 5 #include "content/common/gpu/client/gpu_jpeg_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/memory/shared_memory_handle.h" | 9 #include "base/memory/shared_memory_handle.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 } | 169 } |
| 170 | 170 |
| 171 size_t output_buffer_size = media::VideoFrame::AllocationSize( | 171 size_t output_buffer_size = media::VideoFrame::AllocationSize( |
| 172 video_frame->format(), video_frame->coded_size()); | 172 video_frame->format(), video_frame->coded_size()); |
| 173 | 173 |
| 174 AcceleratedJpegDecoderMsg_Decode_Params decode_params; | 174 AcceleratedJpegDecoderMsg_Decode_Params decode_params; |
| 175 decode_params.coded_size = video_frame->coded_size(); | 175 decode_params.coded_size = video_frame->coded_size(); |
| 176 decode_params.input_buffer_id = bitstream_buffer.id(); | 176 decode_params.input_buffer_id = bitstream_buffer.id(); |
| 177 decode_params.input_buffer_handle = input_handle; | 177 decode_params.input_buffer_handle = input_handle; |
| 178 decode_params.input_buffer_size = bitstream_buffer.size(); | 178 decode_params.input_buffer_size = bitstream_buffer.size(); |
| 179 decode_params.input_buffer_offset = bitstream_buffer.offset(); | |
|
Pawel Osciak
2015/12/24 00:58:01
We must do a base::checked_cast here and in other
Owen Lin
2015/12/24 08:01:35
Done.
| |
| 179 decode_params.output_video_frame_handle = output_handle; | 180 decode_params.output_video_frame_handle = output_handle; |
| 180 decode_params.output_buffer_size = output_buffer_size; | 181 decode_params.output_buffer_size = output_buffer_size; |
| 181 Send(new AcceleratedJpegDecoderMsg_Decode(decoder_route_id_, decode_params)); | 182 Send(new AcceleratedJpegDecoderMsg_Decode(decoder_route_id_, decode_params)); |
| 182 } | 183 } |
| 183 | 184 |
| 184 bool GpuJpegDecodeAcceleratorHost::IsSupported() { | 185 bool GpuJpegDecodeAcceleratorHost::IsSupported() { |
| 185 return channel_->gpu_info().jpeg_decode_accelerator_supported; | 186 return channel_->gpu_info().jpeg_decode_accelerator_supported; |
| 186 } | 187 } |
| 187 | 188 |
| 188 void GpuJpegDecodeAcceleratorHost::Send(IPC::Message* message) { | 189 void GpuJpegDecodeAcceleratorHost::Send(IPC::Message* message) { |
| 189 DCHECK(CalledOnValidThread()); | 190 DCHECK(CalledOnValidThread()); |
| 190 | 191 |
| 191 if (!channel_->Send(message)) { | 192 if (!channel_->Send(message)) { |
| 192 DLOG(ERROR) << "Send(" << message->type() << ") failed"; | 193 DLOG(ERROR) << "Send(" << message->type() << ") failed"; |
| 193 } | 194 } |
| 194 } | 195 } |
| 195 | 196 |
| 196 base::WeakPtr<IPC::Listener> GpuJpegDecodeAcceleratorHost::GetReceiver() { | 197 base::WeakPtr<IPC::Listener> GpuJpegDecodeAcceleratorHost::GetReceiver() { |
| 197 return receiver_->AsWeakPtrForIO(); | 198 return receiver_->AsWeakPtrForIO(); |
| 198 } | 199 } |
| 199 | 200 |
| 200 } // namespace content | 201 } // namespace content |
| OLD | NEW |