summaryrefslogtreecommitdiffstats
path: root/domx
diff options
context:
space:
mode:
authorSarthak Aggarwal <sarthak@ti.com>2011-09-23 04:43:55 +0530
committerIliyan Malchev <malchev@google.com>2011-09-22 17:10:06 -0700
commit70f13fcd9afab8e2e2281fa52c3507ac93553d58 (patch)
tree7704beb34728debe712062f182a8e09a82b24a49 /domx
parentb471a4ea8699f7444612aa9e00fd2724e83a8d08 (diff)
downloadhardware_ti_omap4xxx-70f13fcd9afab8e2e2281fa52c3507ac93553d58.zip
hardware_ti_omap4xxx-70f13fcd9afab8e2e2281fa52c3507ac93553d58.tar.gz
hardware_ti_omap4xxx-70f13fcd9afab8e2e2281fa52c3507ac93553d58.tar.bz2
MPEG4 enc: Dont encode buffer with filled len zero.
Fixes b/5332812 Even in case filled len sent by client was 0, proxy was overriding it with a non-zero value leading ducati side to encode it. this patch rectifies that. Change-Id: Ic62cbf5e7bc580d213895475fa28fbb8a004ed7b Signed-off-by: Sarthak Aggarwal <sarthak@ti.com>
Diffstat (limited to 'domx')
-rw-r--r--domx/omx_proxy_component/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/domx/omx_proxy_component/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c b/domx/omx_proxy_component/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c
index b49700e..e08839a 100644
--- a/domx/omx_proxy_component/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c
+++ b/domx/omx_proxy_component/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c
@@ -536,6 +536,8 @@ OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_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;
#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
OMX_PROXY_MPEG4E_PRIVATE *pProxy = NULL;
TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
@@ -552,12 +554,30 @@ OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
pProxy = (OMX_PROXY_MPEG4E_PRIVATE *) pCompPrv->pCompProxyPrv;
#endif
+ 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_MPEG4E_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;
+ if(nFilledLen != 0)
+ {
+ 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,
pBufferHdr->nOffset, pBufferHdr->nFlags);
- if( pCompPrv->proxyPortBuffers[OMX_MPEG4E_INPUT_PORT].proxyBufferType == EncoderMetadataPointers)
+ if( pCompPrv->proxyPortBuffers[OMX_MPEG4E_INPUT_PORT].proxyBufferType == EncoderMetadataPointers
+ && nFilledLen != 0)
{
OMX_U32 *pTempBuffer;
OMX_U32 nMetadataBufferType;