| 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 <libdrm/drm_fourcc.h> | 5 #include <libdrm/drm_fourcc.h> |
| 6 #include <linux/videodev2.h> | 6 #include <linux/videodev2.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "media/gpu/generic_v4l2_device.h" | 11 #include "media/gpu/generic_v4l2_device.h" |
| 12 #if defined(ARCH_CPU_ARMEL) | 12 #if defined(ARCH_CPU_ARMEL) |
| 13 #include "media/gpu/tegra_v4l2_device.h" | 13 #include "media/gpu/tegra_v4l2_device.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 namespace media { | 16 namespace media { |
| 17 | 17 |
| 18 V4L2Device::V4L2Device(Type type) : type_(type) {} | 18 V4L2Device::V4L2Device(Type type) : type_(type) {} |
| 19 | 19 |
| 20 V4L2Device::~V4L2Device() {} | 20 V4L2Device::~V4L2Device() {} |
| 21 | 21 |
| 22 // static | 22 // static |
| 23 bool V4L2Device::IsUsingLibV4L2() { |
| 24 #if defined(USE_LIBV4L2) |
| 25 return true; |
| 26 #else |
| 27 return false; |
| 28 #endif |
| 29 } |
| 30 |
| 31 // static |
| 23 scoped_refptr<V4L2Device> V4L2Device::Create(Type type) { | 32 scoped_refptr<V4L2Device> V4L2Device::Create(Type type) { |
| 24 DVLOG(3) << __PRETTY_FUNCTION__; | 33 DVLOG(3) << __PRETTY_FUNCTION__; |
| 25 | 34 |
| 26 scoped_refptr<GenericV4L2Device> generic_device(new GenericV4L2Device(type)); | 35 scoped_refptr<GenericV4L2Device> generic_device(new GenericV4L2Device(type)); |
| 27 if (generic_device->Initialize()) | 36 if (generic_device->Initialize()) |
| 28 return generic_device; | 37 return generic_device; |
| 29 | 38 |
| 30 #if defined(ARCH_CPU_ARMEL) | 39 #if defined(ARCH_CPU_ARMEL) |
| 31 scoped_refptr<TegraV4L2Device> tegra_device(new TegraV4L2Device(type)); | 40 scoped_refptr<TegraV4L2Device> tegra_device(new TegraV4L2Device(type)); |
| 32 if (tegra_device->Initialize()) | 41 if (tegra_device->Initialize()) |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 const auto iter = std::find_if( | 321 const auto iter = std::find_if( |
| 313 supported_profiles.begin(), supported_profiles.end(), | 322 supported_profiles.begin(), supported_profiles.end(), |
| 314 [profile](const media::VideoDecodeAccelerator::SupportedProfile& p) { | 323 [profile](const media::VideoDecodeAccelerator::SupportedProfile& p) { |
| 315 return profile == p.profile; | 324 return profile == p.profile; |
| 316 }); | 325 }); |
| 317 | 326 |
| 318 return iter != supported_profiles.end(); | 327 return iter != supported_profiles.end(); |
| 319 } | 328 } |
| 320 | 329 |
| 321 } // namespace media | 330 } // namespace media |
| OLD | NEW |