| 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 <dlfcn.h> | 5 #include <dlfcn.h> |
| 6 #include <errno.h> | 6 #include <errno.h> |
| 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 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1666 __u32 pixelformat = V4L2Device::VideoCodecProfileToV4L2PixFmt(video_profile_); | 1666 __u32 pixelformat = V4L2Device::VideoCodecProfileToV4L2PixFmt(video_profile_); |
| 1667 if (!pixelformat) { | 1667 if (!pixelformat) { |
| 1668 NOTREACHED(); | 1668 NOTREACHED(); |
| 1669 return false; | 1669 return false; |
| 1670 } | 1670 } |
| 1671 | 1671 |
| 1672 struct v4l2_format format; | 1672 struct v4l2_format format; |
| 1673 memset(&format, 0, sizeof(format)); | 1673 memset(&format, 0, sizeof(format)); |
| 1674 format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; | 1674 format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; |
| 1675 format.fmt.pix_mp.pixelformat = pixelformat; | 1675 format.fmt.pix_mp.pixelformat = pixelformat; |
| 1676 if (CommandLine::ForCurrentProcess()->HasSwitch( | 1676 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1677 switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode)) | 1677 switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode)) |
| 1678 format.fmt.pix_mp.plane_fmt[0].sizeimage = kInputBufferMaxSizeFor4k; | 1678 format.fmt.pix_mp.plane_fmt[0].sizeimage = kInputBufferMaxSizeFor4k; |
| 1679 else | 1679 else |
| 1680 format.fmt.pix_mp.plane_fmt[0].sizeimage = kInputBufferMaxSizeFor1080p; | 1680 format.fmt.pix_mp.plane_fmt[0].sizeimage = kInputBufferMaxSizeFor1080p; |
| 1681 format.fmt.pix_mp.num_planes = 1; | 1681 format.fmt.pix_mp.num_planes = 1; |
| 1682 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_S_FMT, &format); | 1682 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_S_FMT, &format); |
| 1683 | 1683 |
| 1684 struct v4l2_requestbuffers reqbufs; | 1684 struct v4l2_requestbuffers reqbufs; |
| 1685 memset(&reqbufs, 0, sizeof(reqbufs)); | 1685 memset(&reqbufs, 0, sizeof(reqbufs)); |
| 1686 reqbufs.count = kInputBufferCount; | 1686 reqbufs.count = kInputBufferCount; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), | 1934 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), |
| 1935 base::checked_cast<int>(format.fmt.pix_mp.height)); | 1935 base::checked_cast<int>(format.fmt.pix_mp.height)); |
| 1936 if (frame_buffer_size_ != new_size) { | 1936 if (frame_buffer_size_ != new_size) { |
| 1937 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; | 1937 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; |
| 1938 return true; | 1938 return true; |
| 1939 } | 1939 } |
| 1940 return false; | 1940 return false; |
| 1941 } | 1941 } |
| 1942 | 1942 |
| 1943 } // namespace content | 1943 } // namespace content |
| OLD | NEW |