Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d980e656 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change Ic7e91eee into eclair-mr2

* changes:
  Add a new API to support determining the roles of an OMX component specified by name. Remove unneeded OMXSoftwareCodecsPlugin.
parents cdaeafd4 c7e91eee
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -22,6 +22,9 @@

#include <OMX_Component.h>

#include <utils/String8.h>
#include <utils/Vector.h>

namespace android {

struct OMXComponentBase;
@@ -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 &);
+1 −2
Original line number Diff line number Diff line
@@ -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 += \
+25 −0
Original line number Diff line number Diff line
@@ -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();

@@ -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;
    }

+17 −4
Original line number Diff line number Diff line
@@ -24,14 +24,10 @@
#include "OMXPVCodecsPlugin.h"
#endif

#include "OMXSoftwareCodecsPlugin.h"

namespace android {

OMXMaster::OMXMaster()
    : mVendorLibHandle(NULL) {
    addPlugin(new OMXSoftwareCodecsPlugin);

    addVendorPlugin();

#ifndef NO_OPENCORE
@@ -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
+4 −0
Original line number Diff line number Diff line
@@ -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