Index: content/common/gpu/media/vaapi_picture_provider_x11.h |
diff --git a/content/common/gpu/media/vaapi_picture_provider_x11.h b/content/common/gpu/media/vaapi_picture_provider_x11.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cb0d7c912ec0a18091df04861e00e86d845da173 |
--- /dev/null |
+++ b/content/common/gpu/media/vaapi_picture_provider_x11.h |
@@ -0,0 +1,50 @@ |
+// 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. |
+// |
+// This file contains an implementation of picture allocation for the |
+// X11 window system used by VaapiPictureProvider to produce output |
+// pictures. |
+ |
+#ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_X11_H_ |
+#define CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_X11_H_ |
+ |
+#include "base/callback.h" |
+#include "content/common/gpu/media/vaapi_picture_provider.h" |
+#include "third_party/libva/va/va.h" |
+#include "ui/gfx/size.h" |
+#include "ui/gl/gl_bindings.h" |
+#include "ui/gl/gl_context_glx.h" |
+ |
+namespace content { |
+ |
+class X11VaapiPictureProvider : public VaapiPictureProvider { |
+ public: |
+ X11VaapiPictureProvider( |
+ VADisplay va_display, |
+ gfx::GLContextGLX* glx_context, |
+ const base::Callback<bool(void)> make_context_current); |
+ virtual ~X11VaapiPictureProvider(); |
+ |
+ virtual scoped_ptr<VaapiPictureProvider::Picture> CreatePicture( |
+ int32 picture_buffer_id, |
+ uint32 texture_id, |
+ const gfx::Size& size) OVERRIDE; |
+ |
+ virtual bool SetCodedSurfacesSize(const gfx::Size& size) OVERRIDE; |
+ |
+ private: |
+ virtual bool Initialize() OVERRIDE; |
+ |
+ gfx::GLContextGLX* glx_context_; |
+ base::Callback<bool(void)> make_context_current_; |
+ |
+ Display* x_display_; |
+ GLXFBConfig fb_config_; |
+ |
+ VADisplay va_display_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_X11_H_ |