OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <errno.h> | 5 #include <errno.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <linux/videodev2.h> | 7 #include <linux/videodev2.h> |
8 #include <poll.h> | 8 #include <poll.h> |
9 #include <sys/eventfd.h> | 9 #include <sys/eventfd.h> |
10 #include <sys/ioctl.h> | 10 #include <sys/ioctl.h> |
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 void V4L2SliceVideoDecodeAccelerator::DecodeTask( | 1183 void V4L2SliceVideoDecodeAccelerator::DecodeTask( |
1184 const media::BitstreamBuffer& bitstream_buffer) { | 1184 const media::BitstreamBuffer& bitstream_buffer) { |
1185 DVLOGF(3) << "input_id=" << bitstream_buffer.id() | 1185 DVLOGF(3) << "input_id=" << bitstream_buffer.id() |
1186 << " size=" << bitstream_buffer.size(); | 1186 << " size=" << bitstream_buffer.size(); |
1187 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 1187 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); |
1188 | 1188 |
1189 scoped_ptr<BitstreamBufferRef> bitstream_record(new BitstreamBufferRef( | 1189 scoped_ptr<BitstreamBufferRef> bitstream_record(new BitstreamBufferRef( |
1190 io_client_, io_task_runner_, | 1190 io_client_, io_task_runner_, |
1191 new base::SharedMemory(bitstream_buffer.handle(), true), | 1191 new base::SharedMemory(bitstream_buffer.handle(), true), |
1192 bitstream_buffer.size(), bitstream_buffer.id())); | 1192 bitstream_buffer.size(), bitstream_buffer.id())); |
1193 if (!bitstream_record->shm->Map(bitstream_buffer.size())) { | 1193 if (!bitstream_record->shm->MapAt(bitstream_buffer.offset(), |
| 1194 bitstream_buffer.size())) { |
1194 LOGF(ERROR) << "Could not map bitstream_buffer"; | 1195 LOGF(ERROR) << "Could not map bitstream_buffer"; |
1195 NOTIFY_ERROR(UNREADABLE_INPUT); | 1196 NOTIFY_ERROR(UNREADABLE_INPUT); |
1196 return; | 1197 return; |
1197 } | 1198 } |
1198 DVLOGF(3) << "mapped at=" << bitstream_record->shm->memory(); | 1199 DVLOGF(3) << "mapped at=" << bitstream_record->shm->memory(); |
1199 | 1200 |
1200 decoder_input_queue_.push( | 1201 decoder_input_queue_.push( |
1201 linked_ptr<BitstreamBufferRef>(bitstream_record.release())); | 1202 linked_ptr<BitstreamBufferRef>(bitstream_record.release())); |
1202 | 1203 |
1203 ScheduleDecodeBufferTaskIfNeeded(); | 1204 ScheduleDecodeBufferTaskIfNeeded(); |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2543 if (!device) | 2544 if (!device) |
2544 return SupportedProfiles(); | 2545 return SupportedProfiles(); |
2545 | 2546 |
2546 const uint32_t supported_formats[] = { | 2547 const uint32_t supported_formats[] = { |
2547 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME}; | 2548 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME}; |
2548 return device->GetSupportedDecodeProfiles(arraysize(supported_formats), | 2549 return device->GetSupportedDecodeProfiles(arraysize(supported_formats), |
2549 supported_formats); | 2550 supported_formats); |
2550 } | 2551 } |
2551 | 2552 |
2552 } // namespace content | 2553 } // namespace content |
OLD | NEW |