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.
5 // This file contains an implementation of picture allocation for the
6 // X11 window system used by VaapiVideoDecodeAccelerator to produce
9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_
10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_
12 #include "base/callback.h"
13 #include "base/memory/ref_counted.h"
14 #include "content/common/gpu/media/vaapi_picture.h"
15 #include "ui/gfx/geometry/size.h"
16 #include "ui/gl/gl_bindings.h"
27 // Implementation of VaapiPicture for the X11 backed chromium.
28 class VaapiTFPPicture
: public VaapiPicture
{
30 VaapiTFPPicture(VaapiWrapper
* vaapi_wrapper
,
31 const base::Callback
<bool(void)> make_context_current
,
32 int32 picture_buffer_id
,
34 const gfx::Size
& size
);
36 ~VaapiTFPPicture() override
;
38 bool Initialize() override
;
40 bool DownloadFromSurface(const scoped_refptr
<VASurface
>& va_surface
) override
;
42 scoped_refptr
<gfx::GLImage
> GetImageToBind() override
;
45 VaapiWrapper
* vaapi_wrapper_
; // Not owned.
47 base::Callback
<bool(void)> make_context_current_
;
51 scoped_refptr
<gfx::GLImageGLX
> glx_image_
;
53 DISALLOW_COPY_AND_ASSIGN(VaapiTFPPicture
);
56 } // namespace content
58 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_