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

Commit faaa26d9 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8740412 from 5b33db05 to tm-release

Change-Id: I85211a3872025bf501e35deeb03ac18d60d2ef53
parents 082d799d 5b33db05
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2041,6 +2041,9 @@ void CCodecBufferChannel::sendOutputBuffers() {
    sp<MediaCodecBuffer> outBuffer;
    std::shared_ptr<C2Buffer> c2Buffer;

    constexpr int kMaxReallocTry = 5;
    int reallocTryNum = 0;

    while (true) {
        Mutexed<Output>::Locked output(mOutput);
        if (!output->buffers) {
@@ -2048,6 +2051,9 @@ void CCodecBufferChannel::sendOutputBuffers() {
        }
        action = output->buffers->popFromStashAndRegister(
                &c2Buffer, &index, &outBuffer);
        if (action != OutputBuffers::REALLOCATE) {
            reallocTryNum = 0;
        }
        switch (action) {
        case OutputBuffers::SKIP:
            return;
@@ -2058,6 +2064,13 @@ void CCodecBufferChannel::sendOutputBuffers() {
            mCallback->onOutputBufferAvailable(index, outBuffer);
            break;
        case OutputBuffers::REALLOCATE:
            if (++reallocTryNum > kMaxReallocTry) {
                output.unlock();
                ALOGE("[%s] sendOutputBuffers: tried %d realloc and failed",
                          mName, kMaxReallocTry);
                mCCodecCallback->onError(UNKNOWN_ERROR, ACTION_CODE_FATAL);
                return;
            }
            if (!output->buffers->isArrayMode()) {
                output->buffers =
                    output->buffers->toArrayMode(output->numSlots);
+3 −0
Original line number Diff line number Diff line
@@ -2291,6 +2291,9 @@ status_t Camera3Device::configureStreamsLocked(int operatingMode,
        mOperatingMode = operatingMode;
    }

    // Reset min expected duration when session is reconfigured.
    mMinExpectedDuration = 0;

    // In case called from configureStreams, abort queued input buffers not belonging to
    // any pending requests.
    if (mInputStream != NULL && notifyRequestThread) {