summaryrefslogtreecommitdiff
path: root/chromium/media/gpu/vaapi/vaapi_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/gpu/vaapi/vaapi_unittest.cc')
-rw-r--r--chromium/media/gpu/vaapi/vaapi_unittest.cc37
1 files changed, 20 insertions, 17 deletions
diff --git a/chromium/media/gpu/vaapi/vaapi_unittest.cc b/chromium/media/gpu/vaapi/vaapi_unittest.cc
index d3d459fadf8..abb662d777a 100644
--- a/chromium/media/gpu/vaapi/vaapi_unittest.cc
+++ b/chromium/media/gpu/vaapi/vaapi_unittest.cc
@@ -11,9 +11,11 @@
#include <vector>
#include <va/va.h>
+#include <va/va_str.h>
#include "base/files/file.h"
#include "base/files/scoped_file.h"
+#include "base/logging.h"
#include "base/optional.h"
#include "base/process/launch.h"
#include "base/stl_util.h"
@@ -34,10 +36,8 @@ base::Optional<VAProfile> ConvertToVAProfile(VideoCodecProfile profile) {
{VP8PROFILE_ANY, VAProfileVP8Version0_3},
{VP9PROFILE_PROFILE0, VAProfileVP9Profile0},
{VP9PROFILE_PROFILE1, VAProfileVP9Profile1},
- // TODO(crbug.com/1011454, crbug.com/1011469): Reenable
- // VP9PROFILE_PROFILE2 and _PROFILE3 when P010 is completely supported.
- //{VP9PROFILE_PROFILE2, VAProfileVP9Profile2},
- //{VP9PROFILE_PROFILE3, VAProfileVP9Profile3},
+ {VP9PROFILE_PROFILE2, VAProfileVP9Profile2},
+ {VP9PROFILE_PROFILE3, VAProfileVP9Profile3},
};
auto it = kProfileMap.find(profile);
return it != kProfileMap.end() ? base::make_optional<VAProfile>(it->second)
@@ -56,10 +56,8 @@ base::Optional<VAProfile> StringToVAProfile(const std::string& va_profile) {
{"VAProfileVP8Version0_3", VAProfileVP8Version0_3},
{"VAProfileVP9Profile0", VAProfileVP9Profile0},
{"VAProfileVP9Profile1", VAProfileVP9Profile1},
- // TODO(crbug.com/1011454, crbug.com/1011469): Reenable
- // VP9PROFILE_PROFILE2 and _PROFILE3 when P010 is completely supported.
- // {"VAProfileVP9Profile2", VAProfileVP9Profile2},
- // {"VAProfileVP9Profile3", VAProfileVP9Profile3},
+ {"VAProfileVP9Profile2", VAProfileVP9Profile2},
+ {"VAProfileVP9Profile3", VAProfileVP9Profile3},
};
auto it = kStringToVAProfile.find(va_profile);
@@ -165,7 +163,8 @@ TEST_F(VaapiTest, VaapiProfiles) {
va_info[VAProfileH264ConstrainedBaseline], VAEntrypointVLD);
}
- EXPECT_TRUE(is_profile_supported) << " profile: " << profile.profile;
+ EXPECT_TRUE(is_profile_supported)
+ << " profile: " << GetProfileName(profile.profile);
}
for (const auto& profile : VaapiWrapper::GetSupportedEncodeProfiles()) {
@@ -184,7 +183,8 @@ TEST_F(VaapiTest, VaapiProfiles) {
VAEntrypointEncSliceLP);
}
- EXPECT_TRUE(is_profile_supported) << " profile: " << profile.profile;
+ EXPECT_TRUE(is_profile_supported)
+ << " profile: " << GetProfileName(profile.profile);
}
EXPECT_EQ(VaapiWrapper::IsDecodeSupported(VAProfileJPEGBaseline),
@@ -194,21 +194,24 @@ TEST_F(VaapiTest, VaapiProfiles) {
base::Contains(va_info[VAProfileJPEGBaseline], VAEntrypointEncPicture));
}
+// Verifies that the default VAEntrypoint as per VaapiWrapper is indeed among
+// the supported ones.
TEST_F(VaapiTest, DefaultEntrypointIsSupported) {
for (size_t i = 0; i < VaapiWrapper::kCodecModeMax; ++i) {
- const VaapiWrapper::CodecMode mode =
- static_cast<VaapiWrapper::CodecMode>(i);
+ const auto wrapper_mode = static_cast<VaapiWrapper::CodecMode>(i);
std::map<VAProfile, std::vector<VAEntrypoint>> configurations =
- VaapiWrapper::GetSupportedConfigurationsForCodecModeForTesting(mode);
+ VaapiWrapper::GetSupportedConfigurationsForCodecModeForTesting(
+ wrapper_mode);
for (const auto& profile_and_entrypoints : configurations) {
const VAEntrypoint default_entrypoint =
- VaapiWrapper::GetDefaultVaEntryPoint(mode,
+ VaapiWrapper::GetDefaultVaEntryPoint(wrapper_mode,
profile_and_entrypoints.first);
const auto& supported_entrypoints = profile_and_entrypoints.second;
EXPECT_TRUE(base::Contains(supported_entrypoints, default_entrypoint))
- << "Default VAEntrypoint " << default_entrypoint
- << " (mode = " << mode << ") is not supported for VAProfile = "
- << profile_and_entrypoints.first;
+ << "Default VAEntrypoint " << vaEntrypointStr(default_entrypoint)
+ << " (VaapiWrapper mode = " << wrapper_mode
+ << ") is not supported for "
+ << vaProfileStr(profile_and_entrypoints.first);
}
}
}