Loading include/media/stagefright/OMXPluginBase.h +7 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,9 @@ #include <OMX_Component.h> #include <utils/String8.h> #include <utils/Vector.h> namespace android { struct OMXComponentBase; Loading @@ -44,6 +47,10 @@ struct OMXPluginBase { size_t size, OMX_U32 index) = 0; virtual OMX_ERRORTYPE getRolesOfComponent( const char *name, Vector<String8> *roles) = 0; private: OMXPluginBase(const OMXPluginBase &); OMXPluginBase &operator=(const OMXPluginBase &); Loading media/libstagefright/omx/Android.mk +1 −2 Original line number Diff line number Diff line Loading @@ -12,8 +12,7 @@ LOCAL_SRC_FILES:= \ OMX.cpp \ OMXComponentBase.cpp \ OMXNodeInstance.cpp \ OMXMaster.cpp \ OMXSoftwareCodecsPlugin.cpp \ OMXMaster.cpp ifneq ($(BUILD_WITHOUT_PV),true) LOCAL_SRC_FILES += \ Loading media/libstagefright/omx/OMX.cpp +25 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,29 @@ 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) { list->clear(); Loading @@ -217,6 +240,8 @@ status_t OMX::listNodes(List<String8> *list) { componentName, sizeof(componentName), index) == OMX_ErrorNone) { list->push_back(String8(componentName)); // dumpRoles(mMaster, componentName); ++index; } Loading media/libstagefright/omx/OMXMaster.cpp +17 −4 Original line number Diff line number Diff line Loading @@ -24,14 +24,10 @@ #include "OMXPVCodecsPlugin.h" #endif #include "OMXSoftwareCodecsPlugin.h" namespace android { OMXMaster::OMXMaster() : mVendorLibHandle(NULL) { addPlugin(new OMXSoftwareCodecsPlugin); addVendorPlugin(); #ifndef NO_OPENCORE Loading Loading @@ -168,4 +164,21 @@ OMX_ERRORTYPE OMXMaster::enumerateComponents( return OMX_ErrorNone; } OMX_ERRORTYPE OMXMaster::getRolesOfComponent( const char *name, Vector<String8> *roles) { Mutex::Autolock autoLock(mLock); roles->clear(); ssize_t index = mPluginByComponentName.indexOfKey(String8(name)); if (index < 0) { return OMX_ErrorInvalidComponentName; } OMXPluginBase *plugin = mPluginByComponentName.valueAt(index); return plugin->getRolesOfComponent(name, roles); } } // namespace android media/libstagefright/omx/OMXMaster.h +4 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,10 @@ struct OMXMaster : public OMXPluginBase { size_t size, OMX_U32 index); virtual OMX_ERRORTYPE getRolesOfComponent( const char *name, Vector<String8> *roles); private: Mutex mLock; List<OMXPluginBase *> mPlugins; Loading Loading
include/media/stagefright/OMXPluginBase.h +7 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,9 @@ #include <OMX_Component.h> #include <utils/String8.h> #include <utils/Vector.h> namespace android { struct OMXComponentBase; Loading @@ -44,6 +47,10 @@ struct OMXPluginBase { size_t size, OMX_U32 index) = 0; virtual OMX_ERRORTYPE getRolesOfComponent( const char *name, Vector<String8> *roles) = 0; private: OMXPluginBase(const OMXPluginBase &); OMXPluginBase &operator=(const OMXPluginBase &); Loading
media/libstagefright/omx/Android.mk +1 −2 Original line number Diff line number Diff line Loading @@ -12,8 +12,7 @@ LOCAL_SRC_FILES:= \ OMX.cpp \ OMXComponentBase.cpp \ OMXNodeInstance.cpp \ OMXMaster.cpp \ OMXSoftwareCodecsPlugin.cpp \ OMXMaster.cpp ifneq ($(BUILD_WITHOUT_PV),true) LOCAL_SRC_FILES += \ Loading
media/libstagefright/omx/OMX.cpp +25 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,29 @@ 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) { list->clear(); Loading @@ -217,6 +240,8 @@ status_t OMX::listNodes(List<String8> *list) { componentName, sizeof(componentName), index) == OMX_ErrorNone) { list->push_back(String8(componentName)); // dumpRoles(mMaster, componentName); ++index; } Loading
media/libstagefright/omx/OMXMaster.cpp +17 −4 Original line number Diff line number Diff line Loading @@ -24,14 +24,10 @@ #include "OMXPVCodecsPlugin.h" #endif #include "OMXSoftwareCodecsPlugin.h" namespace android { OMXMaster::OMXMaster() : mVendorLibHandle(NULL) { addPlugin(new OMXSoftwareCodecsPlugin); addVendorPlugin(); #ifndef NO_OPENCORE Loading Loading @@ -168,4 +164,21 @@ OMX_ERRORTYPE OMXMaster::enumerateComponents( return OMX_ErrorNone; } OMX_ERRORTYPE OMXMaster::getRolesOfComponent( const char *name, Vector<String8> *roles) { Mutex::Autolock autoLock(mLock); roles->clear(); ssize_t index = mPluginByComponentName.indexOfKey(String8(name)); if (index < 0) { return OMX_ErrorInvalidComponentName; } OMXPluginBase *plugin = mPluginByComponentName.valueAt(index); return plugin->getRolesOfComponent(name, roles); } } // namespace android
media/libstagefright/omx/OMXMaster.h +4 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,10 @@ struct OMXMaster : public OMXPluginBase { size_t size, OMX_U32 index); virtual OMX_ERRORTYPE getRolesOfComponent( const char *name, Vector<String8> *roles); private: Mutex mLock; List<OMXPluginBase *> mPlugins; Loading