OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/exynos_video_encode_accelerator.h" | 5 #include "content/common/gpu/media/exynos_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 <sys/eventfd.h> | 10 #include <sys/eventfd.h> |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 IOCTL_OR_ERROR_RETURN_FALSE(gsc_fd_, VIDIOC_S_CTRL, &control); | 1181 IOCTL_OR_ERROR_RETURN_FALSE(gsc_fd_, VIDIOC_S_CTRL, &control); |
1182 | 1182 |
1183 memset(&control, 0, sizeof(control)); | 1183 memset(&control, 0, sizeof(control)); |
1184 control.id = V4L2_CID_VFLIP; | 1184 control.id = V4L2_CID_VFLIP; |
1185 control.value = 0; | 1185 control.value = 0; |
1186 IOCTL_OR_ERROR_RETURN_FALSE(gsc_fd_, VIDIOC_S_CTRL, &control); | 1186 IOCTL_OR_ERROR_RETURN_FALSE(gsc_fd_, VIDIOC_S_CTRL, &control); |
1187 | 1187 |
1188 memset(&control, 0, sizeof(control)); | 1188 memset(&control, 0, sizeof(control)); |
1189 control.id = V4L2_CID_ALPHA_COMPONENT; | 1189 control.id = V4L2_CID_ALPHA_COMPONENT; |
1190 control.value = 255; | 1190 control.value = 255; |
1191 if (HANDLE_EINTR(ioctl(gsc_fd_, VIDIOC_S_CTRL, &control)) != 0) { | 1191 IOCTL_OR_ERROR_RETURN_FALSE(gsc_fd_, VIDIOC_S_CTRL, &control); |
1192 // TODO(posciak): This is a temporary hack and should be removed when | |
1193 // all platforms migrate to kernel >=3.8. | |
1194 memset(&control, 0, sizeof(control)); | |
1195 control.id = V4L2_CID_GLOBAL_ALPHA; | |
1196 control.value = 255; | |
1197 IOCTL_OR_ERROR_RETURN_FALSE(gsc_fd_, VIDIOC_S_CTRL, &control); | |
1198 } | |
1199 | 1192 |
1200 struct v4l2_format format; | 1193 struct v4l2_format format; |
1201 memset(&format, 0, sizeof(format)); | 1194 memset(&format, 0, sizeof(format)); |
1202 format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; | 1195 format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; |
1203 format.fmt.pix_mp.width = input_allocated_size_.width(); | 1196 format.fmt.pix_mp.width = input_allocated_size_.width(); |
1204 format.fmt.pix_mp.height = input_allocated_size_.height(); | 1197 format.fmt.pix_mp.height = input_allocated_size_.height(); |
1205 format.fmt.pix_mp.pixelformat = input_format_fourcc_; | 1198 format.fmt.pix_mp.pixelformat = input_format_fourcc_; |
1206 switch (input_format_fourcc_) { | 1199 switch (input_format_fourcc_) { |
1207 case V4L2_PIX_FMT_RGB32: | 1200 case V4L2_PIX_FMT_RGB32: |
1208 format.fmt.pix_mp.plane_fmt[0].sizeimage = | 1201 format.fmt.pix_mp.plane_fmt[0].sizeimage = |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1545 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; | 1538 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; |
1546 reqbufs.memory = V4L2_MEMORY_MMAP; | 1539 reqbufs.memory = V4L2_MEMORY_MMAP; |
1547 if (HANDLE_EINTR(ioctl(mfc_fd_, VIDIOC_REQBUFS, &reqbufs)) != 0) | 1540 if (HANDLE_EINTR(ioctl(mfc_fd_, VIDIOC_REQBUFS, &reqbufs)) != 0) |
1548 DPLOG(ERROR) << "DestroyMfcOutputBuffers(): ioctl() failed: VIDIOC_REQBUFS"; | 1541 DPLOG(ERROR) << "DestroyMfcOutputBuffers(): ioctl() failed: VIDIOC_REQBUFS"; |
1549 | 1542 |
1550 mfc_output_buffer_map_.clear(); | 1543 mfc_output_buffer_map_.clear(); |
1551 mfc_free_output_buffers_.clear(); | 1544 mfc_free_output_buffers_.clear(); |
1552 } | 1545 } |
1553 | 1546 |
1554 } // namespace content | 1547 } // namespace content |
OLD | NEW |