Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/bind.h" | |
| 6 #include "base/callback.h" | |
| 7 #include "content/common/gpu/media/vaapi_picture_provider.h" | |
| 8 #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.
| |
| 9 #include "content/common/gpu/media/vaapi_picture_provider_drm.h" | |
| 10 #else | |
| 11 #include "content/common/gpu/media/vaapi_picture_provider_x11.h" | |
| 12 #endif | |
| 13 #include "ui/gl/gl_context_glx.h" | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 VaapiPictureProvider::~VaapiPictureProvider() { | |
| 18 } | |
| 19 | |
| 20 scoped_ptr<VaapiPictureProvider> VaapiPictureProvider::Create( | |
| 21 VADisplay va_display, | |
| 22 gfx::GLContext* gl_context, | |
| 23 const base::Callback<bool(void)> make_context_current) { | |
| 24 scoped_ptr<VaapiPictureProvider> provider; | |
| 25 | |
| 26 #if defined(USE_X11) | |
| 27 provider.reset( | |
| 28 new X11VaapiPictureProvider(va_display, | |
| 29 static_cast<gfx::GLContextGLX*>(gl_context), | |
| 30 make_context_current)); | |
| 31 #else | |
| 32 provider.reset(new DrmVaapiPictureProvider(va_display, make_context_current)); | |
| 33 #endif // USE_X11 | |
| 34 | |
| 35 if (!provider->Initialize()) | |
| 36 provider.reset(); | |
| 37 | |
| 38 return provider.Pass(); | |
| 39 } | |
| 40 | |
| 41 } // namespace content | |
| OLD | NEW |