diff options
author | Lajos Molnar <lajos@google.com> | 2015-04-17 23:49:24 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-17 23:49:24 +0000 |
commit | d2dc1ea3a3426238b9dcb4b2fa17f98a1ac5beec (patch) | |
tree | 799323ac6f69717ac69b4313b37c9294cd954975 /media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp | |
parent | 541a9ac77ecaa26449fcad5c116fb93657ca17c1 (diff) | |
parent | 88574352adec1af117d21bb6fadf85b3b9b2f4bc (diff) | |
download | frameworks_av-d2dc1ea3a3426238b9dcb4b2fa17f98a1ac5beec.zip frameworks_av-d2dc1ea3a3426238b9dcb4b2fa17f98a1ac5beec.tar.gz frameworks_av-d2dc1ea3a3426238b9dcb4b2fa17f98a1ac5beec.tar.bz2 |
am 88574352: am 7725022e: Merge "SoftMPEG2: start output at first I-frame"
* commit '88574352adec1af117d21bb6fadf85b3b9b2f4bc':
SoftMPEG2: start output at first I-frame
Diffstat (limited to 'media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp')
-rw-r--r-- | media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp b/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp index fb7394b..7e98928 100644 --- a/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp +++ b/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp @@ -245,6 +245,7 @@ status_t SoftMPEG2::setFlushMode() { return UNKNOWN_ERROR; } + mWaitForI = true; mIsInFlush = true; return OK; } @@ -257,6 +258,7 @@ status_t SoftMPEG2::initDecoder() { UWORD32 u4_share_disp_buf; mNumCores = GetCPUCoreCount(); + mWaitForI = true; /* Initialize number of ref and reorder modes (for MPEG2) */ u4_num_reorder_frames = 16; @@ -448,6 +450,8 @@ status_t SoftMPEG2::reInitDecoder() { void SoftMPEG2::onReset() { SoftVideoDecoderOMXComponent::onReset(); + mWaitForI = true; + resetDecoder(); resetPlugin(); } @@ -710,11 +714,22 @@ void SoftMPEG2::onQueueFilled(OMX_U32 portIndex) { outHeader->nTimeStamp = mTimeStamps[timeStampIdx]; mTimeStampsValid[timeStampIdx] = false; - outInfo->mOwnedByUs = false; - outQueue.erase(outQueue.begin()); - outInfo = NULL; - notifyFillBufferDone(outHeader); - outHeader = NULL; + /* 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; + outQueue.erase(outQueue.begin()); + outInfo = NULL; + notifyFillBufferDone(outHeader); + outHeader = NULL; + } } else { /* If in flush mode and no output is returned by the codec, * then come out of flush mode */ |