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

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

Issue 406893002: Fix DCHECKs in V4l2VideoDevice. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comments of IsValidPlane Created 6 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 | Annotate | Revision Log
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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 size_t adjusted_output_buffer_size = 853 size_t adjusted_output_buffer_size =
854 base::checked_cast<size_t>(format.fmt.pix_mp.plane_fmt[0].sizeimage); 854 base::checked_cast<size_t>(format.fmt.pix_mp.plane_fmt[0].sizeimage);
855 DCHECK_GE(adjusted_output_buffer_size, output_buffer_byte_size_); 855 DCHECK_GE(adjusted_output_buffer_size, output_buffer_byte_size_);
856 output_buffer_byte_size_ = adjusted_output_buffer_size; 856 output_buffer_byte_size_ = adjusted_output_buffer_size;
857 857
858 return true; 858 return true;
859 } 859 }
860 860
861 bool V4L2VideoEncodeAccelerator::NegotiateInputFormat( 861 bool V4L2VideoEncodeAccelerator::NegotiateInputFormat(
862 media::VideoFrame::Format input_format) { 862 media::VideoFrame::Format input_format) {
863 DVLOG(3) << "NegotiateInputFormat()";
863 DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); 864 DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
864 DCHECK(!input_streamon_); 865 DCHECK(!input_streamon_);
865 DCHECK(!output_streamon_); 866 DCHECK(!output_streamon_);
866 867
867 device_input_format_ = media::VideoFrame::UNKNOWN; 868 device_input_format_ = media::VideoFrame::UNKNOWN;
868 input_planes_count_ = 0; 869 input_planes_count_ = 0;
869 870
870 uint32 input_format_fourcc = 871 uint32 input_format_fourcc =
871 V4L2Device::VideoFrameFormatToV4L2PixFmt(input_format); 872 V4L2Device::VideoFrameFormatToV4L2PixFmt(input_format);
872 if (!input_format_fourcc) { 873 if (!input_format_fourcc) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 reqbufs.count = 0; 1090 reqbufs.count = 0;
1090 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; 1091 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
1091 reqbufs.memory = V4L2_MEMORY_MMAP; 1092 reqbufs.memory = V4L2_MEMORY_MMAP;
1092 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); 1093 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs);
1093 1094
1094 output_buffer_map_.clear(); 1095 output_buffer_map_.clear();
1095 free_output_buffers_.clear(); 1096 free_output_buffers_.clear();
1096 } 1097 }
1097 1098
1098 } // namespace content 1099 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698