Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: content/common/gpu/media/v4l2_video_device.cc

Issue 137023008: Add support for Tegra V4L2 VDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor nit Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « content/common/gpu/media/v4l2_video_device.h ('k') | content/common/gpu/media/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698