diff options
author | Sarthak Aggarwal <sarthak@ti.com> | 2011-08-27 11:45:59 +0530 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-08-29 12:02:59 -0700 |
commit | c6d1deff9a4cffd55b5bc94f6999ac3b29309b6d (patch) | |
tree | 922595d1a96f756856e2171deb6e920b0e3ee53f /domx/omx_proxy_component | |
parent | 831d195f81fcd391e54bddd46b56e251f84f4638 (diff) | |
download | hardware_ti_omap4xxx-c6d1deff9a4cffd55b5bc94f6999ac3b29309b6d.zip hardware_ti_omap4xxx-c6d1deff9a4cffd55b5bc94f6999ac3b29309b6d.tar.gz hardware_ti_omap4xxx-c6d1deff9a4cffd55b5bc94f6999ac3b29309b6d.tar.bz2 |
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 <sarthak@ti.com>
Diffstat (limited to 'domx/omx_proxy_component')
-rw-r--r-- | domx/omx_proxy_component/omx_h264_enc/src/omx_proxy_h264enc.c | 23 |
1 files changed, 21 insertions, 2 deletions
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; } |