OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/common/gpu/media/android_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 321 |
322 if (bitstream_buffer.id() == -1) { | 322 if (bitstream_buffer.id() == -1) { |
323 pending_bitstream_buffers_.pop(); | 323 pending_bitstream_buffers_.pop(); |
324 TRACE_COUNTER1("media", "AVDA::PendingBitstreamBufferCount", | 324 TRACE_COUNTER1("media", "AVDA::PendingBitstreamBufferCount", |
325 pending_bitstream_buffers_.size()); | 325 pending_bitstream_buffers_.size()); |
326 | 326 |
327 media_codec_->QueueEOS(input_buf_index); | 327 media_codec_->QueueEOS(input_buf_index); |
328 return true; | 328 return true; |
329 } | 329 } |
330 | 330 |
331 scoped_ptr<base::SharedMemory> shm( | 331 scoped_ptr<SharedMemoryRegion> shm( |
332 new base::SharedMemory(bitstream_buffer.handle(), true)); | 332 new SharedMemoryRegion(bitstream_buffer, true)); |
333 if (!shm->Map(bitstream_buffer.size())) { | 333 if (!shm->Map()) { |
334 POST_ERROR(UNREADABLE_INPUT, "Failed to SharedMemory::Map()"); | 334 POST_ERROR(UNREADABLE_INPUT, "Failed to SharedMemory::Map()"); |
335 return false; | 335 return false; |
336 } | 336 } |
337 | 337 |
338 const base::TimeDelta presentation_timestamp = | 338 const base::TimeDelta presentation_timestamp = |
339 bitstream_buffer.presentation_timestamp(); | 339 bitstream_buffer.presentation_timestamp(); |
340 DCHECK(presentation_timestamp != media::kNoTimestamp()) | 340 DCHECK(presentation_timestamp != media::kNoTimestamp()) |
341 << "Bitstream buffers must have valid presentation timestamps"; | 341 << "Bitstream buffers must have valid presentation timestamps"; |
342 | 342 |
343 // There may already be a bitstream buffer with this timestamp, e.g., VP9 alt | 343 // There may already be a bitstream buffer with this timestamp, e.g., VP9 alt |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 | 918 |
919 if (UseDeferredRenderingStrategy()) { | 919 if (UseDeferredRenderingStrategy()) { |
920 capabilities.flags = media::VideoDecodeAccelerator::Capabilities:: | 920 capabilities.flags = media::VideoDecodeAccelerator::Capabilities:: |
921 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE; | 921 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE; |
922 } | 922 } |
923 | 923 |
924 return capabilities; | 924 return capabilities; |
925 } | 925 } |
926 | 926 |
927 } // namespace content | 927 } // namespace content |
OLD | NEW |