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 |