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 "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 exynos_device.reset(NULL); |
|
Ami GONE FROM CHROMIUM
2014/02/07 09:09:30
Can drop NULL (scoped_ptr::reset(NULL) is equiv to
shivdasp
2014/02/10 13:31:17
Done.
| |
| 21 device.reset(NULL); | 22 scoped_ptr<TegraV4L2Device> tegra_device(new TegraV4L2Device(egl_context)); |
| 23 if (!tegra_device->Initialize()) { | |
| 24 DLOG(ERROR) << "Unable to open tegra v4l2 device "; | |
| 25 tegra_device.reset(NULL); | |
| 26 } | |
| 27 return tegra_device.PassAs<V4L2Device>(); | |
| 22 } | 28 } |
| 23 return device.PassAs<V4L2Device>(); | 29 return exynos_device.PassAs<V4L2Device>(); |
|
Ami GONE FROM CHROMIUM
2014/02/07 09:09:30
l.19-29 would be clearer as:
scoped_ptr<EV4L2D> e
Pawel Osciak
2014/02/10 06:36:17
+1 to this, but I don't think DLOGging failing to
shivdasp
2014/02/10 13:31:17
Agreed. Will make this change in next patchset.
O
| |
| 24 } | 30 } |
| 25 } // namespace content | 31 } // namespace content |
| OLD | NEW |