Chromium Code Reviews| 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 <dlfcn.h> | 5 #include <dlfcn.h> |
| 6 #include <errno.h> | 6 #include <errno.h> |
| 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 <sys/eventfd.h> | 10 #include <sys/eventfd.h> |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 // TODO(posciak): crbug.com/450898. | 249 // TODO(posciak): crbug.com/450898. |
| 250 #if defined(ARCH_CPU_ARMEL) | 250 #if defined(ARCH_CPU_ARMEL) |
| 251 if (!gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) { | 251 if (!gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) { |
| 252 LOG(ERROR) << "Initialize(): context does not have EGL_KHR_fence_sync"; | 252 LOG(ERROR) << "Initialize(): context does not have EGL_KHR_fence_sync"; |
| 253 return false; | 253 return false; |
| 254 } | 254 } |
| 255 #endif | 255 #endif |
| 256 | 256 |
| 257 // Capabilities check. | 257 // Capabilities check. |
| 258 struct v4l2_capability caps; | 258 struct v4l2_capability caps; |
| 259 const __u32 kCapsRequired = | 259 const __u32 kCapsRequired = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING; |
| 260 V4L2_CAP_VIDEO_CAPTURE_MPLANE | | |
| 261 V4L2_CAP_VIDEO_OUTPUT_MPLANE | | |
| 262 V4L2_CAP_STREAMING; | |
| 263 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYCAP, &caps); | 260 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYCAP, &caps); |
| 264 if ((caps.capabilities & kCapsRequired) != kCapsRequired) { | 261 if ((caps.capabilities & kCapsRequired) != kCapsRequired) { |
| 265 LOG(ERROR) << "Initialize(): ioctl() failed: VIDIOC_QUERYCAP" | 262 const __u32 kCapsRequiredCompat = V4L2_CAP_VIDEO_CAPTURE_MPLANE | |
|
Pawel Osciak
2015/12/29 10:07:47
Please add a short comment here and in VEA that th
wuchengli
2015/12/29 11:28:07
Done.
| |
| 266 ", caps check failed: 0x" << std::hex << caps.capabilities; | 263 V4L2_CAP_VIDEO_OUTPUT_MPLANE | |
| 267 return false; | 264 V4L2_CAP_STREAMING; |
| 265 if ((caps.capabilities & kCapsRequiredCompat) != kCapsRequiredCompat) { | |
| 266 LOG(ERROR) << "Initialize(): ioctl() failed: VIDIOC_QUERYCAP" | |
| 267 ", caps check failed: 0x" << std::hex << caps.capabilities; | |
| 268 return false; | |
| 269 } | |
| 268 } | 270 } |
| 269 | 271 |
| 270 if (!SetupFormats()) | 272 if (!SetupFormats()) |
| 271 return false; | 273 return false; |
| 272 | 274 |
| 273 // Subscribe to the resolution change event. | 275 // Subscribe to the resolution change event. |
| 274 struct v4l2_event_subscription sub; | 276 struct v4l2_event_subscription sub; |
| 275 memset(&sub, 0, sizeof(sub)); | 277 memset(&sub, 0, sizeof(sub)); |
| 276 sub.type = V4L2_EVENT_SOURCE_CHANGE; | 278 sub.type = V4L2_EVENT_SOURCE_CHANGE; |
| 277 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_SUBSCRIBE_EVENT, &sub); | 279 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_SUBSCRIBE_EVENT, &sub); |
| (...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2044 | 2046 |
| 2045 void V4L2VideoDecodeAccelerator::PictureCleared() { | 2047 void V4L2VideoDecodeAccelerator::PictureCleared() { |
| 2046 DVLOG(3) << "PictureCleared(). clearing count=" << picture_clearing_count_; | 2048 DVLOG(3) << "PictureCleared(). clearing count=" << picture_clearing_count_; |
| 2047 DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current()); | 2049 DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current()); |
| 2048 DCHECK_GT(picture_clearing_count_, 0); | 2050 DCHECK_GT(picture_clearing_count_, 0); |
| 2049 picture_clearing_count_--; | 2051 picture_clearing_count_--; |
| 2050 SendPictureReady(); | 2052 SendPictureReady(); |
| 2051 } | 2053 } |
| 2052 | 2054 |
| 2053 } // namespace content | 2055 } // namespace content |
| OLD | NEW |