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/ref_counted.h" | |
14 #include "content/common/gpu/media/vaapi_picture.h" | |
15 #include "ui/gfx/size.h" | |
16 | |
17 namespace gfx { | |
18 class GLImageLinuxDMABuffer; | |
19 } | |
20 | |
21 namespace ui { | |
22 class NativePixmap; | |
23 } | |
24 | |
25 namespace content { | |
26 | |
27 class VaapiWrapper; | |
28 | |
29 // Implementation of VaapiPicture for the ozone/drm backed chromium. | |
30 class VaapiDrmPicture : public VaapiPicture { | |
31 public: | |
32 VaapiDrmPicture(VaapiWrapper* vaapi_wrapper, | |
33 const base::Callback<bool(void)>& make_context_current, | |
34 int32 picture_buffer_id, | |
35 uint32 texture_id, | |
36 const gfx::Size& size); | |
37 | |
38 ~VaapiDrmPicture() override; | |
39 | |
40 bool Initialize() override; | |
41 | |
42 bool DownloadFromSurface(const scoped_refptr<VASurface>& va_surface) override; | |
43 | |
44 private: | |
45 VaapiWrapper* vaapi_wrapper_; // Not owned. | |
46 base::Callback<bool(void)> make_context_current_; | |
47 | |
48 // Ozone buffer, the storage of the EGLImage and the VASurface. | |
Pawel Osciak
2014/12/29 00:08:01
I don't think the pixmap is also the storage of va
llandwerlin-old
2014/12/29 02:30:34
The pixmap is the storage of both the VASurface an
| |
49 scoped_refptr<ui::NativePixmap> pixmap_; | |
Pawel Osciak
2014/12/29 00:08:01
Did scoped_ptrs not work out?
llandwerlin-old
2014/12/29 02:30:34
No, the classes implementing base::RefCounted have
| |
50 | |
51 // EGLImage bound to the GL textures used by the VDA client. | |
52 scoped_refptr<gfx::GLImageLinuxDMABuffer> gl_image_; | |
53 | |
54 // VASurface used to transfer from NV12 pixel format. | |
Pawel Osciak
2014/12/29 00:08:01
I don't think we explicitly use nv12 (or any forma
llandwerlin-old
2014/12/29 02:30:34
Ok, I won't make reference to the input format her
| |
55 scoped_refptr<VASurface> va_surface_; | |
56 | |
57 DISALLOW_COPY_AND_ASSIGN(VaapiDrmPicture); | |
58 }; | |
59 | |
60 } // namespace content | |
61 | |
62 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_DRM_PICTURE_H_ | |
OLD | NEW |