Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: content/common/gpu/media/v4l2_image_processor.cc

Issue 1554543002: v4l2 accelerators: use V4L2_CAP_VIDEO_M2M_MPLANE capability. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 output_allocated_size_ = output_allocated_size; 128 output_allocated_size_ = output_allocated_size;
129 129
130 input_planes_count_ = media::VideoFrame::NumPlanes(input_format); 130 input_planes_count_ = media::VideoFrame::NumPlanes(input_format);
131 DCHECK_LE(input_planes_count_, static_cast<size_t>(VIDEO_MAX_PLANES)); 131 DCHECK_LE(input_planes_count_, static_cast<size_t>(VIDEO_MAX_PLANES));
132 output_planes_count_ = media::VideoFrame::NumPlanes(output_format); 132 output_planes_count_ = media::VideoFrame::NumPlanes(output_format);
133 DCHECK_LE(output_planes_count_, static_cast<size_t>(VIDEO_MAX_PLANES)); 133 DCHECK_LE(output_planes_count_, static_cast<size_t>(VIDEO_MAX_PLANES));
134 134
135 // Capabilities check. 135 // Capabilities check.
136 struct v4l2_capability caps; 136 struct v4l2_capability caps;
137 memset(&caps, 0, sizeof(caps)); 137 memset(&caps, 0, sizeof(caps));
138 const __u32 kCapsRequired = V4L2_CAP_VIDEO_CAPTURE_MPLANE | 138 const __u32 kCapsRequired = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING;
139 V4L2_CAP_VIDEO_OUTPUT_MPLANE | V4L2_CAP_STREAMING;
140 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYCAP, &caps); 139 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYCAP, &caps);
141 if ((caps.capabilities & kCapsRequired) != kCapsRequired) { 140 if ((caps.capabilities & kCapsRequired) != kCapsRequired) {
142 LOG(ERROR) << "Initialize(): ioctl() failed: VIDIOC_QUERYCAP: " 141 LOG(ERROR) << "Initialize(): ioctl() failed: VIDIOC_QUERYCAP: "
143 "caps check failed: 0x" << std::hex << caps.capabilities; 142 "caps check failed: 0x" << std::hex << caps.capabilities;
144 return false; 143 return false;
145 } 144 }
146 145
147 if (!CreateInputBuffers() || !CreateOutputBuffers()) 146 if (!CreateInputBuffers() || !CreateOutputBuffers())
148 return false; 147 return false;
149 148
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 output_record.at_device = false; 717 output_record.at_device = false;
719 if (!output_record.at_client) 718 if (!output_record.at_client)
720 free_output_buffers_.push_back(i); 719 free_output_buffers_.push_back(i);
721 } 720 }
722 output_buffer_queued_count_ = 0; 721 output_buffer_queued_count_ = 0;
723 722
724 return true; 723 return true;
725 } 724 }
726 725
727 } // namespace content 726 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698