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

Commit b8de9578 authored by Andreas Huber's avatar Andreas Huber
Browse files

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

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.

related-to-bug: 2281327
parent 7e31e0c3
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,