OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |