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_ |
11 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ | 11 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ |
12 | 12 |
13 #include <set> | 13 #include <set> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
19 #include "content/common/gpu/media/va_surface.h" | 19 #include "content/common/gpu/media/va_surface.h" |
20 #include "media/base/video_decoder_config.h" | 20 #include "media/base/video_decoder_config.h" |
21 #include "media/base/video_frame.h" | 21 #include "media/base/video_frame.h" |
22 #include "third_party/libva/va/va.h" | 22 #include "third_party/libva/va/va.h" |
23 #include "third_party/libva/va/va_vpp.h" | 23 #include "third_party/libva/va/va_vpp.h" |
24 #include "ui/gfx/size.h" | 24 #include "ui/gfx/geometry/size.h" |
25 #if defined(USE_X11) | 25 #if defined(USE_X11) |
26 #include "third_party/libva/va/va_x11.h" | 26 #include "third_party/libva/va/va_x11.h" |
27 #endif // USE_X11 | 27 #endif // USE_X11 |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 // This class handles VA-API calls and ensures proper locking of VA-API calls | 31 // This class handles VA-API calls and ensures proper locking of VA-API calls |
32 // to libva, the userspace shim to the HW codec driver. libva is not | 32 // to libva, the userspace shim to the HW codec driver. libva is not |
33 // thread-safe, so we have to perform locking ourselves. This class is fully | 33 // thread-safe, so we have to perform locking ourselves. This class is fully |
34 // synchronous and its methods can be called from any thread and may wait on | 34 // synchronous and its methods can be called from any thread and may wait on |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 VAConfigID va_vpp_config_id_; | 233 VAConfigID va_vpp_config_id_; |
234 VAContextID va_vpp_context_id_; | 234 VAContextID va_vpp_context_id_; |
235 VABufferID va_vpp_buffer_id_; | 235 VABufferID va_vpp_buffer_id_; |
236 | 236 |
237 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); | 237 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); |
238 }; | 238 }; |
239 | 239 |
240 } // namespace content | 240 } // namespace content |
241 | 241 |
242 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ | 242 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ |
OLD | NEW |