| 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 // Ozone window system used by VaapiVideoDecodeAccelerator to produce | |
| 7 // output pictures. | |
| 8 | |
| 9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_DRM_PICTURE_H_ | |
| 10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_DRM_PICTURE_H_ | |
| 11 | |
| 12 #include <stdint.h> | |
| 13 | |
| 14 #include "base/macros.h" | |
| 15 #include "base/memory/ref_counted.h" | |
| 16 #include "base/memory/weak_ptr.h" | |
| 17 #include "content/common/gpu/media/vaapi_picture.h" | |
| 18 #include "ui/gfx/buffer_types.h" | |
| 19 #include "ui/gfx/geometry/size.h" | |
| 20 | |
| 21 namespace gl { | |
| 22 class GLImage; | |
| 23 } | |
| 24 | |
| 25 namespace ui { | |
| 26 class NativePixmap; | |
| 27 } | |
| 28 | |
| 29 namespace content { | |
| 30 | |
| 31 class VaapiWrapper; | |
| 32 | |
| 33 // Implementation of VaapiPicture for the ozone/drm backed chromium. | |
| 34 class VaapiDrmPicture : public VaapiPicture { | |
| 35 public: | |
| 36 VaapiDrmPicture(const scoped_refptr<VaapiWrapper>& vaapi_wrapper, | |
| 37 const MakeGLContextCurrentCallback& make_context_current_cb, | |
| 38 int32_t picture_buffer_id, | |
| 39 uint32_t texture_id, | |
| 40 const gfx::Size& size); | |
| 41 | |
| 42 ~VaapiDrmPicture() override; | |
| 43 | |
| 44 bool Initialize() override; | |
| 45 | |
| 46 bool DownloadFromSurface(const scoped_refptr<VASurface>& va_surface) override; | |
| 47 | |
| 48 scoped_refptr<gl::GLImage> GetImageToBind() override; | |
| 49 | |
| 50 bool AllowOverlay() const override; | |
| 51 | |
| 52 private: | |
| 53 scoped_refptr<VaapiWrapper> vaapi_wrapper_; | |
| 54 MakeGLContextCurrentCallback make_context_current_cb_; | |
| 55 | |
| 56 // Ozone buffer, the storage of the EGLImage and the VASurface. | |
| 57 scoped_refptr<ui::NativePixmap> pixmap_; | |
| 58 | |
| 59 // EGLImage bound to the GL textures used by the VDA client. | |
| 60 scoped_refptr<gl::GLImage> gl_image_; | |
| 61 | |
| 62 // VASurface used to transfer from the decoder's pixel format. | |
| 63 scoped_refptr<VASurface> va_surface_; | |
| 64 | |
| 65 DISALLOW_COPY_AND_ASSIGN(VaapiDrmPicture); | |
| 66 }; | |
| 67 | |
| 68 } // namespace content | |
| 69 | |
| 70 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_DRM_PICTURE_H_ | |
| OLD | NEW |