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 #include "content/common/gpu/media/vaapi_wrapper.h" |
| 9 #include "ui/gl/gl_context_glx.h" |
| 10 #if !defined(USE_X11) |
| 11 #include "content/common/gpu/media/vaapi_picture_provider_drm.h" |
| 12 #else |
| 13 #include "content/common/gpu/media/vaapi_picture_provider_x11.h" |
| 14 #endif |
| 15 |
| 16 namespace content { |
| 17 |
| 18 VaapiPictureProvider::VaapiPictureProvider() { |
| 19 } |
| 20 |
| 21 VaapiPictureProvider::~VaapiPictureProvider() { |
| 22 } |
| 23 |
| 24 scoped_ptr<VaapiPictureProvider> VaapiPictureProvider::Create( |
| 25 scoped_refptr<VaapiWrapper> vaapi_wrapper, |
| 26 gfx::GLContext* gl_context, |
| 27 const base::Callback<bool(void)> make_context_current) { |
| 28 scoped_ptr<VaapiPictureProvider> provider; |
| 29 |
| 30 #if defined(USE_X11) |
| 31 provider.reset( |
| 32 new X11VaapiPictureProvider(vaapi_wrapper, |
| 33 static_cast<gfx::GLContextGLX*>(gl_context), |
| 34 make_context_current)); |
| 35 #else |
| 36 provider.reset( |
| 37 new DrmVaapiPictureProvider(vaapi_wrapper, make_context_current)); |
| 38 #endif // USE_X11 |
| 39 |
| 40 if (!provider->Initialize()) |
| 41 provider.reset(); |
| 42 |
| 43 return provider.Pass(); |
| 44 } |
| 45 |
| 46 } // namespace content |
OLD | NEW |