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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 TRACE_COUNTER1("media", "AVDA::PendingBitstreamBufferCount", | 199 TRACE_COUNTER1("media", "AVDA::PendingBitstreamBufferCount", |
200 pending_bitstream_buffers_.size()); | 200 pending_bitstream_buffers_.size()); |
201 | 201 |
202 if (bitstream_buffer.id() == -1) { | 202 if (bitstream_buffer.id() == -1) { |
203 media_codec_->QueueEOS(input_buf_index); | 203 media_codec_->QueueEOS(input_buf_index); |
204 return; | 204 return; |
205 } | 205 } |
206 | 206 |
207 scoped_ptr<base::SharedMemory> shm( | 207 scoped_ptr<base::SharedMemory> shm( |
208 new base::SharedMemory(bitstream_buffer.handle(), true)); | 208 new base::SharedMemory(bitstream_buffer.handle(), true)); |
209 RETURN_ON_FAILURE(this, shm->Map(bitstream_buffer.size()), | 209 RETURN_ON_FAILURE( |
210 "Failed to SharedMemory::Map()", UNREADABLE_INPUT); | 210 this, shm->MapAt(bitstream_buffer.offset(), bitstream_buffer.size()), |
Pawel Osciak
2015/12/24 00:58:01
MapAt (and underlying mmap()) requires offset to b
Owen Lin
2015/12/24 08:01:35
I think we can do it in ArcCodec. Align the input
| |
211 "Failed to SharedMemory::Map()", UNREADABLE_INPUT); | |
211 | 212 |
212 const base::TimeDelta presentation_timestamp = | 213 const base::TimeDelta presentation_timestamp = |
213 bitstream_buffer.presentation_timestamp(); | 214 bitstream_buffer.presentation_timestamp(); |
214 DCHECK(presentation_timestamp != media::kNoTimestamp()) | 215 DCHECK(presentation_timestamp != media::kNoTimestamp()) |
215 << "Bitstream buffers must have valid presentation timestamps"; | 216 << "Bitstream buffers must have valid presentation timestamps"; |
216 | 217 |
217 // There may already be a bitstream buffer with this timestamp, e.g., VP9 alt | 218 // There may already be a bitstream buffer with this timestamp, e.g., VP9 alt |
218 // ref frames, but it's OK to overwrite it because we only expect a single | 219 // ref frames, but it's OK to overwrite it because we only expect a single |
219 // output frame to have that timestamp. AVDA clients only use the bitstream | 220 // output frame to have that timestamp. AVDA clients only use the bitstream |
220 // buffer id in the returned Pictures to map a bitstream buffer back to a | 221 // buffer id in the returned Pictures to map a bitstream buffer back to a |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
666 // software fallback for H264 on Android anyway. | 667 // software fallback for H264 on Android anyway. |
667 profile.max_resolution.SetSize(3840, 2160); | 668 profile.max_resolution.SetSize(3840, 2160); |
668 profiles.push_back(profile); | 669 profiles.push_back(profile); |
669 } | 670 } |
670 #endif | 671 #endif |
671 | 672 |
672 return profiles; | 673 return profiles; |
673 } | 674 } |
674 | 675 |
675 } // namespace content | 676 } // namespace content |
OLD | NEW |