summaryrefslogtreecommitdiffstats
path: root/domx
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2012-04-25 17:03:54 -0500
committerTyler Luu <tluu@ti.com>2012-05-24 17:53:03 -0500
commit5db7c4afb1ac4eb05f3cba6600f750cf2979c0df (patch)
tree24866b55b1ba737addc4f6089bb6c65bab4adff8 /domx
parentf7061dd8a8c219cfc2d4b10c268b522bed707eb3 (diff)
downloadhardware_ti_omap4-5db7c4afb1ac4eb05f3cba6600f750cf2979c0df.zip
hardware_ti_omap4-5db7c4afb1ac4eb05f3cba6600f750cf2979c0df.tar.gz
hardware_ti_omap4-5db7c4afb1ac4eb05f3cba6600f750cf2979c0df.tar.bz2
proxy common: choose buffer 1st in AllocateBuffer
Moving choose buffer logic to the beginning of AllocateBuffer so we can use it to index tBufList array when saving ion handle information Fixes an issue missed by "domx: fix video record" Change-Id: Icf5ddcda8b2ffdc67f5ac337b4e7b683b90c053f Signed-off-by: Tyler Luu <tluu@ti.com>
Diffstat (limited to 'domx')
-rw-r--r--domx/omx_proxy_common/src/omx_proxy_common.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/domx/omx_proxy_common/src/omx_proxy_common.c b/domx/omx_proxy_common/src/omx_proxy_common.c
index 0b33633..8fa4044 100644
--- a/domx/omx_proxy_common/src/omx_proxy_common.c
+++ b/domx/omx_proxy_common/src/omx_proxy_common.c
@@ -644,6 +644,27 @@ OMX_ERRORTYPE PROXY_AllocateBuffer(OMX_IN OMX_HANDLETYPE hComponent,
("hComponent = %p, pCompPrv = %p, nPortIndex = %p, pAppPrivate = %p, nSizeBytes = %d",
hComponent, pCompPrv, nPortIndex, pAppPrivate, nSizeBytes);
+ /*Pick up 1st empty slot */
+ /*The same empty spot will be picked up by the subsequent
+ Use buffer call to fill in the corresponding buffer
+ Buffer header in the list */
+
+ bSlotFound = OMX_FALSE;
+ for (i = 0; i < pCompPrv->nTotalBuffers; i++)
+ {
+ if (pCompPrv->tBufList[i].pBufHeader == NULL)
+ {
+ currentBuffer = i;
+ bSlotFound = OMX_TRUE;
+ break;
+ }
+ }
+
+ if (bSlotFound == OMX_FALSE)
+ {
+ currentBuffer = pCompPrv->nTotalBuffers;
+ }
+
/*To find whether buffer is 2D or 1D */
eError =
RPC_UTIL_GetStride(pCompPrv->hRemoteComp, nPortIndex, &nStride);
@@ -681,25 +702,6 @@ OMX_ERRORTYPE PROXY_AllocateBuffer(OMX_IN OMX_HANDLETYPE hComponent,
goto EXIT;
}
#endif
- /*Pick up 1st empty slot */
- /*The same empty spot will be picked up by the subsequent
- Use buffer call to fill in the corresponding buffer
- Buffer header in the list */
-
- for (i = 0; i < pCompPrv->nTotalBuffers; i++)
- {
- if (pCompPrv->tBufList[i].pBufHeader == NULL)
- {
- currentBuffer = i;
- bSlotFound = OMX_TRUE;
- break;
- }
- }
-
- if (!bSlotFound)
- {
- currentBuffer = pCompPrv->nTotalBuffers;
- }
/*No need to increment Allocated buffers here.
It will be done in the subsequent use buffer call below*/