Advertisement
Guest User

Packed Headers VAAPIi

a guest
Feb 21st, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.72 KB | None | 0 0
  1. diff --git a/test/test_va_api_get_create_config.cpp b/test/test_va_api_get_create_config.cpp
  2. index 403dd6a30551..c440b39dd990 100644
  3. --- a/test/test_va_api_get_create_config.cpp
  4. +++ b/test/test_va_api_get_create_config.cpp
  5. @@ -136,6 +136,37 @@ TEST_P(VAAPIGetCreateConfig, CreateConfigNoAttributes)
  6.      destroyConfig();
  7.  }
  8.  
  9. +TEST_P(VAAPIGetCreateConfig, CreateConfigPackedHeaders)
  10. +{
  11. +    if (not isSupported(profile, entrypoint)) {
  12. +        skipTest(profile, entrypoint);
  13. +        return;
  14. +    }
  15. +
  16. +    ConfigAttributes packedHeaders{{.type = VAConfigAttribEncPackedHeaders}};
  17. +    getConfigAttributes(profile, entrypoint, packedHeaders);
  18. +
  19. +    for (uint32_t v(0x00); v < 0xff; ++v) {
  20. +        ConfigAttributes attribs = {{
  21. +            .type = VAConfigAttribEncPackedHeaders,
  22. +            .value = v
  23. +        }};
  24. +        if ((VA_ATTRIB_NOT_SUPPORTED == packedHeaders.front().value)
  25. +            || (v & ~packedHeaders.front().value)) {
  26. +            // Creating a config should fail if attribute is not supported
  27. +            // or for values that are not in the set of supported values.
  28. +            createConfig(
  29. +                profile, entrypoint, attribs, VA_STATUS_ERROR_INVALID_VALUE);
  30. +            destroyConfig(VA_STATUS_ERROR_INVALID_CONFIG);
  31. +        } else {
  32. +            // Creating a config should succeed for any value within the set of
  33. +            // supported values, including 0x0 (i.e. VA_ENC_PACKED_HEADER_NONE).
  34. +            createConfig(profile, entrypoint, attribs, VA_STATUS_SUCCESS);
  35. +            destroyConfig(VA_STATUS_SUCCESS);
  36. +        }
  37. +    }
  38. +}
  39. +
  40.  INSTANTIATE_TEST_CASE_P(
  41.      GetCreateConfig, VAAPIGetCreateConfig,
  42.      ::testing::Combine(::testing::ValuesIn(g_vaProfiles),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement