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

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

Merge "Support "suspension" of a video encoder in "surface-input" mode."

parents 41f9f1ac e40cda70
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -130,6 +130,16 @@ public:
            node_id node,
            const char *parameter_name,
            OMX_INDEXTYPE *index) = 0;

    enum InternalOptionType {
        INTERNAL_OPTION_SUSPEND,  // data is a bool
    };
    virtual status_t setInternalOption(
            node_id node,
            OMX_U32 port_index,
            InternalOptionType type,
            const void *data,
            size_t size) = 0;
};

struct omx_message {
+29 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ enum {
    GET_EXTENSION_INDEX,
    OBSERVER_ON_MSG,
    GET_GRAPHIC_BUFFER_USAGE,
    SET_INTERNAL_OPTION,
};

class BpOMX : public BpInterface<IOMX> {
@@ -439,6 +440,24 @@ public:

        return err;
    }

    virtual status_t setInternalOption(
            node_id node,
            OMX_U32 port_index,
            InternalOptionType type,
            const void *optionData,
            size_t size) {
        Parcel data, reply;
        data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
        data.writeIntPtr((intptr_t)node);
        data.writeInt32(port_index);
        data.writeInt32(size);
        data.write(optionData, size);
        data.writeInt32(type);
        remote()->transact(SET_INTERNAL_OPTION, data, &reply);

        return reply.readInt32();
    }
};

IMPLEMENT_META_INTERFACE(OMX, "android.hardware.IOMX");
@@ -537,6 +556,7 @@ status_t BnOMX::onTransact(
        case SET_PARAMETER:
        case GET_CONFIG:
        case SET_CONFIG:
        case SET_INTERNAL_OPTION:
        {
            CHECK_OMX_INTERFACE(IOMX, data, reply);

@@ -562,6 +582,15 @@ status_t BnOMX::onTransact(
                case SET_CONFIG:
                    err = setConfig(node, index, params, size);
                    break;
                case SET_INTERNAL_OPTION:
                {
                    InternalOptionType type =
                        (InternalOptionType)data.readInt32();

                    err = setInternalOption(node, index, type, params, size);
                    break;
                }

                default:
                    TRESPASS();
            }
+13 −0
Original line number Diff line number Diff line
@@ -4106,6 +4106,19 @@ status_t ACodec::setParameters(const sp<AMessage> &params) {
        }
    }

    int32_t dropInputFrames;
    if (params->findInt32("drop-input-frames", &dropInputFrames)) {
        bool suspend = dropInputFrames != 0;

        CHECK_EQ((status_t)OK,
                 mOMX->setInternalOption(
                     mNode,
                     kPortIndexInput,
                     IOMX::INTERNAL_OPTION_SUSPEND,
                     &suspend,
                     sizeof(suspend)));
    }

    return OK;
}

+16 −0
Original line number Diff line number Diff line
@@ -113,6 +113,13 @@ struct MuxOMX : public IOMX {
            const char *parameter_name,
            OMX_INDEXTYPE *index);

    virtual status_t setInternalOption(
            node_id node,
            OMX_U32 port_index,
            InternalOptionType type,
            const void *data,
            size_t size);

private:
    mutable Mutex mLock;

@@ -331,6 +338,15 @@ status_t MuxOMX::getExtensionIndex(
    return getOMX(node)->getExtensionIndex(node, parameter_name, index);
}

status_t MuxOMX::setInternalOption(
        node_id node,
        OMX_U32 port_index,
        InternalOptionType type,
        const void *data,
        size_t size) {
    return getOMX(node)->setInternalOption(node, port_index, type, data, size);
}

OMXClient::OMXClient() {
}

+7 −0
Original line number Diff line number Diff line
@@ -109,6 +109,13 @@ public:
            const char *parameter_name,
            OMX_INDEXTYPE *index);

    virtual status_t setInternalOption(
            node_id node,
            OMX_U32 port_index,
            InternalOptionType type,
            const void *data,
            size_t size);

    virtual void binderDied(const wp<IBinder> &the_late_who);

    OMX_ERRORTYPE OnEvent(
Loading