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 "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 |
| 18 namespace gfx { |
| 19 class GLImageEGL; |
| 20 } |
| 21 |
| 22 namespace ui { |
| 23 class NativePixmap; |
| 24 } |
| 25 |
| 26 namespace content { |
| 27 |
| 28 class VaapiWrapper; |
| 29 |
| 30 // Implementation of VaapiPicture for the ozone/drm backed chromium. |
| 31 class VaapiDrmPicture : public VaapiPicture { |
| 32 public: |
| 33 VaapiDrmPicture(base::WeakPtr<VaapiWrapper> vaapi_wrapper, |
| 34 const base::Callback<bool(void)> make_context_current, |
| 35 int32 picture_buffer_id, |
| 36 uint32 texture_id, |
| 37 const gfx::Size& size); |
| 38 |
| 39 virtual ~VaapiDrmPicture(); |
| 40 |
| 41 bool Initialize() override; |
| 42 |
| 43 virtual bool DownloadFromSurface( |
| 44 const scoped_refptr<VASurface>& va_surface) override; |
| 45 |
| 46 virtual void DisposeVaapi() override; |
| 47 |
| 48 private: |
| 49 base::WeakPtr<VaapiWrapper> vaapi_wrapper_; |
| 50 base::Callback<bool(void)> make_context_current_; |
| 51 scoped_refptr<VASurface> va_surface_; |
| 52 scoped_refptr<ui::NativePixmap> pixmap_; |
| 53 scoped_refptr<gfx::GLImageEGL> egl_image_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(VaapiDrmPicture); |
| 56 }; |
| 57 |
| 58 } // namespace content |
| 59 |
| 60 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_DRM_PICTURE_H_ |
OLD | NEW |