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

Side by Side Diff: content/common/gpu/client/gpu_video_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 dcheng's comments Created 4 years, 11 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
OLDNEW
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 "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 base::SharedMemoryHandle handle = channel_->ShareToGpuProcess( 123 base::SharedMemoryHandle handle = channel_->ShareToGpuProcess(
124 bitstream_buffer.handle()); 124 bitstream_buffer.handle());
125 if (!base::SharedMemory::IsHandleValid(handle)) { 125 if (!base::SharedMemory::IsHandleValid(handle)) {
126 NOTREACHED() << "Failed to duplicate buffer handler"; 126 NOTREACHED() << "Failed to duplicate buffer handler";
127 return; 127 return;
128 } 128 }
129 129
130 AcceleratedVideoDecoderMsg_Decode_Params params; 130 AcceleratedVideoDecoderMsg_Decode_Params params;
131 params.bitstream_buffer_id = bitstream_buffer.id(); 131 params.bitstream_buffer_id = bitstream_buffer.id();
132 params.buffer_handle = handle; 132 params.buffer_handle = handle;
133 params.size = bitstream_buffer.size(); 133 params.size = base::checked_cast<uint32_t>(bitstream_buffer.size());
134 params.offset = base::checked_cast<uint32_t>(bitstream_buffer.offset());
134 params.presentation_timestamp = bitstream_buffer.presentation_timestamp(); 135 params.presentation_timestamp = bitstream_buffer.presentation_timestamp();
135 params.key_id = bitstream_buffer.key_id(); 136 params.key_id = bitstream_buffer.key_id();
136 params.iv = bitstream_buffer.iv(); 137 params.iv = bitstream_buffer.iv();
137 params.subsamples = bitstream_buffer.subsamples(); 138 params.subsamples = bitstream_buffer.subsamples();
138 139
139 Send(new AcceleratedVideoDecoderMsg_Decode(decoder_route_id_, params)); 140 Send(new AcceleratedVideoDecoderMsg_Decode(decoder_route_id_, params));
140 } 141 }
141 142
142 void GpuVideoDecodeAcceleratorHost::AssignPictureBuffers( 143 void GpuVideoDecodeAcceleratorHost::AssignPictureBuffers(
143 const std::vector<media::PictureBuffer>& buffers) { 144 const std::vector<media::PictureBuffer>& buffers) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 weak_this_factory_.InvalidateWeakPtrs(); 284 weak_this_factory_.InvalidateWeakPtrs();
284 285
285 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the 286 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the
286 // last thing done on this stack! 287 // last thing done on this stack!
287 media::VideoDecodeAccelerator::Client* client = NULL; 288 media::VideoDecodeAccelerator::Client* client = NULL;
288 std::swap(client, client_); 289 std::swap(client, client_);
289 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); 290 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error));
290 } 291 }
291 292
292 } // namespace content 293 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698