Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: content/common/gpu/media/vaapi_drm_picture.h

Issue 825163004: Add Vaapi support on Ozone/Freon (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // Ozone 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_DRM_PICTURE_H_
10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ 10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_DRM_PICTURE_H_
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "content/common/gpu/media/vaapi_picture.h" 14 #include "content/common/gpu/media/vaapi_picture.h"
15 #include "ui/gfx/size.h" 15 #include "ui/gfx/size.h"
16 #include "ui/gl/gl_bindings.h"
17 16
18 namespace gfx { 17 namespace gfx {
19 class GLImageGLX; 18 class GLImageLinuxDMABuffer;
20 class GLContextGLX; 19 }
20
21 namespace ui {
22 class NativePixmap;
21 } 23 }
22 24
23 namespace content { 25 namespace content {
24 26
25 class VaapiWrapper; 27 class VaapiWrapper;
26 28
27 // Implementation of VaapiPicture for the X11 backed chromium. 29 // Implementation of VaapiPicture for the ozone/drm backed chromium.
28 class VaapiTFPPicture : public VaapiPicture { 30 class VaapiDrmPicture : public VaapiPicture {
29 public: 31 public:
30 VaapiTFPPicture(VaapiWrapper* vaapi_wrapper, 32 VaapiDrmPicture(VaapiWrapper* vaapi_wrapper,
31 const base::Callback<bool(void)> make_context_current, 33 const base::Callback<bool(void)> make_context_current,
32 int32 picture_buffer_id, 34 int32 picture_buffer_id,
33 uint32 texture_id, 35 uint32 texture_id,
34 const gfx::Size& size); 36 const gfx::Size& size);
35 37
36 ~VaapiTFPPicture() override; 38 ~VaapiDrmPicture() override;
37 39
38 bool Initialize() override; 40 bool Initialize() override;
39 41
40 bool DownloadFromSurface(const scoped_refptr<VASurface>& va_surface) override; 42 bool DownloadFromSurface(const scoped_refptr<VASurface>& va_surface) override;
41 43
42 private: 44 private:
43 VaapiWrapper* vaapi_wrapper_; // Not owned. 45 VaapiWrapper *vaapi_wrapper_; // Not owned.
Pawel Osciak 2014/12/26 00:38:56 '*' next to class name please.
llandwerlin-old 2014/12/26 02:50:01 Done.
46 base::Callback<bool(void)> make_context_current_;
47 scoped_refptr<VASurface> va_surface_;
Pawel Osciak 2014/12/26 00:38:55 Do we need scopers in this class to be refcounted?
llandwerlin-old 2014/12/26 02:50:01 I can probably move them to scoped_ptr. This is go
48 scoped_refptr<ui::NativePixmap> pixmap_;
Pawel Osciak 2014/12/26 00:38:55 Please add a comment what this is.
llandwerlin-old 2014/12/26 02:50:01 Done.
49 scoped_refptr<gfx::GLImageLinuxDMABuffer> egl_image_;
Pawel Osciak 2014/12/26 00:38:56 s/egl_image/gl_image/
llandwerlin-old 2014/12/26 02:50:01 Done.
44 50
45 base::Callback<bool(void)> make_context_current_; 51 DISALLOW_COPY_AND_ASSIGN(VaapiDrmPicture);
46 Display* x_display_;
47
48 Pixmap x_pixmap_;
49 scoped_refptr<gfx::GLImageGLX> glx_image_;
50
51 DISALLOW_COPY_AND_ASSIGN(VaapiTFPPicture);
52 }; 52 };
53 53
54 } // namespace content 54 } // namespace content
55 55
56 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_TFP_PICTURE_H_ 56 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_DRM_PICTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698