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