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

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

Issue 288903002: fix sign-compare warning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
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 <fcntl.h> 5 #include <fcntl.h>
6 #include <linux/videodev2.h> 6 #include <linux/videodev2.h>
7 #include <poll.h> 7 #include <poll.h>
8 #include <sys/eventfd.h> 8 #include <sys/eventfd.h>
9 #include <sys/ioctl.h> 9 #include <sys/ioctl.h>
10 #include <sys/mman.h> 10 #include <sys/mman.h>
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 device_input_format_ = media::VideoFrame::UNKNOWN; 865 device_input_format_ = media::VideoFrame::UNKNOWN;
866 input_planes_count_ = 0; 866 input_planes_count_ = 0;
867 867
868 uint32 input_format_fourcc = 868 uint32 input_format_fourcc =
869 V4L2Device::VideoFrameFormatToV4L2PixFmt(input_format); 869 V4L2Device::VideoFrameFormatToV4L2PixFmt(input_format);
870 if (!input_format_fourcc) { 870 if (!input_format_fourcc) {
871 DVLOG(1) << "Unsupported input format"; 871 DVLOG(1) << "Unsupported input format";
872 return false; 872 return false;
873 } 873 }
874 874
875 size_t input_planes_count = media::VideoFrame::NumPlanes(input_format); 875 int input_planes_count = media::VideoFrame::NumPlanes(input_format);
xhwang 2014/05/15 00:51:45 What problem is this causing? converting from int
yunlian 2014/05/15 16:34:13 The problem is in the DCHECK_LE in the following l
876 DCHECK_LE(input_planes_count, VIDEO_MAX_PLANES); 876 DCHECK_LE(input_planes_count, VIDEO_MAX_PLANES);
877 877
878 // First see if we the device can use the provided input_format directly. 878 // First see if we the device can use the provided input_format directly.
879 struct v4l2_format format; 879 struct v4l2_format format;
880 memset(&format, 0, sizeof(format)); 880 memset(&format, 0, sizeof(format));
881 format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; 881 format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
882 format.fmt.pix_mp.width = visible_size_.width(); 882 format.fmt.pix_mp.width = visible_size_.width();
883 format.fmt.pix_mp.height = visible_size_.height(); 883 format.fmt.pix_mp.height = visible_size_.height();
884 format.fmt.pix_mp.pixelformat = input_format_fourcc; 884 format.fmt.pix_mp.pixelformat = input_format_fourcc;
885 format.fmt.pix_mp.num_planes = input_planes_count; 885 format.fmt.pix_mp.num_planes = input_planes_count;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 reqbufs.count = 0; 1087 reqbufs.count = 0;
1088 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; 1088 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
1089 reqbufs.memory = V4L2_MEMORY_MMAP; 1089 reqbufs.memory = V4L2_MEMORY_MMAP;
1090 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); 1090 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs);
1091 1091
1092 output_buffer_map_.clear(); 1092 output_buffer_map_.clear();
1093 free_output_buffers_.clear(); 1093 free_output_buffers_.clear();
1094 } 1094 }
1095 1095
1096 } // namespace content 1096 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698