| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // Return the supported encode profiles. | 70 // Return the supported encode profiles. |
| 71 static media::VideoEncodeAccelerator::SupportedProfiles | 71 static media::VideoEncodeAccelerator::SupportedProfiles |
| 72 GetSupportedEncodeProfiles(); | 72 GetSupportedEncodeProfiles(); |
| 73 | 73 |
| 74 // Return the supported decode profiles. | 74 // Return the supported decode profiles. |
| 75 static media::VideoDecodeAccelerator::SupportedProfiles | 75 static media::VideoDecodeAccelerator::SupportedProfiles |
| 76 GetSupportedDecodeProfiles(); | 76 GetSupportedDecodeProfiles(); |
| 77 | 77 |
| 78 ~VaapiWrapper(); | 78 ~VaapiWrapper(); |
| 79 | 79 |
| 80 // Create |num_surfaces| backing surfaces in driver for VASurfaces of | 80 // Create |num_surfaces| backing surfaces in driver for VASurfaces, each |
| 81 // |va_format|, each of size |size|. Returns true when successful, with the | 81 // of size |size|. Returns true when successful, with the created IDs in |
| 82 // created IDs in |va_surfaces| to be managed and later wrapped in | 82 // |va_surfaces| to be managed and later wrapped in VASurfaces. |
| 83 // VASurfaces. | |
| 84 // The client must DestroySurfaces() each time before calling this method | 83 // The client must DestroySurfaces() each time before calling this method |
| 85 // again to free the allocated surfaces first, but is not required to do so | 84 // again to free the allocated surfaces first, but is not required to do so |
| 86 // at destruction time, as this will be done automatically from | 85 // at destruction time, as this will be done automatically from |
| 87 // the destructor. | 86 // the destructor. |
| 88 bool CreateSurfaces(unsigned int va_format, | 87 bool CreateSurfaces(const gfx::Size& size, |
| 89 const gfx::Size& size, | |
| 90 size_t num_surfaces, | 88 size_t num_surfaces, |
| 91 std::vector<VASurfaceID>* va_surfaces); | 89 std::vector<VASurfaceID>* va_surfaces); |
| 92 | 90 |
| 93 // Free all memory allocated in CreateSurfaces. | 91 // Free all memory allocated in CreateSurfaces. |
| 94 void DestroySurfaces(); | 92 void DestroySurfaces(); |
| 95 | 93 |
| 96 // Create a VASurface of |va_format|, |size| and using |va_attribs| | 94 // Create a VASurface of |va_format|, |size| and using |va_attribs| |
| 97 // attributes. The ownership of the surface is transferred to the | 95 // attributes. The ownership of the surface is transferred to the |
| 98 // caller. It differs from surfaces created using CreateSurfaces(), | 96 // caller. It differs from surfaces created using CreateSurfaces(), |
| 99 // where VaapiWrapper is the owner of the surfaces. | 97 // where VaapiWrapper is the owner of the surfaces. |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // Singleton variable to store supported profile information for encode and | 353 // Singleton variable to store supported profile information for encode and |
| 356 // decode. | 354 // decode. |
| 357 static base::LazyInstance<LazyProfileInfos> profile_infos_; | 355 static base::LazyInstance<LazyProfileInfos> profile_infos_; |
| 358 | 356 |
| 359 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); | 357 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); |
| 360 }; | 358 }; |
| 361 | 359 |
| 362 } // namespace content | 360 } // namespace content |
| 363 | 361 |
| 364 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ | 362 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ |
| OLD | NEW |