diff options
author | SeungBeom Kim <sbcrux.kim@samsung.com> | 2010-09-21 15:36:08 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-09-27 10:57:00 -0700 |
commit | 4446949fada172a194be1f785e4bcc5dde1149d1 (patch) | |
tree | 4cef7d429b0b2d3d568ec67932527be9c8aaa997 /sec_mm/sec_omx/sec_omx_component/video/enc/h264enc | |
parent | 550332aee52a0afaa5b26bdf7963c600ae71106c (diff) | |
download | device_samsung_crespo-4446949fada172a194be1f785e4bcc5dde1149d1.zip device_samsung_crespo-4446949fada172a194be1f785e4bcc5dde1149d1.tar.gz device_samsung_crespo-4446949fada172a194be1f785e4bcc5dde1149d1.tar.bz2 |
S5PC11X: OMX: Change TimeStamp processing routine for Stagefright Seeking
Change-Id: I6a75b7a70013794e8c77bf43dd0ca288e9566235
Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
Diffstat (limited to 'sec_mm/sec_omx/sec_omx_component/video/enc/h264enc')
-rw-r--r-- | sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.c | 23 | ||||
-rw-r--r-- | sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.h | 2 |
2 files changed, 10 insertions, 15 deletions
diff --git a/sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.c b/sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.c index aca335a..fa6ad1a 100644 --- a/sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.c +++ b/sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.c @@ -242,9 +242,7 @@ void Set_H264ENC_Param(SSBSIP_MFC_ENC_H264_PARAM *pH264Arg, SEC_OMX_BASECOMPONEN break; } - H264PrintParams(*pH264Arg); - } OMX_ERRORTYPE SEC_MFC_H264Enc_GetParameter( @@ -603,7 +601,6 @@ EXIT: return ret; } - /* MFC Init */ OMX_ERRORTYPE SEC_MFC_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) { @@ -653,11 +650,11 @@ OMX_ERRORTYPE SEC_MFC_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) pSECComponent->processData[INPUT_PORT_INDEX].specificBufferHeader.YSize = pH264Enc->hMFCH264Handle.inputInfo.YSize; pSECComponent->processData[INPUT_PORT_INDEX].specificBufferHeader.CSize = pH264Enc->hMFCH264Handle.inputInfo.CSize; - SEC_OSAL_Memset(pH264Enc->hMFCH264Handle.timeStamp, 0, sizeof(OMX_TICKS) * MAX_TIMESTAMP); + SEC_OSAL_Memset(pSECComponent->timeStamp, -19771003, sizeof(OMX_TICKS) * MAX_TIMESTAMP); + SEC_OSAL_Memset(pSECComponent->nFlags, 0, sizeof(OMX_U32) * MAX_FLAGS); pH264Enc->hMFCH264Handle.indexTimestamp = 0; EXIT: - FunctionOut(); return ret; @@ -728,6 +725,7 @@ OMX_ERRORTYPE SEC_MFC_H264_Encode(OMX_COMPONENTTYPE *pOMXComponent, SEC_OMX_DATA pOutputData->dataBuffer = outputInfo.StrmVirAddr; pOutputData->allocSize = outputInfo.headerSize; pOutputData->dataLen = outputInfo.headerSize; + pOutputData->timeStamp = pInputData->timeStamp; pOutputData->nFlags |= OMX_BUFFERFLAG_CODECCONFIG; pOutputData->nFlags |= OMX_BUFFERFLAG_ENDOFFRAME; @@ -737,7 +735,8 @@ OMX_ERRORTYPE SEC_MFC_H264_Encode(OMX_COMPONENTTYPE *pOMXComponent, SEC_OMX_DATA goto EXIT; } - pH264Enc->hMFCH264Handle.timeStamp[pH264Enc->hMFCH264Handle.indexTimestamp] = pInputData->timeStamp; + pSECComponent->timeStamp[pH264Enc->hMFCH264Handle.indexTimestamp] = pInputData->timeStamp; + pSECComponent->nFlags[pH264Enc->hMFCH264Handle.indexTimestamp] = pInputData->nFlags; SsbSipMfcEncSetConfig(pH264Enc->hMFCH264Handle.hMFCHandle, MFC_ENC_SETCONF_FRAME_TAG, &(pH264Enc->hMFCH264Handle.indexTimestamp)); pH264Enc->hMFCH264Handle.indexTimestamp++; if (pH264Enc->hMFCH264Handle.indexTimestamp >= MAX_TIMESTAMP) @@ -778,10 +777,13 @@ OMX_ERRORTYPE SEC_MFC_H264_Encode(OMX_COMPONENTTYPE *pOMXComponent, SEC_OMX_DATA OMX_S32 indexTimestamp = 0; returnCodec = SsbSipMfcEncGetOutBuf(pH264Enc->hMFCH264Handle.hMFCHandle, &outputInfo); - if (SsbSipMfcEncGetConfig(pH264Enc->hMFCH264Handle.hMFCHandle, MFC_ENC_GETCONF_FRAME_TAG, &indexTimestamp) != MFC_RET_OK) { + if ((SsbSipMfcEncGetConfig(pH264Enc->hMFCH264Handle.hMFCHandle, MFC_ENC_GETCONF_FRAME_TAG, &indexTimestamp) != MFC_RET_OK) || + (((indexTimestamp < 0) || (indexTimestamp > MAX_TIMESTAMP)))){ pOutputData->timeStamp = pInputData->timeStamp; + pOutputData->nFlags = pInputData->nFlags; } else { - pOutputData->timeStamp = pH264Enc->hMFCH264Handle.timeStamp[indexTimestamp]; + pOutputData->timeStamp = pSECComponent->timeStamp[indexTimestamp]; + pOutputData->nFlags = pSECComponent->nFlags[indexTimestamp]; } if (returnCodec == MFC_RET_OK) { @@ -835,11 +837,6 @@ OMX_ERRORTYPE SEC_MFC_H264Enc_bufferProcess(OMX_COMPONENTTYPE *pOMXComponent, SE goto EXIT; } - if (pInputData->nFlags & OMX_BUFFERFLAG_EOS) - pOutputData->nFlags |= OMX_BUFFERFLAG_EOS; - else - pOutputData->nFlags = pOutputData->nFlags & (~OMX_BUFFERFLAG_EOS); - ret = SEC_MFC_H264_Encode(pOMXComponent, pInputData, pOutputData); if (ret != OMX_ErrorNone) { pSECComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent, diff --git a/sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.h b/sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.h index a90965f..80f6260 100644 --- a/sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.h +++ b/sec_mm/sec_omx/sec_omx_component/video/enc/h264enc/SEC_OMX_H264enc.h @@ -32,7 +32,6 @@ #include "OMX_Video.h" #include "SsbSipMfcApi.h" -#define MAX_TIMESTAMP 16 typedef struct _EXTRA_DATA { @@ -48,7 +47,6 @@ typedef struct _SEC_MFC_H264ENC_HANDLE SSBSIP_MFC_ENC_H264_PARAM mfcVideoAvc; SSBSIP_MFC_ENC_INPUT_INFO inputInfo; /* SSBSIP_MFC_ENC_OUTPUT_INFO outputInfo; */ - OMX_TICKS timeStamp[MAX_TIMESTAMP]; OMX_U32 indexTimestamp; OMX_BOOL bConfiguredMFC; EXTRA_DATA headerData; |