| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // A map between VideoCodecProfile and VAProfile. | 88 // A map between VideoCodecProfile and VAProfile. |
| 89 static const ProfileMap kProfileMap[] = { | 89 static const ProfileMap kProfileMap[] = { |
| 90 {media::H264PROFILE_BASELINE, VAProfileH264Baseline}, | 90 {media::H264PROFILE_BASELINE, VAProfileH264Baseline}, |
| 91 {media::H264PROFILE_MAIN, VAProfileH264Main}, | 91 {media::H264PROFILE_MAIN, VAProfileH264Main}, |
| 92 // TODO(posciak): See if we can/want support other variants of | 92 // TODO(posciak): See if we can/want support other variants of |
| 93 // media::H264PROFILE_HIGH*. | 93 // media::H264PROFILE_HIGH*. |
| 94 {media::H264PROFILE_HIGH, VAProfileH264High}, | 94 {media::H264PROFILE_HIGH, VAProfileH264High}, |
| 95 {media::VP8PROFILE_ANY, VAProfileVP8Version0_3}, | 95 {media::VP8PROFILE_ANY, VAProfileVP8Version0_3}, |
| 96 {media::VP9PROFILE_ANY, VAProfileVP9Profile0}, |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 static std::vector<VAConfigAttrib> GetRequiredAttribs( | 99 static std::vector<VAConfigAttrib> GetRequiredAttribs( |
| 99 VaapiWrapper::CodecMode mode) { | 100 VaapiWrapper::CodecMode mode) { |
| 100 std::vector<VAConfigAttrib> required_attribs; | 101 std::vector<VAConfigAttrib> required_attribs; |
| 101 required_attribs.insert( | 102 required_attribs.insert( |
| 102 required_attribs.end(), | 103 required_attribs.end(), |
| 103 kCommonVAConfigAttribs, | 104 kCommonVAConfigAttribs, |
| 104 kCommonVAConfigAttribs + arraysize(kCommonVAConfigAttribs)); | 105 kCommonVAConfigAttribs + arraysize(kCommonVAConfigAttribs)); |
| 105 if (mode == VaapiWrapper::kEncode) { | 106 if (mode == VaapiWrapper::kEncode) { |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 drm_fd_.reset(HANDLE_EINTR(dup(fd))); | 1149 drm_fd_.reset(HANDLE_EINTR(dup(fd))); |
| 1149 } | 1150 } |
| 1150 #endif // USE_OZONE | 1151 #endif // USE_OZONE |
| 1151 | 1152 |
| 1152 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { | 1153 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { |
| 1153 return (major_version_ < major) || | 1154 return (major_version_ < major) || |
| 1154 (major_version_ == major && minor_version_ < minor); | 1155 (major_version_ == major && minor_version_ < minor); |
| 1155 } | 1156 } |
| 1156 | 1157 |
| 1157 } // namespace content | 1158 } // namespace content |
| OLD | NEW |