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 // This file contains an implementation of picture allocation for the |
| 6 // X11 window system used by VaapiPictureProvider to produce output |
| 7 // pictures. |
| 8 |
| 9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_X11_H_ |
| 10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_X11_H_ |
| 11 |
| 12 #include "base/callback.h" |
| 13 #include "content/common/gpu/media/vaapi_picture_provider.h" |
| 14 #include "third_party/libva/va/va.h" |
| 15 #include "ui/gfx/size.h" |
| 16 #include "ui/gl/gl_bindings.h" |
| 17 #include "ui/gl/gl_context_glx.h" |
| 18 |
| 19 namespace content { |
| 20 |
| 21 class X11VaapiPictureProvider : public VaapiPictureProvider { |
| 22 public: |
| 23 X11VaapiPictureProvider( |
| 24 VADisplay va_display, |
| 25 gfx::GLContextGLX* glx_context, |
| 26 const base::Callback<bool(void)> make_context_current); |
| 27 virtual ~X11VaapiPictureProvider(); |
| 28 |
| 29 virtual scoped_ptr<VaapiPictureProvider::Picture> CreatePicture( |
| 30 int32 picture_buffer_id, |
| 31 uint32 texture_id, |
| 32 const gfx::Size& size) OVERRIDE; |
| 33 |
| 34 virtual bool SetCodedSurfacesSize(const gfx::Size& size) OVERRIDE; |
| 35 |
| 36 private: |
| 37 virtual bool Initialize() OVERRIDE; |
| 38 |
| 39 gfx::GLContextGLX* glx_context_; |
| 40 base::Callback<bool(void)> make_context_current_; |
| 41 |
| 42 Display* x_display_; |
| 43 GLXFBConfig fb_config_; |
| 44 |
| 45 VADisplay va_display_; |
| 46 }; |
| 47 |
| 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_X11_H_ |
OLD | NEW |