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

Side by Side Diff: media/filters/gpu_video_decoder.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 | « media/base/bitstream_buffer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "media/filters/gpu_video_decoder.h" 5 #include "media/filters/gpu_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 scoped_ptr<SHMBuffer> shm_buffer = GetSHM(size); 327 scoped_ptr<SHMBuffer> shm_buffer = GetSHM(size);
328 if (!shm_buffer) { 328 if (!shm_buffer) {
329 bound_decode_cb.Run(kDecodeError); 329 bound_decode_cb.Run(kDecodeError);
330 return; 330 return;
331 } 331 }
332 332
333 memcpy(shm_buffer->shm->memory(), buffer->data(), size); 333 memcpy(shm_buffer->shm->memory(), buffer->data(), size);
334 // AndroidVideoDecodeAccelerator needs the timestamp to output frames in 334 // AndroidVideoDecodeAccelerator needs the timestamp to output frames in
335 // presentation order. 335 // presentation order.
336 BitstreamBuffer bitstream_buffer(next_bitstream_buffer_id_, 336 BitstreamBuffer bitstream_buffer(next_bitstream_buffer_id_,
337 shm_buffer->shm->handle(), size, 337 shm_buffer->shm->handle(), size, 0,
338 buffer->timestamp()); 338 buffer->timestamp());
339 339
340 if (buffer->decrypt_config()) 340 if (buffer->decrypt_config())
341 bitstream_buffer.SetDecryptConfig(*buffer->decrypt_config()); 341 bitstream_buffer.SetDecryptConfig(*buffer->decrypt_config());
342 342
343 // Mask against 30 bits, to avoid (undefined) wraparound on signed integer. 343 // Mask against 30 bits, to avoid (undefined) wraparound on signed integer.
344 next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF; 344 next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF;
345 DCHECK(!ContainsKey(bitstream_buffers_in_decoder_, bitstream_buffer.id())); 345 DCHECK(!ContainsKey(bitstream_buffers_in_decoder_, bitstream_buffer.id()));
346 bitstream_buffers_in_decoder_.insert(std::make_pair( 346 bitstream_buffers_in_decoder_.insert(std::make_pair(
347 bitstream_buffer.id(), 347 bitstream_buffer.id(),
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 } 708 }
709 return false; 709 return false;
710 } 710 }
711 711
712 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 712 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
713 const { 713 const {
714 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 714 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
715 } 715 }
716 716
717 } // namespace media 717 } // namespace media
OLDNEW
« no previous file with comments | « media/base/bitstream_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698