Skip to content

Commit 6dfa058

Browse files
XinfengZhangoliver-sang
authored andcommitted
check the support RT format inside CreateConfig
Signed-off-by: XinfengZhang <carl.zhang@intel.com>
1 parent e70e199 commit 6dfa058

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

media_driver/linux/common/ddi/media_libva_caps.cpp

+4-20
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ VAStatus MediaLibvaCaps::CheckEncRTFormat(
369369
attrib->value = VA_RT_FORMAT_YUV420;
370370
}
371371

372-
#ifdef _FULL_OPEN_SOURCE
373372
EncodeFormat format = Others;
374373
EncodeType type = entrypoint == VAEntrypointEncSliceLP ? Vdenc : DualPipe;
375374
struct EncodeFormatTable* encodeFormatTable = m_encodeFormatTable;
@@ -396,7 +395,6 @@ VAStatus MediaLibvaCaps::CheckEncRTFormat(
396395
break;
397396
}
398397
}
399-
#endif
400398

401399
return VA_STATUS_SUCCESS;
402400
}
@@ -1500,25 +1498,11 @@ VAStatus MediaLibvaCaps::CreateEncConfig(
15001498
}
15011499
if(VAConfigAttribRTFormat == attribList[j].type)
15021500
{
1503-
if(m_profileEntryTbl[profileTableIdx].m_profile == VAProfileJPEGBaseline)
1504-
{
1505-
if(VA_RT_FORMAT_YUV420 != attribList[j].value &&
1506-
VA_RT_FORMAT_YUV422 != attribList[j].value &&
1507-
VA_RT_FORMAT_YUV444 != attribList[j].value &&
1508-
VA_RT_FORMAT_YUV400 != attribList[j].value &&
1509-
VA_RT_FORMAT_YUV411 != attribList[j].value &&
1510-
VA_RT_FORMAT_RGB16 != attribList[j].value &&
1511-
VA_RT_FORMAT_RGB32 != attribList[j].value)
1512-
{
1513-
return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
1514-
}
1515-
}
1516-
else
1501+
VAConfigAttrib attribRT;
1502+
CheckEncRTFormat(m_profileEntryTbl[profileTableIdx].m_profile, entrypoint, &attribRT);
1503+
if((attribList[j].value | attribRT.value) == 0)
15171504
{
1518-
if(VA_RT_FORMAT_YUV420 != attribList[j].value)
1519-
{
1520-
return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
1521-
}
1505+
return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
15221506
}
15231507
}
15241508
}

0 commit comments

Comments
 (0)