| 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 "content/common/gpu/media/vaapi_wrapper.h" | 5 #include "content/common/gpu/media/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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 // A map between VideoCodecProfile and VAProfile. | 120 // A map between VideoCodecProfile and VAProfile. |
| 121 static const ProfileMap kProfileMap[] = { | 121 static const ProfileMap kProfileMap[] = { |
| 122 {media::H264PROFILE_BASELINE, VAProfileH264Baseline}, | 122 {media::H264PROFILE_BASELINE, VAProfileH264Baseline}, |
| 123 {media::H264PROFILE_MAIN, VAProfileH264Main}, | 123 {media::H264PROFILE_MAIN, VAProfileH264Main}, |
| 124 // TODO(posciak): See if we can/want support other variants of | 124 // TODO(posciak): See if we can/want support other variants of |
| 125 // media::H264PROFILE_HIGH*. | 125 // media::H264PROFILE_HIGH*. |
| 126 {media::H264PROFILE_HIGH, VAProfileH264High}, | 126 {media::H264PROFILE_HIGH, VAProfileH264High}, |
| 127 {media::VP8PROFILE_ANY, VAProfileVP8Version0_3}, | 127 {media::VP8PROFILE_ANY, VAProfileVP8Version0_3}, |
| 128 {media::VP9PROFILE_ANY, VAProfileVP9Profile0}, | 128 // TODO(servolk): Need to add VP9 profiles 1,2,3 here after rolling |
| 129 // third_party/libva to 1.7. crbug.com/598118 |
| 130 {media::VP9PROFILE_PROFILE0, VAProfileVP9Profile0}, |
| 129 }; | 131 }; |
| 130 | 132 |
| 131 static std::vector<VAConfigAttrib> GetRequiredAttribs( | 133 static std::vector<VAConfigAttrib> GetRequiredAttribs( |
| 132 VaapiWrapper::CodecMode mode) { | 134 VaapiWrapper::CodecMode mode) { |
| 133 std::vector<VAConfigAttrib> required_attribs; | 135 std::vector<VAConfigAttrib> required_attribs; |
| 134 required_attribs.insert( | 136 required_attribs.insert( |
| 135 required_attribs.end(), | 137 required_attribs.end(), |
| 136 kCommonVAConfigAttribs, | 138 kCommonVAConfigAttribs, |
| 137 kCommonVAConfigAttribs + arraysize(kCommonVAConfigAttribs)); | 139 kCommonVAConfigAttribs + arraysize(kCommonVAConfigAttribs)); |
| 138 if (mode == VaapiWrapper::kEncode) { | 140 if (mode == VaapiWrapper::kEncode) { |
| (...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 drm_fd_.reset(HANDLE_EINTR(dup(fd))); | 1265 drm_fd_.reset(HANDLE_EINTR(dup(fd))); |
| 1264 } | 1266 } |
| 1265 #endif // USE_OZONE | 1267 #endif // USE_OZONE |
| 1266 | 1268 |
| 1267 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { | 1269 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { |
| 1268 return (major_version_ < major) || | 1270 return (major_version_ < major) || |
| 1269 (major_version_ == major && minor_version_ < minor); | 1271 (major_version_ == major && minor_version_ < minor); |
| 1270 } | 1272 } |
| 1271 | 1273 |
| 1272 } // namespace content | 1274 } // namespace content |
| OLD | NEW |