| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 // presentation order. | 395 // presentation order. |
| 396 BitstreamBuffer bitstream_buffer(next_bitstream_buffer_id_, | 396 BitstreamBuffer bitstream_buffer(next_bitstream_buffer_id_, |
| 397 shm_buffer->shm->handle(), size, 0, | 397 shm_buffer->shm->handle(), size, 0, |
| 398 buffer->timestamp()); | 398 buffer->timestamp()); |
| 399 | 399 |
| 400 if (buffer->decrypt_config()) | 400 if (buffer->decrypt_config()) |
| 401 bitstream_buffer.SetDecryptConfig(*buffer->decrypt_config()); | 401 bitstream_buffer.SetDecryptConfig(*buffer->decrypt_config()); |
| 402 | 402 |
| 403 // Mask against 30 bits, to avoid (undefined) wraparound on signed integer. | 403 // Mask against 30 bits, to avoid (undefined) wraparound on signed integer. |
| 404 next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF; | 404 next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF; |
| 405 DCHECK(!ContainsKey(bitstream_buffers_in_decoder_, bitstream_buffer.id())); | 405 DCHECK( |
| 406 !base::ContainsKey(bitstream_buffers_in_decoder_, bitstream_buffer.id())); |
| 406 bitstream_buffers_in_decoder_.insert(std::make_pair( | 407 bitstream_buffers_in_decoder_.insert(std::make_pair( |
| 407 bitstream_buffer.id(), | 408 bitstream_buffer.id(), |
| 408 PendingDecoderBuffer(shm_buffer.release(), buffer, decode_cb))); | 409 PendingDecoderBuffer(shm_buffer.release(), buffer, decode_cb))); |
| 409 DCHECK_LE(static_cast<int>(bitstream_buffers_in_decoder_.size()), | 410 DCHECK_LE(static_cast<int>(bitstream_buffers_in_decoder_.size()), |
| 410 kMaxInFlightDecodes); | 411 kMaxInFlightDecodes); |
| 411 RecordBufferData(bitstream_buffer, *buffer.get()); | 412 RecordBufferData(bitstream_buffer, *buffer.get()); |
| 412 | 413 |
| 413 vda_->Decode(bitstream_buffer); | 414 vda_->Decode(bitstream_buffer); |
| 414 } | 415 } |
| 415 | 416 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 } | 824 } |
| 824 return false; | 825 return false; |
| 825 } | 826 } |
| 826 | 827 |
| 827 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 828 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
| 828 const { | 829 const { |
| 829 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 830 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
| 830 } | 831 } |
| 831 | 832 |
| 832 } // namespace media | 833 } // namespace media |
| OLD | NEW |