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

Commit 3676974d authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "Slighly improve the API to discover if the OMX stack is running in the local"

parents 2bb2323d f6b4ca40
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -42,10 +42,10 @@ public:
    typedef void *buffer_id;
    typedef void *node_id;

    // Given the calling process' pid, returns true iff
    // Given a node_id and the calling process' pid, returns true iff
    // the implementation of the OMX interface lives in the same
    // process.
    virtual bool livesLocally(pid_t pid) = 0;
    virtual bool livesLocally(node_id node, pid_t pid) = 0;

    struct ComponentInfo {
        String8 mName;
+5 −2
Original line number Diff line number Diff line
@@ -59,9 +59,10 @@ public:
        : BpInterface<IOMX>(impl) {
    }

    virtual bool livesLocally(pid_t pid) {
    virtual bool livesLocally(node_id node, pid_t pid) {
        Parcel data, reply;
        data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
        data.writeIntPtr((intptr_t)node);
        data.writeInt32(pid);
        remote()->transact(LIVES_LOCALLY, data, &reply);

@@ -417,7 +418,9 @@ status_t BnOMX::onTransact(
        case LIVES_LOCALLY:
        {
            CHECK_INTERFACE(IOMX, data, reply);
            reply->writeInt32(livesLocally((pid_t)data.readInt32()));
            node_id node = (void *)data.readIntPtr();
            pid_t pid = (pid_t)data.readInt32();
            reply->writeInt32(livesLocally(node, pid));

            return OK;
        }
+4 −4
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ struct MuxOMX : public IOMX {

    virtual IBinder *onAsBinder() { return NULL; }

    virtual bool livesLocally(pid_t pid);
    virtual bool livesLocally(node_id node, pid_t pid);

    virtual status_t listNodes(List<ComponentInfo> *list);

@@ -155,8 +155,8 @@ const sp<IOMX> &MuxOMX::getOMX_l(node_id node) const {
    return isLocalNode_l(node) ? mLocalOMX : mRemoteOMX;
}

bool MuxOMX::livesLocally(pid_t pid) {
    return true;
bool MuxOMX::livesLocally(node_id node, pid_t pid) {
    return getOMX(node)->livesLocally(node, pid);
}

status_t MuxOMX::listNodes(List<ComponentInfo> *list) {
@@ -326,7 +326,7 @@ status_t OMXClient::connect() {
    mOMX = service->getOMX();
    CHECK(mOMX.get() != NULL);

    if (!mOMX->livesLocally(getpid())) {
    if (!mOMX->livesLocally(NULL /* node */, getpid())) {
        ALOGI("Using client-side OMX mux.");
        mOMX = new MuxOMX(mOMX);
    }
+1 −1
Original line number Diff line number Diff line
@@ -1479,7 +1479,7 @@ OMXCodec::OMXCodec(
        const sp<MediaSource> &source,
        const sp<ANativeWindow> &nativeWindow)
    : mOMX(omx),
      mOMXLivesLocally(omx->livesLocally(getpid())),
      mOMXLivesLocally(omx->livesLocally(node, getpid())),
      mNode(node),
      mQuirks(quirks),
      mFlags(flags),
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ class OMX : public BnOMX,
public:
    OMX();

    virtual bool livesLocally(pid_t pid);
    virtual bool livesLocally(node_id node, pid_t pid);

    virtual status_t listNodes(List<ComponentInfo> *list);

Loading