| 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 | 5 |
| 6 #include "media/gpu/generic_v4l2_device.h" | 6 #include "media/gpu/generic_v4l2_device.h" |
| 7 | 7 |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <libdrm/drm_fourcc.h> | 10 #include <libdrm/drm_fourcc.h> |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 204 } |
| 205 | 205 |
| 206 return dmabuf_fds; | 206 return dmabuf_fds; |
| 207 } | 207 } |
| 208 | 208 |
| 209 bool GenericV4L2Device::CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) { | 209 bool GenericV4L2Device::CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) { |
| 210 static uint32_t kEGLImageDrmFmtsSupported[] = { | 210 static uint32_t kEGLImageDrmFmtsSupported[] = { |
| 211 DRM_FORMAT_ARGB8888, | 211 DRM_FORMAT_ARGB8888, |
| 212 #if defined(ARCH_CPU_ARMEL) | 212 #if defined(ARCH_CPU_ARMEL) |
| 213 DRM_FORMAT_NV12, | 213 DRM_FORMAT_NV12, |
| 214 DRM_FORMAT_YVU420, |
| 214 #endif | 215 #endif |
| 215 }; | 216 }; |
| 216 | 217 |
| 217 return std::find( | 218 return std::find( |
| 218 kEGLImageDrmFmtsSupported, | 219 kEGLImageDrmFmtsSupported, |
| 219 kEGLImageDrmFmtsSupported + arraysize(kEGLImageDrmFmtsSupported), | 220 kEGLImageDrmFmtsSupported + arraysize(kEGLImageDrmFmtsSupported), |
| 220 V4L2PixFmtToDrmFormat(v4l2_pixfmt)) != | 221 V4L2PixFmtToDrmFormat(v4l2_pixfmt)) != |
| 221 kEGLImageDrmFmtsSupported + arraysize(kEGLImageDrmFmtsSupported); | 222 kEGLImageDrmFmtsSupported + arraysize(kEGLImageDrmFmtsSupported); |
| 222 } | 223 } |
| 223 | 224 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 StubPathMap paths; | 316 StubPathMap paths; |
| 316 paths[kModuleV4l2].push_back(kV4l2Lib); | 317 paths[kModuleV4l2].push_back(kV4l2Lib); |
| 317 | 318 |
| 318 return InitializeStubs(paths); | 319 return InitializeStubs(paths); |
| 319 #else | 320 #else |
| 320 return true; | 321 return true; |
| 321 #endif | 322 #endif |
| 322 } | 323 } |
| 323 | 324 |
| 324 } // namespace media | 325 } // namespace media |
| OLD | NEW |