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

Commit 8512658f authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

stagefright: OMXCodec: Re-enable OMX.TI.Video.encoder's quirks

These have been around since early stagefright, and were dropped for
JB. Unfortunately, they're still necessary with for this encoder to
work.

Change-Id: I8a251bf195a24b166db7464a90a822d6e69b644d
parent 7204c37f
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -288,6 +288,14 @@ uint32_t OMXCodec::getComponentQuirks(
                index, "requies-loaded-to-idle-after-allocation")) {
      quirks |= kRequiresLoadedToIdleAfterAllocation;
    }
    if (list->codecHasQuirk(
                index, "avoid-memcopy-input-recording-frames")) {
      quirks |= kAvoidMemcopyInputRecordingFrames;
    }
    if (list->codecHasQuirk(
                index, "input-buffer-sizes-are-bogus")) {
      quirks |= kInputBufferSizesAreBogus;
    }
#ifdef QCOM_HARDWARE
    if (list->codecHasQuirk(
                index, "requires-global-flush")) {
@@ -928,6 +936,21 @@ status_t OMXCodec::setVideoPortFormatType(
             index, format.eCompressionFormat, format.eColorFormat);
#endif

        if (!strcmp("OMX.TI.Video.encoder", mComponentName)) {
            if (portIndex == kPortIndexInput
                    && colorFormat == format.eColorFormat) {
                // eCompressionFormat does not seem right.
                found = true;
                break;
            }
            if (portIndex == kPortIndexOutput
                    && compressionFormat == format.eCompressionFormat) {
                // eColorFormat does not seem right.
                found = true;
                break;
            }
        }

        if (format.eCompressionFormat == compressionFormat
                && format.eColorFormat == colorFormat) {
            found = true;
@@ -3834,6 +3857,13 @@ bool OMXCodec::drainInputBuffer(BufferInfo *info) {
        return false;
    }

    // This component does not ever signal the EOS flag on output buffers,
    // Thanks for nothing.
    if (mSignalledEOS && !strcmp(mComponentName, "OMX.TI.Video.encoder")) {
        mNoMoreOutputData = true;
        mBufferFilled.signal();
    }

    info->mStatus = OWNED_BY_COMPONENT;

    return true;