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

Commit 92d6ea3e authored by James Dong's avatar James Dong
Browse files

Don't time out prematurely for video encoding waiting for output buffers

o For timelapse video encoding, the timelapse between two neighoring
  input frames could be very long

Change-Id: I2b6f9c392f2237deae71c894efc7fc3692431796
related-to-bug: 5160548
parent 0f2da17a
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3199,9 +3199,16 @@ void OMXCodec::setState(State newState) {
}

status_t OMXCodec::waitForBufferFilled_l() {

    if (mIsEncoder) {
        // For timelapse video recording, the timelapse video recording may
        // not send an input frame for a _long_ time. Do not use timeout
        // for video encoding.
        return mBufferFilled.wait(mLock);
    }
    status_t err = mBufferFilled.waitRelative(mLock, kBufferFilledEventTimeOutUs);
    if (err != OK) {
        LOGE("Timed out waiting for buffers from video encoder: %d/%d",
        CODEC_LOGE("Timed out waiting for output buffers: %d/%d",
            countBuffersWeOwn(mPortBuffers[kPortIndexInput]),
            countBuffersWeOwn(mPortBuffers[kPortIndexOutput]));
    }