Commit d822f675 authored by Martin Storsjö's avatar Martin Storsjö Committed by Jean-Baptiste Kempf

iomx: Implement OMX_GetComponentsOfRole, too

This isn't used by the vlc omxil module, but can be used by other
applications using the same iomx wrapper library.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 11489bdb
...@@ -393,5 +393,26 @@ OMX_ERRORTYPE PREFIX(OMX_GetRolesOfComponent)(OMX_STRING component_name, OMX_U32 ...@@ -393,5 +393,26 @@ OMX_ERRORTYPE PREFIX(OMX_GetRolesOfComponent)(OMX_STRING component_name, OMX_U32
} }
return OMX_ErrorInvalidComponentName; return OMX_ErrorInvalidComponentName;
} }
OMX_ERRORTYPE PREFIX(OMX_GetComponentsOfRole)(OMX_STRING role, OMX_U32 *num_comps, OMX_U8 **comp_names)
{
OMX_U32 i = 0;
for( List<IOMX::ComponentInfo>::iterator it = ctx->components.begin(); it != ctx->components.end(); it++ ) {
for( List<String8>::iterator it2 = it->mRoles.begin(); it2 != it->mRoles.end(); it2++ ) {
if (!strcmp(it2->string(), role)) {
if (comp_names) {
if (*num_comps < i)
return OMX_ErrorInsufficientResources;
strncpy((char*)comp_names[i], it->mName.string(), OMX_MAX_STRINGNAME_SIZE);
comp_names[i][OMX_MAX_STRINGNAME_SIZE - 1] = '\0';
}
i++;
break;
}
}
}
*num_comps = i;
return OMX_ErrorNone;
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment