OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 the definition of VASurface class, used for decoding by | 5 // This file contains the definition of VASurface class, used for decoding by |
6 // VaapiVideoDecodeAccelerator and VaapiH264Decoder. | 6 // VaapiVideoDecodeAccelerator and VaapiH264Decoder. |
7 | 7 |
8 #ifndef CONTENT_COMMON_GPU_MEDIA_VA_SURFACE_H_ | 8 #ifndef CONTENT_COMMON_GPU_MEDIA_VA_SURFACE_H_ |
9 #define CONTENT_COMMON_GPU_MEDIA_VA_SURFACE_H_ | 9 #define CONTENT_COMMON_GPU_MEDIA_VA_SURFACE_H_ |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // | v | 71 // | v |
72 // | Neither VVDA nor VHD hold a reference to VASurface. VASurface is released, | 72 // | Neither VVDA nor VHD hold a reference to VASurface. VASurface is released, |
73 // | ReleaseCB gets called in its destructor, which puts the associated | 73 // | ReleaseCB gets called in its destructor, which puts the associated |
74 // | VASurfaceID back onto VVDA::available_va_surfaces_. | 74 // | VASurfaceID back onto VVDA::available_va_surfaces_. |
75 // | | | 75 // | | |
76 // '-------------------------------------| | 76 // '-------------------------------------| |
77 // | | 77 // | |
78 // v | 78 // v |
79 // VaapiWrapper frees VASurfaceID. | 79 // VaapiWrapper frees VASurfaceID. |
80 // | 80 // |
81 class VASurface : public base::RefCountedThreadSafe<VASurface> { | 81 class CONTENT_EXPORT VASurface : public base::RefCountedThreadSafe<VASurface> { |
82 public: | 82 public: |
83 // Provided by user, will be called when all references to the surface | 83 // Provided by user, will be called when all references to the surface |
84 // are released. | 84 // are released. |
85 typedef base::Callback<void(VASurfaceID)> ReleaseCB; | 85 typedef base::Callback<void(VASurfaceID)> ReleaseCB; |
86 | 86 |
87 VASurface(VASurfaceID va_surface_id, const ReleaseCB& release_cb); | 87 VASurface(VASurfaceID va_surface_id, const ReleaseCB& release_cb); |
88 | 88 |
89 VASurfaceID id() { | 89 VASurfaceID id() { |
90 return va_surface_id_; | 90 return va_surface_id_; |
91 } | 91 } |
92 | 92 |
93 private: | 93 private: |
94 friend class base::RefCountedThreadSafe<VASurface>; | 94 friend class base::RefCountedThreadSafe<VASurface>; |
95 ~VASurface(); | 95 ~VASurface(); |
96 | 96 |
97 const VASurfaceID va_surface_id_; | 97 const VASurfaceID va_surface_id_; |
98 ReleaseCB release_cb_; | 98 ReleaseCB release_cb_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(VASurface); | 100 DISALLOW_COPY_AND_ASSIGN(VASurface); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace content | 103 } // namespace content |
104 | 104 |
105 #endif // CONTENT_COMMON_GPU_MEDIA_VA_SURFACE_H_ | 105 #endif // CONTENT_COMMON_GPU_MEDIA_VA_SURFACE_H_ |
OLD | NEW |