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 "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
6 #include "content/common/gpu/media/exynos_v4l2_video_device.h" | 6 #include "content/common/gpu/media/exynos_v4l2_video_device.h" |
| 7 #include "content/common/gpu/media/tegra_v4l2_video_device.h" |
7 | 8 |
8 namespace content { | 9 namespace content { |
9 | 10 |
10 V4L2Device::V4L2Device() {} | 11 V4L2Device::V4L2Device() {} |
11 | 12 |
12 V4L2Device::~V4L2Device() {} | 13 V4L2Device::~V4L2Device() {} |
13 | 14 |
14 // static | 15 // static |
15 scoped_ptr<V4L2Device> V4L2Device::Create() { | 16 scoped_ptr<V4L2Device> V4L2Device::Create(EGLContext egl_context) { |
16 DVLOG(3) << __PRETTY_FUNCTION__; | 17 DVLOG(3) << __PRETTY_FUNCTION__; |
17 | 18 |
18 scoped_ptr<ExynosV4L2Device> device(new ExynosV4L2Device()); | 19 scoped_ptr<ExynosV4L2Device> exynos_device(new ExynosV4L2Device()); |
19 if (!device->Initialize()) { | 20 if (exynos_device->Initialize()) |
20 // TODO(shivdasp): Try and create other V4L2Devices. | 21 return exynos_device.PassAs<V4L2Device>(); |
21 device.reset(NULL); | 22 |
22 } | 23 scoped_ptr<TegraV4L2Device> tegra_device(new TegraV4L2Device(egl_context)); |
23 return device.PassAs<V4L2Device>(); | 24 if (tegra_device->Initialize()) |
| 25 return tegra_device.PassAs<V4L2Device>(); |
| 26 |
| 27 DLOG(ERROR) << "Failed to create V4L2Device"; |
| 28 return scoped_ptr<V4L2Device>(); |
24 } | 29 } |
25 } // namespace content | 30 } // namespace content |
OLD | NEW |