OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains an implementation of picture allocation for the | 5 // This file contains an implementation of picture allocation for the |
6 // X11 window system used by VaapiVideoDecodeAccelerator to produce | 6 // X11 window system used by VaapiVideoDecodeAccelerator to produce |
7 // output pictures. | 7 // output pictures. |
8 | 8 |
9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ | 9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ |
10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ | 10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ |
(...skipping 12 matching lines...) Expand all Loading... |
23 class GLImageGLX; | 23 class GLImageGLX; |
24 } | 24 } |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 | 27 |
28 class VaapiWrapper; | 28 class VaapiWrapper; |
29 | 29 |
30 // Implementation of VaapiPicture for the X11 backed chromium. | 30 // Implementation of VaapiPicture for the X11 backed chromium. |
31 class VaapiTFPPicture : public VaapiPicture { | 31 class VaapiTFPPicture : public VaapiPicture { |
32 public: | 32 public: |
33 VaapiTFPPicture(VaapiWrapper* vaapi_wrapper, | 33 VaapiTFPPicture(const scoped_refptr<VaapiWrapper>& vaapi_wrapper, |
34 const base::Callback<bool(void)> make_context_current, | 34 const base::Callback<bool(void)> make_context_current, |
35 int32 picture_buffer_id, | 35 int32 picture_buffer_id, |
36 uint32 texture_id, | 36 uint32 texture_id, |
37 const gfx::Size& size); | 37 const gfx::Size& size); |
38 | 38 |
39 ~VaapiTFPPicture() override; | 39 ~VaapiTFPPicture() override; |
40 | 40 |
41 bool Initialize() override; | 41 bool Initialize() override; |
42 | 42 |
43 bool DownloadFromSurface(const scoped_refptr<VASurface>& va_surface) override; | 43 bool DownloadFromSurface(const scoped_refptr<VASurface>& va_surface) override; |
44 | 44 |
45 scoped_refptr<gl::GLImage> GetImageToBind() override; | 45 scoped_refptr<gl::GLImage> GetImageToBind() override; |
46 | 46 |
47 private: | 47 private: |
48 VaapiWrapper* vaapi_wrapper_; // Not owned. | 48 scoped_refptr<VaapiWrapper> vaapi_wrapper_; |
49 | 49 |
50 base::Callback<bool(void)> make_context_current_; | 50 base::Callback<bool(void)> make_context_current_; |
51 Display* x_display_; | 51 Display* x_display_; |
52 | 52 |
53 Pixmap x_pixmap_; | 53 Pixmap x_pixmap_; |
54 scoped_refptr<gl::GLImageGLX> glx_image_; | 54 scoped_refptr<gl::GLImageGLX> glx_image_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(VaapiTFPPicture); | 56 DISALLOW_COPY_AND_ASSIGN(VaapiTFPPicture); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace content | 59 } // namespace content |
60 | 60 |
61 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ | 61 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ |
OLD | NEW |