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

Commit 206bf9df authored by James Dong's avatar James Dong Committed by Android Git Automerger
Browse files

am a5fe77d0: am df8356ff: Merge "Workaround for a QCOM issue where the output...

am a5fe77d0: am df8356ff: Merge "Workaround for a QCOM issue where the output buffer size advertised by the AVC encoder is occasionally too small." into gingerbread

Merge commit 'a5fe77d0'

* commit 'a5fe77d0':
  Workaround for a QCOM issue where the output buffer size advertised by the AVC encoder
parents 7fe6d3f1 a5fe77d0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ private:
        kInputBufferSizesAreBogus             = 512,
        kSupportsMultipleFramesPerInputBuffer = 1024,
        kAvoidMemcopyInputRecordingFrames     = 2048,
        kRequiresLargerEncoderOutputBuffer    = 4096,
    };

    struct BufferInfo {
+13 −0
Original line number Diff line number Diff line
@@ -368,6 +368,15 @@ uint32_t OMXCodec::getComponentQuirks(const char *componentName) {
        quirks |= kRequiresLoadedToIdleAfterAllocation;
        quirks |= kRequiresAllocateBufferOnInputPorts;
        quirks |= kRequiresAllocateBufferOnOutputPorts;
        if (!strncmp(componentName, "OMX.qcom.video.encoder.avc", 26)) {

            // The AVC encoder advertises the size of output buffers
            // based on the input video resolution and assumes
            // the worst/least compression ratio is 0.5. It is found that
            // sometimes, the output buffer size is larger than
            // size advertised by the encoder.
            quirks |= kRequiresLargerEncoderOutputBuffer;
        }
    }
    if (!strncmp(componentName, "OMX.qcom.7x30.video.encoder.", 28)) {
    }
@@ -925,6 +934,10 @@ void OMXCodec::setVideoInputFormat(
    video_def->nBitrate = bitRate;  // Q16 format
    video_def->eCompressionFormat = compressionFormat;
    video_def->eColorFormat = OMX_COLOR_FormatUnused;
    if (mQuirks & kRequiresLargerEncoderOutputBuffer) {
        // Increases the output buffer size
        def.nBufferSize = ((def.nBufferSize * 3) >> 1);
    }

    err = mOMX->setParameter(
            mNode, OMX_IndexParamPortDefinition, &def, sizeof(def));