diff options
Diffstat (limited to 'media/libstagefright/omx/OMX.cpp')
-rw-r--r-- | media/libstagefright/omx/OMX.cpp | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp index 94dbb6d..8c3f252 100644 --- a/media/libstagefright/omx/OMX.cpp +++ b/media/libstagefright/omx/OMX.cpp @@ -208,39 +208,27 @@ void OMX::binderDied(const wp<IBinder> &the_late_who) { instance->onObserverDied(mMaster); } -#if 0 -static void dumpRoles(OMXMaster *master, const char *name) { - Vector<String8> roles; - OMX_ERRORTYPE err = master->getRolesOfComponent(name, &roles); - - if (err != OMX_ErrorNone) { - LOGE("Could not get roles for component '%s'.", name); - return; - } - - if (roles.isEmpty()) { - LOGE("Component '%s' has NO roles!", name); - return; - } - - LOGI("Component '%s' has the following roles:", name); - - for (size_t i = 0; i < roles.size(); ++i) { - LOGI("%d) %s", i + 1, roles[i].string()); - } -} -#endif - -status_t OMX::listNodes(List<String8> *list) { +status_t OMX::listNodes(List<ComponentInfo> *list) { list->clear(); OMX_U32 index = 0; char componentName[256]; while (mMaster->enumerateComponents( componentName, sizeof(componentName), index) == OMX_ErrorNone) { - list->push_back(String8(componentName)); + list->push_back(ComponentInfo()); + ComponentInfo &info = *--list->end(); - // dumpRoles(mMaster, componentName); + info.mName = componentName; + + Vector<String8> roles; + OMX_ERRORTYPE err = + mMaster->getRolesOfComponent(componentName, &roles); + + if (err == OMX_ErrorNone) { + for (OMX_U32 i = 0; i < roles.size(); ++i) { + info.mRoles.push_back(roles[i]); + } + } ++index; } |