OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gpu/v4l2_video_encode_accelerator.h" | 5 #include "media/gpu/v4l2_video_encode_accelerator.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <linux/videodev2.h> | 8 #include <linux/videodev2.h> |
9 #include <poll.h> | 9 #include <poll.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 | 760 |
761 switch (input_memory_type_) { | 761 switch (input_memory_type_) { |
762 case V4L2_MEMORY_USERPTR: | 762 case V4L2_MEMORY_USERPTR: |
763 qbuf.m.planes[i].length = qbuf.m.planes[i].bytesused; | 763 qbuf.m.planes[i].length = qbuf.m.planes[i].bytesused; |
764 qbuf.m.planes[i].m.userptr = | 764 qbuf.m.planes[i].m.userptr = |
765 reinterpret_cast<unsigned long>(frame->data(i)); | 765 reinterpret_cast<unsigned long>(frame->data(i)); |
766 DCHECK(qbuf.m.planes[i].m.userptr); | 766 DCHECK(qbuf.m.planes[i].m.userptr); |
767 break; | 767 break; |
768 | 768 |
769 case V4L2_MEMORY_DMABUF: | 769 case V4L2_MEMORY_DMABUF: |
770 qbuf.m.planes[i].m.fd = frame->dmabuf_fd(i); | 770 qbuf.m.planes[i].m.fd = frame->DmabufFd(i); |
771 DCHECK_NE(qbuf.m.planes[i].m.fd, -1); | 771 DCHECK_NE(qbuf.m.planes[i].m.fd, -1); |
772 break; | 772 break; |
773 | 773 |
774 default: | 774 default: |
775 NOTREACHED(); | 775 NOTREACHED(); |
776 return false; | 776 return false; |
777 } | 777 } |
778 } | 778 } |
779 | 779 |
780 qbuf.memory = input_memory_type_; | 780 qbuf.memory = input_memory_type_; |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 memset(&reqbufs, 0, sizeof(reqbufs)); | 1333 memset(&reqbufs, 0, sizeof(reqbufs)); |
1334 reqbufs.count = 0; | 1334 reqbufs.count = 0; |
1335 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; | 1335 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; |
1336 reqbufs.memory = V4L2_MEMORY_MMAP; | 1336 reqbufs.memory = V4L2_MEMORY_MMAP; |
1337 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); | 1337 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); |
1338 | 1338 |
1339 output_buffer_map_.clear(); | 1339 output_buffer_map_.clear(); |
1340 } | 1340 } |
1341 | 1341 |
1342 } // namespace media | 1342 } // namespace media |
OLD | NEW |