diff options
| author | liubolun <bolun.liu@intel.com> | 2013-10-17 10:15:08 +0800 |
|---|---|---|
| committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 22:02:54 -0700 |
| commit | f6e051517175c02fb493a6a75e7d92a328df6e91 (patch) | |
| tree | 19717f69cf09517902d9ff48703155b01f0ce521 /videocodec/OMXVideoEncoderAVC.cpp | |
| parent | 553a7a54b12af58aaf776692247fbf88b5a06e5d (diff) | |
| download | android_hardware_intel_common_omx-components-f6e051517175c02fb493a6a75e7d92a328df6e91.tar.gz android_hardware_intel_common_omx-components-f6e051517175c02fb493a6a75e7d92a328df6e91.tar.bz2 android_hardware_intel_common_omx-components-f6e051517175c02fb493a6a75e7d92a328df6e91.zip | |
[PORT FROM R43-STABLE]Fix CTS failed case testSignalSurfaceEOS.
BZ: 145207
When recieved EOS signal and the input buffer size is zero,
OMX component should return but get the next output data.
Change-Id: I6689986055b42e80831d9aae5726192b7a1f8ede
Signed-off-by: liubolun <bolun.liu@intel.com>
Diffstat (limited to 'videocodec/OMXVideoEncoderAVC.cpp')
| -rwxr-xr-x | videocodec/OMXVideoEncoderAVC.cpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/videocodec/OMXVideoEncoderAVC.cpp b/videocodec/OMXVideoEncoderAVC.cpp index 18e4599..30c892e 100755 --- a/videocodec/OMXVideoEncoderAVC.cpp +++ b/videocodec/OMXVideoEncoderAVC.cpp @@ -557,23 +557,6 @@ OMX_ERRORTYPE OMXVideoEncoderAVC::ProcessorProcess( inBuf.flag = 0; inBuf.timeStamp = buffers[INPORT_INDEX]->nTimeStamp; - if (buffers[INPORT_INDEX]->nFlags & OMX_BUFFERFLAG_EOS) { - LOGV("%s(),%d: got OMX_BUFFERFLAG_EOS\n", __func__, __LINE__); - - if((inBuf.size<=0 || inBuf.data == NULL) && mSyncEncoding) { - LOGE("The Input buf is just a empty EOS buffer, in Sync encode," - "nothing to do, return with no error\n"); - retains[INPORT_INDEX] = BUFFER_RETAIN_NOT_RETAIN; - retains[OUTPORT_INDEX] = BUFFER_RETAIN_GETAGAIN; - return OMX_ErrorNone; - } - } else if(inBuf.size<=0 || inBuf.data == NULL) { - LOGE("The Input buf size is 0 or buf is NULL, return with error\n"); - return OMX_ErrorBadParameter; - } - - LOGV("Input OMX Buffer = 0x%x, size=%d, ts = %lld", inBuf.data, inBuf.size, buffers[INPORT_INDEX]->nTimeStamp); - //get frame encode info Encode_Info eInfo; uint32_t encodeInfo = (uint32_t) buffers[INPORT_INDEX]->pPlatformPrivate; @@ -589,6 +572,22 @@ OMX_ERRORTYPE OMXVideoEncoderAVC::ProcessorProcess( eInfo.FrameCount , FrameTypeStr[eInfo.FrameType], eInfo.EncodeComplete, eInfo.DataRetrieved, CacheOperationStr[eInfo.CacheOperation], eInfo.EndOfEncode ); + if (buffers[INPORT_INDEX]->nFlags & OMX_BUFFERFLAG_EOS) { + LOGV("%s(),%d: got OMX_BUFFERFLAG_EOS\n", __func__, __LINE__); + + if((inBuf.size<=0 || inBuf.data == NULL) && (mSyncEncoding || (eInfo.FrameCount == 0))) { + LOGV("The Input buf is just a empty EOS buffer, in Sync encode," "nothing to do, return with no error\n"); + retains[INPORT_INDEX] = BUFFER_RETAIN_NOT_RETAIN; + retains[OUTPORT_INDEX] = BUFFER_RETAIN_GETAGAIN; + return OMX_ErrorNone; + } + } else if(inBuf.size<=0 || inBuf.data == NULL) { + LOGE("The Input buf size is 0 or buf is NULL, return with error\n"); + return OMX_ErrorBadParameter; + } + + LOGV("Input OMX Buffer = 0x%x, size=%d, ts = %lld", inBuf.data, inBuf.size, buffers[INPORT_INDEX]->nTimeStamp); + if (eInfo.CacheOperation == CACHE_PUSH) { ProcessCacheOperation(buffers, retains, &eInfo); //nothing should be done in this case, just store status and return |
