Skip to content

Commit 1cb2fcd

Browse files
author
U. Artie Eoff
committed
test/get_create_config: test for packed headers special case
Driver should allow 0x0 (i.e. VA_ENC_PACKED_HEADER_NONE) value for the VAConfigAttribEncPackedHeaders attribute during vaCreateConfig when the attribute is supported. This test supercedes intel/intel-vaapi-driver#361 Also see intel/intel-vaapi-driver#358 and intel/libva#178 Signed-off-by: U. Artie Eoff <[email protected]>
1 parent fb32e18 commit 1cb2fcd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/test_va_api_get_create_config.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,37 @@ TEST_P(VAAPIGetCreateConfig, CreateConfigNoAttributes)
136136
destroyConfig();
137137
}
138138

139+
TEST_P(VAAPIGetCreateConfig, CreateConfigPackedHeaders)
140+
{
141+
if (not isSupported(profile, entrypoint)) {
142+
skipTest(profile, entrypoint);
143+
return;
144+
}
145+
146+
ConfigAttributes packedHeaders{{.type = VAConfigAttribEncPackedHeaders}};
147+
getConfigAttributes(profile, entrypoint, packedHeaders);
148+
149+
for (uint32_t v(0x00); v < 0xff; ++v) {
150+
ConfigAttributes attribs = {{
151+
.type = VAConfigAttribEncPackedHeaders,
152+
.value = v
153+
}};
154+
if ((VA_ATTRIB_NOT_SUPPORTED == packedHeaders.front().value)
155+
|| (v & ~packedHeaders.front().value)) {
156+
// Creating a config should fail if attribute is not supported
157+
// or for values that are not in the set of supported values.
158+
createConfig(
159+
profile, entrypoint, attribs, VA_STATUS_ERROR_INVALID_VALUE);
160+
destroyConfig(VA_STATUS_ERROR_INVALID_CONFIG);
161+
} else {
162+
// Creating a config should succeed for any value within the set of
163+
// supported values, including 0x0 (i.e. VA_ENC_PACKED_HEADER_NONE).
164+
createConfig(profile, entrypoint, attribs, VA_STATUS_SUCCESS);
165+
destroyConfig(VA_STATUS_SUCCESS);
166+
}
167+
}
168+
}
169+
139170
INSTANTIATE_TEST_CASE_P(
140171
GetCreateConfig, VAAPIGetCreateConfig,
141172
::testing::Combine(::testing::ValuesIn(g_vaProfiles),

0 commit comments

Comments
 (0)