| 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 to interface | 6 // VaapiVideoDecodeAccelerator and VaapiH264Decoder to interface |
| 7 // with libva (VA-API library for hardware video decode). | 7 // with libva (VA-API library for hardware video decode). |
| 8 | 8 |
| 9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ | 9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ |
| 10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ | 10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "content/common/gpu/media/va_surface.h" | 16 #include "content/common/gpu/media/va_surface.h" |
| 17 #include "media/base/video_decoder_config.h" | 17 #include "media/base/video_decoder_config.h" |
| 18 #include "media/base/video_frame.h" | 18 #include "media/base/video_frame.h" |
| 19 #include "third_party/libva/va/va.h" | |
| 20 #include "third_party/libva/va/va_x11.h" | 19 #include "third_party/libva/va/va_x11.h" |
| 21 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
| 22 | 21 |
| 23 namespace content { | 22 namespace content { |
| 24 | 23 |
| 25 // This class handles VA-API calls and ensures proper locking of VA-API calls | 24 // This class handles VA-API calls and ensures proper locking of VA-API calls |
| 26 // to libva, the userspace shim to the HW decoder driver. libva is not | 25 // to libva, the userspace shim to the HW decoder driver. libva is not |
| 27 // thread-safe, so we have to perform locking ourselves. This class is fully | 26 // thread-safe, so we have to perform locking ourselves. This class is fully |
| 28 // synchronous and its methods can be called from any thread and may wait on | 27 // synchronous and its methods can be called from any thread and may wait on |
| 29 // the va_lock_ while other, concurrent calls run. | 28 // the va_lock_ while other, concurrent calls run. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Called to report decoding errors to UMA. Errors to clients are reported via | 138 // Called to report decoding errors to UMA. Errors to clients are reported via |
| 140 // return values from public methods. | 139 // return values from public methods. |
| 141 base::Closure report_error_to_uma_cb_; | 140 base::Closure report_error_to_uma_cb_; |
| 142 | 141 |
| 143 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); | 142 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); |
| 144 }; | 143 }; |
| 145 | 144 |
| 146 } // namespace content | 145 } // namespace content |
| 147 | 146 |
| 148 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ | 147 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ |
| OLD | NEW |