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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |