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

Commit 45714825 authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge "ACodec: read max pts gap and max fps keys for image encoders" into qt-qpr1-dev

am: 16639a6e

Change-Id: I2b9a85c45dc8d7fe5a6c4993cb6679ff29b8db5d
parents 3644001e 16639a6e
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -1826,6 +1826,23 @@ status_t ACodec::configureCodec(
            mRepeatFrameDelayUs = -1LL;
        }

        if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) {
            float captureRate;
            if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) {
                mCaptureFps = captureRate;
            } else {
                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,21 +1859,6 @@ status_t ACodec::configureCodec(
        if (mMaxPtsGapUs < 0LL) {
            mMaxFps = -1;
        }

        if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) {
            float captureRate;
            if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) {
                mCaptureFps = captureRate;
            } else {
                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