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

Side by Side Diff: media/gpu/v4l2_video_encode_accelerator.cc

Issue 2225723002: V4L2VideoEncodeAccelerator: increase the number of input buffers to 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | no next file » | 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 "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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 bool V4L2VideoEncodeAccelerator::CreateInputBuffers() { 1137 bool V4L2VideoEncodeAccelerator::CreateInputBuffers() {
1138 DVLOG(3) << "CreateInputBuffers()"; 1138 DVLOG(3) << "CreateInputBuffers()";
1139 // This function runs on encoder_thread_ after output buffers have been 1139 // This function runs on encoder_thread_ after output buffers have been
1140 // provided by the client. 1140 // provided by the client.
1141 DCHECK(encoder_thread_.task_runner()->BelongsToCurrentThread()); 1141 DCHECK(encoder_thread_.task_runner()->BelongsToCurrentThread());
1142 DCHECK(!input_streamon_); 1142 DCHECK(!input_streamon_);
1143 1143
1144 struct v4l2_requestbuffers reqbufs; 1144 struct v4l2_requestbuffers reqbufs;
1145 memset(&reqbufs, 0, sizeof(reqbufs)); 1145 memset(&reqbufs, 0, sizeof(reqbufs));
1146 // Driver will modify to the appropriate number of buffers. 1146 // Driver will modify to the appropriate number of buffers.
1147 reqbufs.count = 1; 1147 reqbufs.count = kInputBufferCount;
1148 reqbufs.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; 1148 reqbufs.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
1149 // TODO(posciak): Once we start doing zero-copy, we should decide based on 1149 // TODO(posciak): Once we start doing zero-copy, we should decide based on
1150 // the current pipeline setup which memory type to use. This should probably 1150 // the current pipeline setup which memory type to use. This should probably
1151 // be decided based on an argument to Initialize(). 1151 // be decided based on an argument to Initialize().
1152 if (image_processor_.get()) 1152 if (image_processor_.get())
1153 input_memory_type_ = V4L2_MEMORY_DMABUF; 1153 input_memory_type_ = V4L2_MEMORY_DMABUF;
1154 else 1154 else
1155 input_memory_type_ = V4L2_MEMORY_USERPTR; 1155 input_memory_type_ = V4L2_MEMORY_USERPTR;
1156 1156
1157 reqbufs.memory = input_memory_type_; 1157 reqbufs.memory = input_memory_type_;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 reqbufs.count = 0; 1239 reqbufs.count = 0;
1240 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; 1240 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
1241 reqbufs.memory = V4L2_MEMORY_MMAP; 1241 reqbufs.memory = V4L2_MEMORY_MMAP;
1242 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); 1242 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs);
1243 1243
1244 output_buffer_map_.clear(); 1244 output_buffer_map_.clear();
1245 free_output_buffers_.clear(); 1245 free_output_buffers_.clear();
1246 } 1246 }
1247 1247
1248 } // namespace media 1248 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698