summaryrefslogtreecommitdiffstats
path: root/domx/omx_proxy_common
diff options
context:
space:
mode:
authorPradeep Venkatasubbarao <pradeepv@ti.com>2011-10-27 11:17:59 +0530
committerPradeep Venkatasubbarao <pradeepv@ti.com>2011-10-27 11:17:59 +0530
commitbc2bfd1c5dd8616e9521889600e375402691a7c7 (patch)
tree3444235654a5706f59a288185d9bd2b6842f03d1 /domx/omx_proxy_common
parent515fe8be50be3f6e296b812c28b35f557ea20922 (diff)
downloadhardware_ti_omap4-bc2bfd1c5dd8616e9521889600e375402691a7c7.zip
hardware_ti_omap4-bc2bfd1c5dd8616e9521889600e375402691a7c7.tar.gz
hardware_ti_omap4-bc2bfd1c5dd8616e9521889600e375402691a7c7.tar.bz2
Added support for 2D virtual buffers
This patch adds support for passing multiple 2D virtual buffers by passing a descriptor structure in pBuffer of OMX buffer header. Interface only support is added for platform 1D and 2D buffers which is envisioned to be used for passing ION handles Signed-off-by: Abhishek Ranka <asranka@ti.com> Conflicts: omx_core/inc/OMX_TI_Index.h Change-Id: I112fbcda623d89e5f20c2e8000caba99f76678ae
Diffstat (limited to 'domx/omx_proxy_common')
-rw-r--r--domx/omx_proxy_common/src/omx_proxy_common.c56
1 files changed, 48 insertions, 8 deletions
diff --git a/domx/omx_proxy_common/src/omx_proxy_common.c b/domx/omx_proxy_common/src/omx_proxy_common.c
index 3014bf1..82e44b0 100644
--- a/domx/omx_proxy_common/src/omx_proxy_common.c
+++ b/domx/omx_proxy_common/src/omx_proxy_common.c
@@ -1100,6 +1100,13 @@ static OMX_ERRORTYPE PROXY_UseBuffer(OMX_IN OMX_HANDLETYPE hComponent,
((OMX_TI_PLATFORMPRIVATE *) pBufferHeader->pPlatformPrivate)->
pAuxBuf1 = NULL;
}
+ if(pCompPrv->proxyPortBuffers[nPortIndex].proxyBufferType == BufferDescriptorVirtual2D)
+ {
+ pAuxBuf0 = (OMX_U8 *)(((OMX_TI_BUFFERDESCRIPTOR_TYPE*)pBuffer)->pBuf[0]);
+
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHeader->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_U8 *)(((OMX_TI_BUFFERDESCRIPTOR_TYPE*)pBuffer)->pBuf[1]);
+ }
}
/*Initializing Structure */
@@ -1333,6 +1340,7 @@ OMX_ERRORTYPE __PROXY_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_TI_PARAM_USEBUFFERDESCRIPTOR *ptBufDescParam = NULL;
#ifdef ENABLE_GRALLOC_BUFFERS
OMX_TI_PARAMUSENATIVEBUFFER *pParamNativeBuffer = NULL;
#endif
@@ -1346,9 +1354,10 @@ OMX_ERRORTYPE __PROXY_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
DOMX_ENTER
("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
hComponent, pCompPrv, nParamIndex, pParamStruct);
-#ifdef ENABLE_GRALLOC_BUFFERS
+
switch(nParamIndex)
{
+#ifdef ENABLE_GRALLOC_BUFFERS
case OMX_TI_IndexUseNativeBuffers:
{
//Add check version.
@@ -1360,16 +1369,29 @@ OMX_ERRORTYPE __PROXY_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
}
break;
}
+#endif
+ case OMX_TI_IndexUseBufferDescriptor:
+ ptBufDescParam = (OMX_TI_PARAM_USEBUFFERDESCRIPTOR *) pParamStruct;
+ if(ptBufDescParam->bEnabled == OMX_TRUE)
+ {
+ if(ptBufDescParam->eBufferType == OMX_TI_BufferTypeVirtual2D)
+ {
+ pCompPrv->proxyPortBuffers[ptBufDescParam->nPortIndex].proxyBufferType = BufferDescriptorVirtual2D;
+ pCompPrv->proxyPortBuffers[ptBufDescParam->nPortIndex].IsBuffer2D = OMX_TRUE;
+ }
+ }
+ else if(ptBufDescParam->bEnabled == OMX_FALSE)
+ {
+ /* Reset to defaults*/
+ pCompPrv->proxyPortBuffers[ptBufDescParam->nPortIndex].proxyBufferType = VirtualPointers;
+ pCompPrv->proxyPortBuffers[ptBufDescParam->nPortIndex].IsBuffer2D = OMX_FALSE;
+ }
+ break;
default:
eRPCError =
RPC_SetParameter(pCompPrv->hRemoteComp, nParamIndex, pParamStruct,
pLocBufNeedMap, &eCompReturn);
}
-#else
- eRPCError =
- RPC_SetParameter(pCompPrv->hRemoteComp, nParamIndex, pParamStruct,
- pLocBufNeedMap, &eCompReturn);
-#endif
PROXY_checkRpcError();
@@ -1413,6 +1435,7 @@ OMX_ERRORTYPE __PROXY_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_TI_PARAM_USEBUFFERDESCRIPTOR *ptBufDescParam = NULL;
PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
PROXY_assert((hComp->pComponentPrivate != NULL),
@@ -1424,9 +1447,26 @@ OMX_ERRORTYPE __PROXY_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
hComponent, pCompPrv, nParamIndex, pParamStruct);
- eRPCError =
- RPC_GetParameter(pCompPrv->hRemoteComp, nParamIndex, pParamStruct,
+ switch(nParamIndex)
+ {
+ case OMX_TI_IndexUseBufferDescriptor:
+ ptBufDescParam = (OMX_TI_PARAM_USEBUFFERDESCRIPTOR *) pParamStruct;
+ if(pCompPrv->proxyPortBuffers[ptBufDescParam->nPortIndex].proxyBufferType == BufferDescriptorVirtual2D)
+ {
+ ptBufDescParam->bEnabled = OMX_TRUE;
+ ptBufDescParam->eBufferType = OMX_TI_BufferTypeVirtual2D;
+ }
+ else
+ {
+ ptBufDescParam->bEnabled = OMX_FALSE;
+ ptBufDescParam->eBufferType = OMX_TI_BufferTypeMax;
+ }
+ break;
+
+ default:
+ eRPCError = RPC_GetParameter(pCompPrv->hRemoteComp, nParamIndex, pParamStruct,
pLocBufNeedMap, &eCompReturn);
+ }
PROXY_checkRpcError();