Skip to content

[Media Common] Add profile & entrypoint checks #1928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions media_softlet/linux/common/ddi/media_capstable_specific.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,19 @@ VAStatus MediaCapsTableSpecific::CreateConfig(
return ret;
}

bool MediaCapsTableSpecific::IsProfileSupported(
VAProfile profile)
{
return !(m_profileMap->find(profile) == m_profileMap->end());
}

bool MediaCapsTableSpecific::IsEntrypointSupported(
VAProfile profile,
VAEntrypoint entrypoint)
{
return !(m_profileMap->at(profile)->find(entrypoint) == m_profileMap->at(profile)->end());
}

bool MediaCapsTableSpecific::IsDecConfigId(VAConfigID configId)
{
VAConfigID curConfigId = REMOVE_CONFIG_ID_OFFSET(configId);
Expand Down
28 changes: 28 additions & 0 deletions media_softlet/linux/common/ddi/media_capstable_specific.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,34 @@ class MediaCapsTableSpecific : public MediaCapsTable<CapsData>
//!
//! \return True if the configID is a valid decode config, otherwise false
//!
bool IsProfileSupported(
VAProfile profile);

//!
//! \brief Check if profile is supported
//!
//! \param [in] profile
//! VA profile
//!
//! \return bool
//! true if supported
//!
bool IsEntrypointSupported(
VAProfile profile,
VAEntrypoint entrypoint);

//!
//! \brief Check if entrypoint is supported
//!
//! \param [in] profile
//! VA profile
//!
//! \param [in] entrypoint
//! VA entrypoint
//!
//! \return bool
//! true if supported
//!
bool IsDecConfigId(VAConfigID configId);

//!
Expand Down
9 changes: 9 additions & 0 deletions media_softlet/linux/common/ddi/media_libva_caps_next.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,15 @@ VAStatus MediaLibvaCapsNext::GetConfigAttributes(
DDI_CHK_NULL(m_capsTable, "Caps table is null", VA_STATUS_ERROR_INVALID_PARAMETER);
DDI_CHK_NULL(attribList, "Null pointer", VA_STATUS_ERROR_INVALID_PARAMETER);

if (!(m_capsTable->IsProfileSupported(profile)))
{
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
}
else if (!(m_capsTable->IsEntrypointSupported(profile, entrypoint)))
{
return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}

AttribList *supportedAttribList = nullptr;
supportedAttribList = m_capsTable->QuerySupportedAttrib(profile, entrypoint);
DDI_CHK_NULL(supportedAttribList, "AttribList in null, not supported attribute", VA_STATUS_ERROR_INVALID_PARAMETER);
Expand Down