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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 | 188 |
189 // Blits a VASurface |va_surface_src| into another VASurface | 189 // Blits a VASurface |va_surface_src| into another VASurface |
190 // |va_surface_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(const scoped_refptr<VASurface>& va_surface_src, | 192 bool BlitSurface(const scoped_refptr<VASurface>& va_surface_src, |
193 const scoped_refptr<VASurface>& va_surface_dest); | 193 const scoped_refptr<VASurface>& va_surface_dest); |
194 | 194 |
195 // Initialize static data before sandbox is enabled. | 195 // Initialize static data before sandbox is enabled. |
196 static void PreSandboxInitialization(); | 196 static void PreSandboxInitialization(); |
197 | 197 |
198 // Get the created surfaces format | |
Pawel Osciak
2015/11/10 06:09:25
Nit: dot at end of sentences please.
william.xie1
2015/11/10 06:25:54
Done.
| |
199 unsigned int va_surface_format() { return va_surface_format_; } | |
Pawel Osciak
2015/11/10 06:09:25
unsigned int va_surface_format() const
william.xie1
2015/11/10 06:25:54
Done.
| |
200 | |
198 private: | 201 private: |
199 struct ProfileInfo { | 202 struct ProfileInfo { |
200 VAProfile va_profile; | 203 VAProfile va_profile; |
201 gfx::Size max_resolution; | 204 gfx::Size max_resolution; |
202 }; | 205 }; |
203 | 206 |
204 class LazyProfileInfos { | 207 class LazyProfileInfos { |
205 public: | 208 public: |
206 LazyProfileInfos(); | 209 LazyProfileInfos(); |
207 ~LazyProfileInfos(); | 210 ~LazyProfileInfos(); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 static VAProfile ProfileToVAProfile(media::VideoCodecProfile profile, | 321 static VAProfile ProfileToVAProfile(media::VideoCodecProfile profile, |
319 CodecMode mode); | 322 CodecMode mode); |
320 | 323 |
321 // Pointer to VADisplayState's member |va_lock_|. Guaranteed to be valid for | 324 // Pointer to VADisplayState's member |va_lock_|. Guaranteed to be valid for |
322 // the lifetime of VaapiWrapper. | 325 // the lifetime of VaapiWrapper. |
323 base::Lock* va_lock_; | 326 base::Lock* va_lock_; |
324 | 327 |
325 // Allocated ids for VASurfaces. | 328 // Allocated ids for VASurfaces. |
326 std::vector<VASurfaceID> va_surface_ids_; | 329 std::vector<VASurfaceID> va_surface_ids_; |
327 | 330 |
331 // VA format of surfaces with va_surface_ids_. | |
332 unsigned int va_surface_format_; | |
333 | |
328 // Singleton instance of VADisplayState. | 334 // Singleton instance of VADisplayState. |
329 static base::LazyInstance<VADisplayState> va_display_state_; | 335 static base::LazyInstance<VADisplayState> va_display_state_; |
330 | 336 |
331 // VA handles. | 337 // VA handles. |
332 // All valid after successful Initialize() and until Deinitialize(). | 338 // All valid after successful Initialize() and until Deinitialize(). |
333 VADisplay va_display_; | 339 VADisplay va_display_; |
334 VAConfigID va_config_id_; | 340 VAConfigID va_config_id_; |
335 // Created for the current set of va_surface_ids_ in CreateSurfaces() and | 341 // Created for the current set of va_surface_ids_ in CreateSurfaces() and |
336 // valid until DestroySurfaces(). | 342 // valid until DestroySurfaces(). |
337 VAContextID va_context_id_; | 343 VAContextID va_context_id_; |
(...skipping 19 matching lines...) Expand all Loading... | |
357 // Singleton variable to store supported profile information for encode and | 363 // Singleton variable to store supported profile information for encode and |
358 // decode. | 364 // decode. |
359 static base::LazyInstance<LazyProfileInfos> profile_infos_; | 365 static base::LazyInstance<LazyProfileInfos> profile_infos_; |
360 | 366 |
361 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); | 367 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); |
362 }; | 368 }; |
363 | 369 |
364 } // namespace content | 370 } // namespace content |
365 | 371 |
366 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ | 372 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ |
OLD | NEW |