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 <stdint.h> | |
13 | |
14 #include "base/macros.h" | |
15 #include "base/memory/ref_counted.h" | |
16 #include "content/common/gpu/media/vaapi_picture.h" | |
17 #include "ui/gfx/geometry/size.h" | |
18 #include "ui/gl/gl_bindings.h" | |
19 | |
20 namespace gfx { | |
21 class GLContextGLX; | |
22 } | |
23 | |
24 namespace gl { | |
25 class GLImageGLX; | |
26 } | |
27 | |
28 namespace content { | |
29 | |
30 class VaapiWrapper; | |
31 | |
32 // Implementation of VaapiPicture for the X11 backed chromium. | |
33 class VaapiTFPPicture : public VaapiPicture { | |
34 public: | |
35 VaapiTFPPicture(const scoped_refptr<VaapiWrapper>& vaapi_wrapper, | |
36 const MakeGLContextCurrentCallback& make_context_current_cb, | |
37 int32_t picture_buffer_id, | |
38 uint32_t texture_id, | |
39 const gfx::Size& size); | |
40 | |
41 ~VaapiTFPPicture() override; | |
42 | |
43 bool Initialize() override; | |
44 | |
45 bool DownloadFromSurface(const scoped_refptr<VASurface>& va_surface) override; | |
46 | |
47 scoped_refptr<gl::GLImage> GetImageToBind() override; | |
48 | |
49 private: | |
50 scoped_refptr<VaapiWrapper> vaapi_wrapper_; | |
51 | |
52 MakeGLContextCurrentCallback make_context_current_cb_; | |
53 Display* x_display_; | |
54 | |
55 Pixmap x_pixmap_; | |
56 scoped_refptr<gl::GLImageGLX> glx_image_; | |
57 | |
58 DISALLOW_COPY_AND_ASSIGN(VaapiTFPPicture); | |
59 }; | |
60 | |
61 } // namespace content | |
62 | |
63 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ | |
OLD | NEW |