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}, | |
97 }; | 96 }; |
98 | 97 |
99 static std::vector<VAConfigAttrib> GetRequiredAttribs( | 98 static std::vector<VAConfigAttrib> GetRequiredAttribs( |
100 VaapiWrapper::CodecMode mode) { | 99 VaapiWrapper::CodecMode mode) { |
101 std::vector<VAConfigAttrib> required_attribs; | 100 std::vector<VAConfigAttrib> required_attribs; |
102 required_attribs.insert( | 101 required_attribs.insert( |
103 required_attribs.end(), | 102 required_attribs.end(), |
104 kCommonVAConfigAttribs, | 103 kCommonVAConfigAttribs, |
105 kCommonVAConfigAttribs + arraysize(kCommonVAConfigAttribs)); | 104 kCommonVAConfigAttribs + arraysize(kCommonVAConfigAttribs)); |
106 if (mode == VaapiWrapper::kEncode) { | 105 if (mode == VaapiWrapper::kEncode) { |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 drm_fd_.reset(HANDLE_EINTR(dup(fd))); | 1148 drm_fd_.reset(HANDLE_EINTR(dup(fd))); |
1150 } | 1149 } |
1151 #endif // USE_OZONE | 1150 #endif // USE_OZONE |
1152 | 1151 |
1153 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { | 1152 bool VaapiWrapper::VADisplayState::VAAPIVersionLessThan(int major, int minor) { |
1154 return (major_version_ < major) || | 1153 return (major_version_ < major) || |
1155 (major_version_ == major && minor_version_ < minor); | 1154 (major_version_ == major && minor_version_ < minor); |
1156 } | 1155 } |
1157 | 1156 |
1158 } // namespace content | 1157 } // namespace content |
OLD | NEW |