| 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 #include "media/gpu/vaapi_wrapper.h" | 5 #include "media/gpu/vaapi_wrapper.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 #if defined(USE_X11) | 834 #if defined(USE_X11) |
| 835 bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id, | 835 bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id, |
| 836 Pixmap x_pixmap, | 836 Pixmap x_pixmap, |
| 837 gfx::Size dest_size) { | 837 gfx::Size dest_size) { |
| 838 base::AutoLock auto_lock(*va_lock_); | 838 base::AutoLock auto_lock(*va_lock_); |
| 839 | 839 |
| 840 VAStatus va_res = vaSyncSurface(va_display_, va_surface_id); | 840 VAStatus va_res = vaSyncSurface(va_display_, va_surface_id); |
| 841 VA_SUCCESS_OR_RETURN(va_res, "Failed syncing surface", false); | 841 VA_SUCCESS_OR_RETURN(va_res, "Failed syncing surface", false); |
| 842 | 842 |
| 843 // Put the data into an X Pixmap. | 843 // Put the data into an X Pixmap. |
| 844 va_res = vaPutSurface(va_display_, va_surface_id, x_pixmap, 0, 0, | 844 va_res = vaPutSurface(va_display_, |
| 845 dest_size.width(), dest_size.height(), 0, 0, | 845 va_surface_id, |
| 846 dest_size.width(), dest_size.height(), NULL, 0, 0); | 846 x_pixmap, |
| 847 0, 0, dest_size.width(), dest_size.height(), |
| 848 0, 0, dest_size.width(), dest_size.height(), |
| 849 NULL, 0, 0); |
| 847 VA_SUCCESS_OR_RETURN(va_res, "Failed putting surface to pixmap", false); | 850 VA_SUCCESS_OR_RETURN(va_res, "Failed putting surface to pixmap", false); |
| 848 return true; | 851 return true; |
| 849 } | 852 } |
| 850 #endif // USE_X11 | 853 #endif // USE_X11 |
| 851 | 854 |
| 852 bool VaapiWrapper::GetDerivedVaImage(VASurfaceID va_surface_id, | 855 bool VaapiWrapper::GetDerivedVaImage(VASurfaceID va_surface_id, |
| 853 VAImage* image, | 856 VAImage* image, |
| 854 void** mem) { | 857 void** mem) { |
| 855 base::AutoLock auto_lock(*va_lock_); | 858 base::AutoLock auto_lock(*va_lock_); |
| 856 | 859 |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 drm_fd_.reset(HANDLE_EINTR(dup(fd))); | 1238 drm_fd_.reset(HANDLE_EINTR(dup(fd))); |
| 1236 } | 1239 } |
| 1237 #endif // USE_OZONE | 1240 #endif // USE_OZONE |
| 1238 | 1241 |
| 1239 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { | 1242 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { |
| 1240 return (major_version_ < major) || | 1243 return (major_version_ < major) || |
| 1241 (major_version_ == major && minor_version_ < minor); | 1244 (major_version_ == major && minor_version_ < minor); |
| 1242 } | 1245 } |
| 1243 | 1246 |
| 1244 } // namespace media | 1247 } // namespace media |
| OLD | NEW |