From c6d1deff9a4cffd55b5bc94f6999ac3b29309b6d Mon Sep 17 00:00:00 2001 From: Sarthak Aggarwal Date: Sat, 27 Aug 2011 11:45:59 +0530 Subject: Enable NPA mode on h264 encoder. This patch completes the i/p buffer optimization in case of metadata buffers The patch also sets the correct alloc length and filled length to ducati side OMX encoder, while gives the metadata size to the OMX IL client Change-Id: I0ac758c367ceb9affa6e47fedbc20a80d7058b31 Signed-off-by: Sarthak Aggarwal --- .../omx_h264_enc/src/omx_proxy_h264enc.c | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'domx') diff --git a/domx/omx_proxy_component/omx_h264_enc/src/omx_proxy_h264enc.c b/domx/omx_proxy_component/omx_h264_enc/src/omx_proxy_h264enc.c index de2417d..f35037b 100644 --- a/domx/omx_proxy_component/omx_h264_enc/src/omx_proxy_h264enc.c +++ b/domx/omx_proxy_component/omx_h264_enc/src/omx_proxy_h264enc.c @@ -284,7 +284,7 @@ OMX_ERRORTYPE LOCAL_PROXY_H264E_SetParameter(OMX_IN OMX_HANDLETYPE hComponent, tParamSetNPA.nVersion.s.nRevision = 0x0; tParamSetNPA.nVersion.s.nStep = 0x0; tParamSetNPA.nPortIndex = OMX_H264E_INPUT_PORT; - tParamSetNPA.bEnabled = OMX_TRUE; + tParamSetNPA.bEnabled = OMX_FALSE; //Call NPA on OMX encoder on ducati. PROXY_SetParameter(hComponent,OMX_TI_IndexParamBufferPreAnnouncement, &tParamSetNPA); pCompPrv->proxyPortBuffers[pStoreMetaData->nPortIndex].proxyBufferType = EncoderMetadataPointers; @@ -389,6 +389,8 @@ OMX_ERRORTYPE LOCAL_PROXY_H264E_EmptyThisBuffer(OMX_HANDLETYPE hComponent, OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent; OMX_PTR pBufferOrig = NULL; OMX_U32 nStride = 0, nNumLines = 0; + OMX_PARAM_PORTDEFINITIONTYPE tParamStruct; + OMX_U32 nFilledLen, nAllocLen; PROXY_require(pBufferHdr != NULL, OMX_ErrorBadParameter, NULL); PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter, @@ -397,6 +399,20 @@ OMX_ERRORTYPE LOCAL_PROXY_H264E_EmptyThisBuffer(OMX_HANDLETYPE hComponent, pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate; + tParamStruct.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + tParamStruct.nVersion.s.nVersionMajor = OMX_VER_MAJOR; + tParamStruct.nVersion.s.nVersionMinor = OMX_VER_MINOR; + tParamStruct.nVersion.s.nRevision = 0x0; + tParamStruct.nVersion.s.nStep = 0x0; + tParamStruct.nPortIndex = OMX_H264E_INPUT_PORT; + + eError = PROXY_GetParameter(hComponent, OMX_IndexParamPortDefinition, &tParamStruct); + PROXY_require(eError == OMX_ErrorNone, OMX_ErrorBadParameter, "Error is Get Parameter for port def"); + nFilledLen = pBufferHdr->nFilledLen; + nAllocLen = pBufferHdr->nAllocLen; + pBufferHdr->nFilledLen = tParamStruct.nBufferSize; + pBufferHdr->nAllocLen = tParamStruct.nBufferSize; + DOMX_DEBUG ("%s hComponent=%p, pCompPrv=%p, nFilledLen=%d, nOffset=%d, nFlags=%08x", __FUNCTION__,hComponent, pCompPrv, pBufferHdr->nFilledLen, @@ -459,8 +475,11 @@ OMX_ERRORTYPE LOCAL_PROXY_H264E_EmptyThisBuffer(OMX_HANDLETYPE hComponent, PROXY_EmptyThisBuffer(hComponent, pBufferHdr); if( pCompPrv->proxyPortBuffers[pBufferHdr->nInputPortIndex].proxyBufferType == EncoderMetadataPointers) + { pBufferHdr->pBuffer = pBufferOrig; - + pBufferHdr->nFilledLen = nFilledLen; + pBufferHdr->nAllocLen = nAllocLen; + } EXIT: return eError; } -- cgit v1.1