Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Side by Side Diff: media/gpu/vaapi_wrapper.cc

Issue 2678343011: chromeos: decode video into NV12 format instead of RGBA in vaapi decoder (Closed)
Patch Set: fix redtint with --disable-accelerated-video-decode --enable-native-gpu-memory-buffers Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::YVU_420: 75 case gfx::BufferFormat::YVU_420:
76 return VA_FOURCC_YV12; 76 return VA_FOURCC_YV12;
77 case gfx::BufferFormat::YUV_420_BIPLANAR:
78 return VA_FOURCC_NV12;
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:
86 return VA_RT_FORMAT_YUV422; 88 return VA_RT_FORMAT_YUV422;
87 case gfx::BufferFormat::BGRX_8888: 89 case gfx::BufferFormat::BGRX_8888:
88 case gfx::BufferFormat::BGRA_8888: 90 case gfx::BufferFormat::BGRA_8888:
89 return VA_RT_FORMAT_RGB32; 91 return VA_RT_FORMAT_RGB32;
90 case gfx::BufferFormat::YVU_420: 92 case gfx::BufferFormat::YVU_420:
93 case gfx::BufferFormat::YUV_420_BIPLANAR:
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 }
96 } 99 }
97 100
98 } // namespace 101 } // namespace
99 #endif 102 #endif
100 103
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 drm_fd_.reset(HANDLE_EINTR(dup(fd))); 1257 drm_fd_.reset(HANDLE_EINTR(dup(fd)));
1255 } 1258 }
1256 #endif // USE_OZONE 1259 #endif // USE_OZONE
1257 1260
1258 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { 1261 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) {
1259 return (major_version_ < major) || 1262 return (major_version_ < major) ||
1260 (major_version_ == major && minor_version_ < minor); 1263 (major_version_ == major && minor_version_ < minor);
1261 } 1264 }
1262 1265
1263 } // namespace media 1266 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698