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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 namespace { | 65 namespace { |
66 | 66 |
67 uint32_t BufferFormatToVAFourCC(gfx::BufferFormat fmt) { | 67 uint32_t BufferFormatToVAFourCC(gfx::BufferFormat fmt) { |
68 switch (fmt) { | 68 switch (fmt) { |
69 case gfx::BufferFormat::BGRX_8888: | 69 case gfx::BufferFormat::BGRX_8888: |
70 return VA_FOURCC_BGRX; | 70 return VA_FOURCC_BGRX; |
71 case gfx::BufferFormat::BGRA_8888: | 71 case gfx::BufferFormat::BGRA_8888: |
72 return VA_FOURCC_BGRA; | 72 return VA_FOURCC_BGRA; |
73 case gfx::BufferFormat::UYVY_422: | 73 case gfx::BufferFormat::UYVY_422: |
74 return VA_FOURCC_UYVY; | 74 return VA_FOURCC_UYVY; |
| 75 case gfx::BufferFormat::YUYV_422: |
| 76 return VA_FOURCC_YUY2; |
75 case gfx::BufferFormat::YVU_420: | 77 case gfx::BufferFormat::YVU_420: |
76 return VA_FOURCC_YV12; | 78 return VA_FOURCC_YV12; |
77 default: | 79 default: |
78 NOTREACHED(); | 80 NOTREACHED(); |
79 return 0; | 81 return 0; |
80 } | 82 } |
81 } | 83 } |
82 | 84 |
83 uint32_t BufferFormatToVARTFormat(gfx::BufferFormat fmt) { | 85 uint32_t BufferFormatToVARTFormat(gfx::BufferFormat fmt) { |
84 switch (fmt) { | 86 switch (fmt) { |
85 case gfx::BufferFormat::UYVY_422: | 87 case gfx::BufferFormat::UYVY_422: |
| 88 case gfx::BufferFormat::YUYV_422: |
86 return VA_RT_FORMAT_YUV422; | 89 return VA_RT_FORMAT_YUV422; |
87 case gfx::BufferFormat::BGRX_8888: | 90 case gfx::BufferFormat::BGRX_8888: |
88 case gfx::BufferFormat::BGRA_8888: | 91 case gfx::BufferFormat::BGRA_8888: |
89 return VA_RT_FORMAT_RGB32; | 92 return VA_RT_FORMAT_RGB32; |
90 case gfx::BufferFormat::YVU_420: | 93 case gfx::BufferFormat::YVU_420: |
91 return VA_RT_FORMAT_YUV420; | 94 return VA_RT_FORMAT_YUV420; |
92 default: | 95 default: |
93 NOTREACHED(); | 96 NOTREACHED(); |
94 return 0; | 97 return 0; |
95 } | 98 } |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 drm_fd_.reset(HANDLE_EINTR(dup(fd))); | 1261 drm_fd_.reset(HANDLE_EINTR(dup(fd))); |
1259 } | 1262 } |
1260 #endif // USE_OZONE | 1263 #endif // USE_OZONE |
1261 | 1264 |
1262 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { | 1265 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { |
1263 return (major_version_ < major) || | 1266 return (major_version_ < major) || |
1264 (major_version_ == major && minor_version_ < minor); | 1267 (major_version_ == major && minor_version_ < minor); |
1265 } | 1268 } |
1266 | 1269 |
1267 } // namespace media | 1270 } // namespace media |
OLD | NEW |