Index: content/common/gpu/media/v4l2_video_device.cc |
diff --git a/content/common/gpu/media/v4l2_video_device.cc b/content/common/gpu/media/v4l2_video_device.cc |
index c1b26586862709f73edcfc4d5c50f00629ea5db7..d63cd4e27522352477225859ab029ee3175bf811 100644 |
--- a/content/common/gpu/media/v4l2_video_device.cc |
+++ b/content/common/gpu/media/v4l2_video_device.cc |
@@ -4,6 +4,7 @@ |
#include "base/debug/trace_event.h" |
#include "content/common/gpu/media/exynos_v4l2_video_device.h" |
+#include "content/common/gpu/media/tegra_v4l2_video_device.h" |
namespace content { |
@@ -12,14 +13,18 @@ V4L2Device::V4L2Device() {} |
V4L2Device::~V4L2Device() {} |
// static |
-scoped_ptr<V4L2Device> V4L2Device::Create() { |
+scoped_ptr<V4L2Device> V4L2Device::Create(EGLContext egl_context) { |
DVLOG(3) << __PRETTY_FUNCTION__; |
- scoped_ptr<ExynosV4L2Device> device(new ExynosV4L2Device()); |
- if (!device->Initialize()) { |
- // TODO(shivdasp): Try and create other V4L2Devices. |
- device.reset(NULL); |
- } |
- return device.PassAs<V4L2Device>(); |
+ scoped_ptr<ExynosV4L2Device> exynos_device(new ExynosV4L2Device()); |
+ if (exynos_device->Initialize()) |
+ return exynos_device.PassAs<V4L2Device>(); |
+ |
+ scoped_ptr<TegraV4L2Device> tegra_device(new TegraV4L2Device(egl_context)); |
+ if (tegra_device->Initialize()) |
+ return tegra_device.PassAs<V4L2Device>(); |
+ |
+ DLOG(ERROR) << "Failed to create V4L2Device"; |
+ return scoped_ptr<V4L2Device>(); |
} |
} // namespace content |