| 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 <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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 for (; device_->Ioctl(VIDIOC_ENUM_FMT, &fmtdesc) == 0; ++fmtdesc.index) { | 299 for (; device_->Ioctl(VIDIOC_ENUM_FMT, &fmtdesc) == 0; ++fmtdesc.index) { |
| 300 switch (fmtdesc.pixelformat) { | 300 switch (fmtdesc.pixelformat) { |
| 301 case V4L2_PIX_FMT_H264: | 301 case V4L2_PIX_FMT_H264: |
| 302 profile.profile = media::H264PROFILE_MAIN; | 302 profile.profile = media::H264PROFILE_MAIN; |
| 303 profiles.push_back(profile); | 303 profiles.push_back(profile); |
| 304 break; | 304 break; |
| 305 case V4L2_PIX_FMT_VP8: | 305 case V4L2_PIX_FMT_VP8: |
| 306 profile.profile = media::VP8PROFILE_ANY; | 306 profile.profile = media::VP8PROFILE_ANY; |
| 307 profiles.push_back(profile); | 307 profiles.push_back(profile); |
| 308 break; | 308 break; |
| 309 case V4L2_PIX_FMT_VP9: |
| 310 profile.profile = media::VP9PROFILE_ANY; |
| 311 profiles.push_back(profile); |
| 312 break; |
| 309 } | 313 } |
| 310 } | 314 } |
| 311 | 315 |
| 312 return profiles; | 316 return profiles; |
| 313 } | 317 } |
| 314 | 318 |
| 315 void V4L2VideoEncodeAccelerator::FrameProcessed( | 319 void V4L2VideoEncodeAccelerator::FrameProcessed( |
| 316 bool force_keyframe, | 320 bool force_keyframe, |
| 317 const scoped_refptr<media::VideoFrame>& frame) { | 321 const scoped_refptr<media::VideoFrame>& frame) { |
| 318 DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); | 322 DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 reqbufs.count = 0; | 1149 reqbufs.count = 0; |
| 1146 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; | 1150 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; |
| 1147 reqbufs.memory = V4L2_MEMORY_MMAP; | 1151 reqbufs.memory = V4L2_MEMORY_MMAP; |
| 1148 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); | 1152 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); |
| 1149 | 1153 |
| 1150 output_buffer_map_.clear(); | 1154 output_buffer_map_.clear(); |
| 1151 free_output_buffers_.clear(); | 1155 free_output_buffers_.clear(); |
| 1152 } | 1156 } |
| 1153 | 1157 |
| 1154 } // namespace content | 1158 } // namespace content |
| OLD | NEW |