Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc

Issue 1541353002: Add offset support to BitstreamBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments and rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/common/gpu/media/android_video_decode_accelerator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // TODO(kcwu) fix the handle leak after crbug.com/493414 resolved. 173 // TODO(kcwu) fix the handle leak after crbug.com/493414 resolved.
174 #endif 174 #endif
175 return; 175 return;
176 } 176 }
177 177
178 size_t output_buffer_size = media::VideoFrame::AllocationSize( 178 size_t output_buffer_size = media::VideoFrame::AllocationSize(
179 video_frame->format(), video_frame->coded_size()); 179 video_frame->format(), video_frame->coded_size());
180 180
181 decode_params.coded_size = video_frame->coded_size(); 181 decode_params.coded_size = video_frame->coded_size();
182 decode_params.output_video_frame_handle = output_handle; 182 decode_params.output_video_frame_handle = output_handle;
183 decode_params.output_buffer_size = output_buffer_size; 183 decode_params.output_buffer_size =
184 base::checked_cast<uint32_t>(output_buffer_size);
184 Send(new AcceleratedJpegDecoderMsg_Decode(decoder_route_id_, decode_params)); 185 Send(new AcceleratedJpegDecoderMsg_Decode(decoder_route_id_, decode_params));
185 } 186 }
186 187
187 bool GpuJpegDecodeAcceleratorHost::IsSupported() { 188 bool GpuJpegDecodeAcceleratorHost::IsSupported() {
188 return channel_->gpu_info().jpeg_decode_accelerator_supported; 189 return channel_->gpu_info().jpeg_decode_accelerator_supported;
189 } 190 }
190 191
191 void GpuJpegDecodeAcceleratorHost::Send(IPC::Message* message) { 192 void GpuJpegDecodeAcceleratorHost::Send(IPC::Message* message) {
192 DCHECK(CalledOnValidThread()); 193 DCHECK(CalledOnValidThread());
193 194
194 if (!channel_->Send(message)) { 195 if (!channel_->Send(message)) {
195 DLOG(ERROR) << "Send(" << message->type() << ") failed"; 196 DLOG(ERROR) << "Send(" << message->type() << ") failed";
196 } 197 }
197 } 198 }
198 199
199 base::WeakPtr<IPC::Listener> GpuJpegDecodeAcceleratorHost::GetReceiver() { 200 base::WeakPtr<IPC::Listener> GpuJpegDecodeAcceleratorHost::GetReceiver() {
200 return receiver_->AsWeakPtrForIO(); 201 return receiver_->AsWeakPtrForIO();
201 } 202 }
202 203
203 } // namespace content 204 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/android_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698