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

Commit 226cedd0 authored by Chong Zhang's avatar Chong Zhang
Browse files

ACodec: read max pts gap and max fps keys for image encoders

These keys are needed to disable backward frame drops for image
encoders. They should be read for both video and image types.

bug: 141169323
Change-Id: I12bea9b25a9902a50ba0e7f7d3f8aa5a497c581c
parent 0f9e1f52
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -1826,6 +1826,18 @@ status_t ACodec::configureCodec(
            mRepeatFrameDelayUs = -1LL;
        }

        if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) {
            mCaptureFps = -1.0;
        }

        if (!msg->findInt32(
                KEY_CREATE_INPUT_SURFACE_SUSPENDED,
                (int32_t*)&mCreateInputBuffersSuspended)) {
            mCreateInputBuffersSuspended = false;
        }
    }

    if (encoder && (mIsVideo || mIsImage)) {
        // only allow 32-bit value, since we pass it as U32 to OMX.
        if (!msg->findInt64(KEY_MAX_PTS_GAP_TO_ENCODER, &mMaxPtsGapUs)) {
            mMaxPtsGapUs = 0LL;
@@ -1842,16 +1854,6 @@ status_t ACodec::configureCodec(
        if (mMaxPtsGapUs < 0LL) {
            mMaxFps = -1;
        }

        if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) {
            mCaptureFps = -1.0;
        }

        if (!msg->findInt32(
                KEY_CREATE_INPUT_SURFACE_SUSPENDED,
                (int32_t*)&mCreateInputBuffersSuspended)) {
            mCreateInputBuffersSuspended = false;
        }
    }

    // NOTE: we only use native window for video decoders