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

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: rebase over crrev.com/1645873002 Created 4 years, 10 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 "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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 scoped_ptr<SHMBuffer> shm_buffer = GetSHM(size); 324 scoped_ptr<SHMBuffer> shm_buffer = GetSHM(size);
325 if (!shm_buffer) { 325 if (!shm_buffer) {
326 bound_decode_cb.Run(kDecodeError); 326 bound_decode_cb.Run(kDecodeError);
327 return; 327 return;
328 } 328 }
329 329
330 memcpy(shm_buffer->shm->memory(), buffer->data(), size); 330 memcpy(shm_buffer->shm->memory(), buffer->data(), size);
331 // AndroidVideoDecodeAccelerator needs the timestamp to output frames in 331 // AndroidVideoDecodeAccelerator needs the timestamp to output frames in
332 // presentation order. 332 // presentation order.
333 BitstreamBuffer bitstream_buffer(next_bitstream_buffer_id_, 333 BitstreamBuffer bitstream_buffer(next_bitstream_buffer_id_,
334 shm_buffer->shm->handle(), size, 334 shm_buffer->shm->handle(), size, 0,
335 buffer->timestamp()); 335 buffer->timestamp());
336 336
337 if (buffer->decrypt_config()) 337 if (buffer->decrypt_config())
338 bitstream_buffer.SetDecryptConfig(*buffer->decrypt_config()); 338 bitstream_buffer.SetDecryptConfig(*buffer->decrypt_config());
339 339
340 // Mask against 30 bits, to avoid (undefined) wraparound on signed integer. 340 // Mask against 30 bits, to avoid (undefined) wraparound on signed integer.
341 next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF; 341 next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF;
342 DCHECK(!ContainsKey(bitstream_buffers_in_decoder_, bitstream_buffer.id())); 342 DCHECK(!ContainsKey(bitstream_buffers_in_decoder_, bitstream_buffer.id()));
343 bitstream_buffers_in_decoder_.insert(std::make_pair( 343 bitstream_buffers_in_decoder_.insert(std::make_pair(
344 bitstream_buffer.id(), 344 bitstream_buffer.id(),
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 } 705 }
706 return false; 706 return false;
707 } 707 }
708 708
709 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 709 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
710 const { 710 const {
711 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 711 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
712 } 712 }
713 713
714 } // namespace media 714 } // namespace media
OLDNEW
« media/base/bitstream_buffer.cc ('K') | « media/base/bitstream_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698