diff options
author | Pradeep Venkatasubbarao <pradeepv@ti.com> | 2011-10-24 00:40:59 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@git.omapzoom.org> | 2011-10-24 00:40:59 -0500 |
commit | 9ec51a2f849f87febb58be13e25613ae2e4f675c (patch) | |
tree | 73433e90b080d7ffc7273e39bdb243829d35eeaf | |
parent | aade1a239ce39c926927fc5ca957a1124ce3d78f (diff) | |
parent | 265048077b145ccf0834b2807fb6fa14281c63ff (diff) | |
download | hardware_ti_omap4-9ec51a2f849f87febb58be13e25613ae2e4f675c.zip hardware_ti_omap4-9ec51a2f849f87febb58be13e25613ae2e4f675c.tar.gz hardware_ti_omap4-9ec51a2f849f87febb58be13e25613ae2e4f675c.tar.bz2 |
Merge "DOMX: Skips DCC URI query altogether if DCC data is missing"
-rw-r--r--[-rwxr-xr-x] | omx_proxy_component/omx_camera/src/omx_proxy_camera.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/omx_proxy_component/omx_camera/src/omx_proxy_camera.c b/omx_proxy_component/omx_camera/src/omx_proxy_camera.c index 7a42902..f72dabe 100755..100644 --- a/omx_proxy_component/omx_camera/src/omx_proxy_camera.c +++ b/omx_proxy_component/omx_camera/src/omx_proxy_camera.c @@ -127,6 +127,7 @@ int mmap_fd; MemAllocBlock *MemReqDescTiler; #endif +OMX_BOOL check_DCCdir(OMX_STRING dir_path); OMX_S32 read_DCCdir(OMX_PTR, OMX_STRING *, OMX_U16); OMX_ERRORTYPE DCC_Init(OMX_HANDLETYPE); OMX_ERRORTYPE send_DCCBufPtr(OMX_HANDLETYPE hComponent); @@ -350,7 +351,7 @@ OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent) PROXY_assert(eOsalError == TIMM_OSAL_ERR_NONE, OMX_ErrorInsufficientResources, "Mutex lock failed"); - if (numofInstance == 0) + if ( ( numofInstance == 0 ) && check_DCCdir(DCC_PATH) ) { dcc_eError = DCC_Init(hComponent); if (dcc_eError != OMX_ErrorNone) @@ -538,6 +539,52 @@ OMX_ERRORTYPE send_DCCBufPtr(OMX_HANDLETYPE hComponent) /* ===========================================================================*/ /** + * @name check_DCCdir() + * @brief : Checks if the DCC directory exists and whether it contains + * any useful data. + * @param OMX_STRING: dir_path Path to theDCC directory + * @return return = OMX_TRUE if data is available, otherwise OMX_FALSE + * + */ +/* ===========================================================================*/ +OMX_BOOL check_DCCdir(OMX_STRING dir_path) +{ + OMX_BOOL ret = OMX_FALSE; + struct dirent *dirEntry = NULL; + DIR *dccDir = NULL; + OMX_STRING dot = "."; + + DOMX_ENTER("ENTER"); + + dccDir = opendir(dir_path); + if ( NULL != dccDir ) { + do { + dirEntry = readdir(dccDir); + if ( NULL != dirEntry ) { + if ( dot[0] == dirEntry->d_name[0] ) { + DOMX_DEBUG("Skipping DCC directory: %s", dirEntry->d_name); + continue; + } else { + DOMX_DEBUG("Valid data found in DCC directory: %s", dirEntry->d_name); + ret = OMX_TRUE; + break; + } + } else { + DOMX_DEBUG("NO entries in the DCC Directory"); + } + } while ( dirEntry != NULL ); + closedir(dccDir); + } else { + DOMX_DEBUG("No DCC Directory !"); + } + + DOMX_EXIT("return %d", ret); + + return ret; +} + +/* ===========================================================================*/ +/** * @name read_DCCdir() * @brief : copies all the dcc profiles into the allocated 1D-Tiler buffer * and returns the size of the buffer. |