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

Commit 7725022e authored by Lajos Molnar's avatar Lajos Molnar Committed by Gerrit Code Review
Browse files

Merge "SoftMPEG2: start output at first I-frame"

parents 3f22f5a2 8f81045b
Loading
Loading
Loading
Loading
+20 −5
Original line number Original line Diff line number Diff line
@@ -245,6 +245,7 @@ status_t SoftMPEG2::setFlushMode() {
        return UNKNOWN_ERROR;
        return UNKNOWN_ERROR;
    }
    }


    mWaitForI = true;
    mIsInFlush = true;
    mIsInFlush = true;
    return OK;
    return OK;
}
}
@@ -257,6 +258,7 @@ status_t SoftMPEG2::initDecoder() {
    UWORD32 u4_share_disp_buf;
    UWORD32 u4_share_disp_buf;


    mNumCores = GetCPUCoreCount();
    mNumCores = GetCPUCoreCount();
    mWaitForI = true;


    /* Initialize number of ref and reorder modes (for MPEG2) */
    /* Initialize number of ref and reorder modes (for MPEG2) */
    u4_num_reorder_frames = 16;
    u4_num_reorder_frames = 16;
@@ -448,6 +450,8 @@ status_t SoftMPEG2::reInitDecoder() {
void SoftMPEG2::onReset() {
void SoftMPEG2::onReset() {
    SoftVideoDecoderOMXComponent::onReset();
    SoftVideoDecoderOMXComponent::onReset();


    mWaitForI = true;

    resetDecoder();
    resetDecoder();
    resetPlugin();
    resetPlugin();
}
}
@@ -710,11 +714,22 @@ void SoftMPEG2::onQueueFilled(OMX_U32 portIndex) {
                outHeader->nTimeStamp = mTimeStamps[timeStampIdx];
                outHeader->nTimeStamp = mTimeStamps[timeStampIdx];
                mTimeStampsValid[timeStampIdx] = false;
                mTimeStampsValid[timeStampIdx] = false;


                /* mWaitForI waits for the first I picture. Once made FALSE, it
                   has to remain false till explicitly set to TRUE. */
                mWaitForI = mWaitForI && !(IV_I_FRAME == s_dec_op.e_pic_type);

                if (mWaitForI) {
                    s_dec_op.u4_output_present = false;
                } else {
                    ALOGV("Output timestamp: %lld, res: %ux%u",
                            (long long)outHeader->nTimeStamp, mWidth, mHeight);
                    DUMP_TO_FILE(mOutFile, outHeader->pBuffer, outHeader->nFilledLen);
                    outInfo->mOwnedByUs = false;
                    outInfo->mOwnedByUs = false;
                    outQueue.erase(outQueue.begin());
                    outQueue.erase(outQueue.begin());
                    outInfo = NULL;
                    outInfo = NULL;
                    notifyFillBufferDone(outHeader);
                    notifyFillBufferDone(outHeader);
                    outHeader = NULL;
                    outHeader = NULL;
                }
            } else {
            } else {
                /* If in flush mode and no output is returned by the codec,
                /* If in flush mode and no output is returned by the codec,
                 * then come out of flush mode */
                 * then come out of flush mode */
+1 −0
Original line number Original line Diff line number Diff line
@@ -105,6 +105,7 @@ private:
    // codec. So the codec is switching to decode the new resolution.
    // codec. So the codec is switching to decode the new resolution.
    bool mChangingResolution;
    bool mChangingResolution;
    bool mFlushNeeded;
    bool mFlushNeeded;
    bool mWaitForI;


    status_t initDecoder();
    status_t initDecoder();
    status_t deInitDecoder();
    status_t deInitDecoder();