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

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

Issue 490233002: VaapiVideoAccelerator: make Vaapi accelerator work with ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing modifications in video accelerators Created 6 years, 2 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/vaapi_picture_provider.cc
diff --git a/content/common/gpu/media/vaapi_picture_provider.cc b/content/common/gpu/media/vaapi_picture_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2dc8a97fc94ad926a8a9aaf8dfb802259eca23dc
--- /dev/null
+++ b/content/common/gpu/media/vaapi_picture_provider.cc
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/bind.h"
+#include "base/callback.h"
+#include "content/common/gpu/media/vaapi_picture_provider.h"
+#if !defined(USE_X11)
Pawel Osciak 2014/10/08 08:17:22 Conditionally compiled headers should go below the
llandwerlin-old 2014/10/08 09:31:17 Acknowledged.
+#include "content/common/gpu/media/vaapi_picture_provider_drm.h"
+#else
+#include "content/common/gpu/media/vaapi_picture_provider_x11.h"
+#endif
+#include "ui/gl/gl_context_glx.h"
+
+namespace content {
+
+VaapiPictureProvider::~VaapiPictureProvider() {
+}
+
+scoped_ptr<VaapiPictureProvider> VaapiPictureProvider::Create(
+ VADisplay va_display,
+ gfx::GLContext* gl_context,
+ const base::Callback<bool(void)> make_context_current) {
+ scoped_ptr<VaapiPictureProvider> provider;
+
+#if defined(USE_X11)
+ provider.reset(
+ new X11VaapiPictureProvider(va_display,
+ static_cast<gfx::GLContextGLX*>(gl_context),
+ make_context_current));
+#else
+ provider.reset(new DrmVaapiPictureProvider(va_display, make_context_current));
+#endif // USE_X11
+
+ if (!provider->Initialize())
+ provider.reset();
+
+ return provider.Pass();
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698