| 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..f7be28f0347040b999a2dd6d7834564c72d30005
|
| --- /dev/null
|
| +++ b/content/common/gpu/media/vaapi_picture_provider.cc
|
| @@ -0,0 +1,46 @@
|
| +// 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"
|
| +#include "content/common/gpu/media/vaapi_wrapper.h"
|
| +#include "ui/gl/gl_context_glx.h"
|
| +#if !defined(USE_X11)
|
| +#include "content/common/gpu/media/vaapi_picture_provider_drm.h"
|
| +#else
|
| +#include "content/common/gpu/media/vaapi_picture_provider_x11.h"
|
| +#endif
|
| +
|
| +namespace content {
|
| +
|
| +VaapiPictureProvider::VaapiPictureProvider() {
|
| +}
|
| +
|
| +VaapiPictureProvider::~VaapiPictureProvider() {
|
| +}
|
| +
|
| +scoped_ptr<VaapiPictureProvider> VaapiPictureProvider::Create(
|
| + scoped_refptr<VaapiWrapper> vaapi_wrapper,
|
| + gfx::GLContext* gl_context,
|
| + const base::Callback<bool(void)> make_context_current) {
|
| + scoped_ptr<VaapiPictureProvider> provider;
|
| +
|
| +#if defined(USE_X11)
|
| + provider.reset(
|
| + new X11VaapiPictureProvider(vaapi_wrapper,
|
| + static_cast<gfx::GLContextGLX*>(gl_context),
|
| + make_context_current));
|
| +#else
|
| + provider.reset(
|
| + new DrmVaapiPictureProvider(vaapi_wrapper, make_context_current));
|
| +#endif // USE_X11
|
| +
|
| + if (!provider->Initialize())
|
| + provider.reset();
|
| +
|
| + return provider.Pass();
|
| +}
|
| +
|
| +} // namespace content
|
|
|