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

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

Merge "This hardware video decoder lies about its required input buffer sizes...

Merge "This hardware video decoder lies about its required input buffer sizes allocating 2.7 MB of memory instead of the required 176 KB... Added another quirk."
parents 33285c37 b8de9578
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ private:
        kRequiresFlushBeforeShutdown         = 64,
        kDefersOutputBufferAllocation        = 128,
        kDecoderLiesAboutNumberOfChannels    = 256,
        kInputBufferSizesAreBogus            = 512,
    };

    struct BufferInfo {
+12 −2
Original line number Diff line number Diff line
@@ -298,6 +298,10 @@ uint32_t OMXCodec::getComponentQuirks(const char *componentName) {
        quirks |= kRequiresAllocateBufferOnOutputPorts;
    }

    if (!strcmp(componentName, "OMX.TI.Video.Decoder")) {
        quirks |= kInputBufferSizesAreBogus;
    }

    return quirks;
}

@@ -561,7 +565,8 @@ void OMXCodec::setMinBufferSize(OMX_U32 portIndex, OMX_U32 size) {
            mNode, OMX_IndexParamPortDefinition, &def, sizeof(def));
    CHECK_EQ(err, OK);

    if (def.nBufferSize < size) {
    if ((portIndex == kPortIndexInput && (mQuirks & kInputBufferSizesAreBogus))
        || (def.nBufferSize < size)) {
        def.nBufferSize = size;
    }

@@ -574,8 +579,13 @@ void OMXCodec::setMinBufferSize(OMX_U32 portIndex, OMX_U32 size) {
    CHECK_EQ(err, OK);

    // Make sure the setting actually stuck.
    if (portIndex == kPortIndexInput
            && (mQuirks & kInputBufferSizesAreBogus)) {
        CHECK_EQ(def.nBufferSize, size);
    } else {
        CHECK(def.nBufferSize >= size);
    }
}

status_t OMXCodec::setVideoPortFormatType(
        OMX_U32 portIndex,