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 VaapiVideoDecodeAccelerator to produce |
| 7 // output pictures. |
| 8 |
| 9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ |
| 10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ |
| 11 |
| 12 #include "base/callback.h" |
| 13 #include "base/memory/weak_ptr.h" |
| 14 #include "content/common/gpu/media/vaapi_picture.h" |
| 15 #include "third_party/libva/va/va.h" |
| 16 #include "ui/gfx/size.h" |
| 17 #include "ui/gl/gl_bindings.h" |
| 18 |
| 19 namespace gfx { |
| 20 class GLImageGLX; |
| 21 class GLContextGLX; |
| 22 } |
| 23 |
| 24 namespace content { |
| 25 |
| 26 class VaapiWrapper; |
| 27 |
| 28 // Implementation of VaapiPicture for the X11 backed chromium. |
| 29 class VaapiTFPPicture : public VaapiPicture { |
| 30 public: |
| 31 VaapiTFPPicture(base::WeakPtr<VaapiWrapper> vaapi_wrapper, |
| 32 gfx::GLContextGLX* glx_context, |
| 33 const base::Callback<bool(void)> make_context_current, |
| 34 int32 picture_buffer_id, |
| 35 uint32 texture_id, |
| 36 const gfx::Size& size); |
| 37 |
| 38 virtual ~VaapiTFPPicture(); |
| 39 |
| 40 bool Initialize() override; |
| 41 |
| 42 bool DownloadFromSurface(const scoped_refptr<VASurface>& va_surface) override; |
| 43 |
| 44 virtual void DisposeVaapi() override; |
| 45 |
| 46 private: |
| 47 base::WeakPtr<VaapiWrapper> vaapi_wrapper_; |
| 48 |
| 49 gfx::GLContextGLX* glx_context_; |
| 50 base::Callback<bool(void)> make_context_current_; |
| 51 Display* x_display_; |
| 52 |
| 53 Pixmap x_pixmap_; |
| 54 scoped_refptr<gfx::GLImageGLX> glx_image_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(VaapiTFPPicture); |
| 57 }; |
| 58 |
| 59 } // namespace content |
| 60 |
| 61 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ |
OLD | NEW |