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 an implementation of VaapiWrapper, used by | 5 // This file contains an implementation of VaapiWrapper, used by |
6 // VaapiVideoDecodeAccelerator and VaapiH264Decoder for decode, | 6 // VaapiVideoDecodeAccelerator and VaapiH264Decoder for decode, |
7 // and VaapiVideoEncodeAccelerator for encode, to interface | 7 // and VaapiVideoEncodeAccelerator for encode, to interface |
8 // with libva (VA-API library for hardware video codec). | 8 // with libva (VA-API library for hardware video codec). |
9 | 9 |
10 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ | 10 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // to the encode job. | 179 // to the encode job. |
180 bool DownloadAndDestroyCodedBuffer(VABufferID buffer_id, | 180 bool DownloadAndDestroyCodedBuffer(VABufferID buffer_id, |
181 VASurfaceID sync_surface_id, | 181 VASurfaceID sync_surface_id, |
182 uint8* target_ptr, | 182 uint8* target_ptr, |
183 size_t target_size, | 183 size_t target_size, |
184 size_t* coded_data_size); | 184 size_t* coded_data_size); |
185 | 185 |
186 // Destroy all previously-allocated (and not yet destroyed) coded buffers. | 186 // Destroy all previously-allocated (and not yet destroyed) coded buffers. |
187 void DestroyCodedBuffers(); | 187 void DestroyCodedBuffers(); |
188 | 188 |
189 // Blits a VASurface |va_surface_id_src| into another VASurface | 189 // Blits a VASurface |va_surface_src| into another VASurface |
190 // |va_surface_id_dest| applying pixel format conversion and scaling | 190 // |va_surface_dest| applying pixel format conversion and scaling |
191 // if needed. | 191 // if needed. |
192 bool BlitSurface(VASurfaceID va_surface_id_src, | 192 bool BlitSurface(const scoped_refptr<VASurface>& va_surface_src, |
193 const gfx::Size& src_size, | 193 const scoped_refptr<VASurface>& va_surface_dest); |
194 VASurfaceID va_surface_id_dest, | |
195 const gfx::Size& dest_size); | |
196 | 194 |
197 // Initialize static data before sandbox is enabled. | 195 // Initialize static data before sandbox is enabled. |
198 static void PreSandboxInitialization(); | 196 static void PreSandboxInitialization(); |
199 | 197 |
200 private: | 198 private: |
201 struct ProfileInfo { | 199 struct ProfileInfo { |
202 VAProfile va_profile; | 200 VAProfile va_profile; |
203 gfx::Size max_resolution; | 201 gfx::Size max_resolution; |
204 }; | 202 }; |
205 | 203 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 // Singleton variable to store supported profile information for encode and | 357 // Singleton variable to store supported profile information for encode and |
360 // decode. | 358 // decode. |
361 static base::LazyInstance<LazyProfileInfos> profile_infos_; | 359 static base::LazyInstance<LazyProfileInfos> profile_infos_; |
362 | 360 |
363 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); | 361 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); |
364 }; | 362 }; |
365 | 363 |
366 } // namespace content | 364 } // namespace content |
367 | 365 |
368 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ | 366 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ |
OLD | NEW |