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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 scoped_ptr<SHMBuffer> shm_buffer = GetSHM(size); | 303 scoped_ptr<SHMBuffer> shm_buffer = GetSHM(size); |
304 if (!shm_buffer) { | 304 if (!shm_buffer) { |
305 bound_decode_cb.Run(kDecodeError); | 305 bound_decode_cb.Run(kDecodeError); |
306 return; | 306 return; |
307 } | 307 } |
308 | 308 |
309 memcpy(shm_buffer->shm->memory(), buffer->data(), size); | 309 memcpy(shm_buffer->shm->memory(), buffer->data(), size); |
310 // AndroidVideoDecodeAccelerator needs the timestamp to output frames in | 310 // AndroidVideoDecodeAccelerator needs the timestamp to output frames in |
311 // presentation order. | 311 // presentation order. |
312 BitstreamBuffer bitstream_buffer(next_bitstream_buffer_id_, | 312 BitstreamBuffer bitstream_buffer(next_bitstream_buffer_id_, |
313 shm_buffer->shm->handle(), size, | 313 shm_buffer->shm->handle(), size, 0, |
314 buffer->timestamp()); | 314 buffer->timestamp()); |
315 | 315 |
316 if (buffer->decrypt_config()) | 316 if (buffer->decrypt_config()) |
317 bitstream_buffer.SetDecryptConfig(*buffer->decrypt_config()); | 317 bitstream_buffer.SetDecryptConfig(*buffer->decrypt_config()); |
318 | 318 |
319 // Mask against 30 bits, to avoid (undefined) wraparound on signed integer. | 319 // Mask against 30 bits, to avoid (undefined) wraparound on signed integer. |
320 next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF; | 320 next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF; |
321 DCHECK(!ContainsKey(bitstream_buffers_in_decoder_, bitstream_buffer.id())); | 321 DCHECK(!ContainsKey(bitstream_buffers_in_decoder_, bitstream_buffer.id())); |
322 bitstream_buffers_in_decoder_.insert(std::make_pair( | 322 bitstream_buffers_in_decoder_.insert(std::make_pair( |
323 bitstream_buffer.id(), | 323 bitstream_buffer.id(), |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 } | 676 } |
677 return false; | 677 return false; |
678 } | 678 } |
679 | 679 |
680 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 680 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
681 const { | 681 const { |
682 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 682 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
683 } | 683 } |
684 | 684 |
685 } // namespace media | 685 } // namespace media |
OLD | NEW |