summaryrefslogtreecommitdiffstats
path: root/libvideoeditor/osal
diff options
context:
space:
mode:
authorhongteng <hongteng@google.com>2011-04-21 23:01:07 -0700
committerhongteng <hongteng@google.com>2011-04-22 10:51:10 -0700
commit3b25fdc4a33b53cfcf67315c2d42ad699b8cefe2 (patch)
tree0333987ba73a33defc7dee67eb82fa67dbf14cff /libvideoeditor/osal
parent694816d7291f17364502ac5d3319684a0b180860 (diff)
downloadframeworks_av-3b25fdc4a33b53cfcf67315c2d42ad699b8cefe2.zip
frameworks_av-3b25fdc4a33b53cfcf67315c2d42ad699b8cefe2.tar.gz
frameworks_av-3b25fdc4a33b53cfcf67315c2d42ad699b8cefe2.tar.bz2
Fix for issue 3385135 "source code cleanup" engine part
- remove commented code - remove code under #if 0 - remove macro FILE_LOWER_CASE as it is not used - remove macro #if 1 - remove TIMESCALE_BUG macro, and all code under this macro as it is not used - remove following unused functions: * M4MCS_getExifInfo * M4MCS_registerAudioEncoderExtended * M4MCS_registerVideoDecoderExtended * M4MCS_registerAudioDecoderExtended * M4MCS_registerVideoEncoderExtended Change-Id: I8e2916d956af6d381ae1962fedc61a8b48f60ce2
Diffstat (limited to 'libvideoeditor/osal')
-rwxr-xr-xlibvideoeditor/osal/inc/M4OSA_Memory.h6
-rwxr-xr-xlibvideoeditor/osal/src/LVOSA_FileReader_optim.c24
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_FileCommon.c20
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_Thread.c156
-rwxr-xr-xlibvideoeditor/osal/src/M4PSW_MemoryInterface.c55
5 files changed, 0 insertions, 261 deletions
diff --git a/libvideoeditor/osal/inc/M4OSA_Memory.h b/libvideoeditor/osal/inc/M4OSA_Memory.h
index 7cb3d91..d80fff6 100755
--- a/libvideoeditor/osal/inc/M4OSA_Memory.h
+++ b/libvideoeditor/osal/inc/M4OSA_Memory.h
@@ -43,12 +43,6 @@ M4OSAL_MEMORY_EXPORT_TYPE extern M4OSA_MemAddr32 M4OSA_32bitAlignedMalloc (M4OSA
M4OSA_CoreID coreID,
M4OSA_Char* string);
-M4OSAL_MEMORY_EXPORT_TYPE extern M4OSA_MemAddr32 M4OSA_malloc (M4OSA_UInt32 size,
- M4OSA_CoreID coreID,
- M4OSA_Char* string);
-
-M4OSAL_MEMORY_EXPORT_TYPE extern M4OSA_Void M4OSA_free (M4OSA_MemAddr32 address);
-
M4OSAL_MEMORY_EXPORT_TYPE extern M4OSA_ERR M4OSA_randInit(void);
diff --git a/libvideoeditor/osal/src/LVOSA_FileReader_optim.c b/libvideoeditor/osal/src/LVOSA_FileReader_optim.c
index 14da016..dc84eab 100755
--- a/libvideoeditor/osal/src/LVOSA_FileReader_optim.c
+++ b/libvideoeditor/osal/src/LVOSA_FileReader_optim.c
@@ -450,30 +450,6 @@ M4OSA_ERR M4OSA_FileReader_CalculateSize(M4OSA_FileReader_Context_optim* apConte
err = errno;
M4OSA_TRACE1_1("M4OSA_FileReader_CalculateSize ERR = 0x%x", err);
}
-#if 0
- fileSeekPosition = 0;
- errno = apContext->FS->seek(apContext->aFileDesc, M4OSA_kFileSeekEnd, &fileSeekPosition);
-
- if (M4NO_ERROR != errno)
- {
- apContext->readFilePos = M4OSA_EOF;
- err = errno;
- M4OSA_TRACE1_1("M4OSA_FileReader_CalculateSize ERR1 = 0x%x", err);
- }
- else
- {
- /* Retrieve size of the file */
- errno = apContext->FS->getOption(apContext->aFileDesc,
- M4OSA_kFileReadGetFilePosition,
- (M4OSA_DataOption*) &apContext->fileSize);
- if (M4NO_ERROR != errno)
- {
- err = errno;
- M4OSA_TRACE1_1("M4OSA_FileReader_CalculateSize ERR2 = 0x%x", err);
- }
- apContext->readFilePos = apContext->fileSize;
- }
-#endif
#else
ret_val = apContext->FS->pFctPtr_Seek(apContext->aFileDesc, 0, M4OSA_kFileSeekEnd, &errno);
diff --git a/libvideoeditor/osal/src/M4OSA_FileCommon.c b/libvideoeditor/osal/src/M4OSA_FileCommon.c
index a012ec0..1a2dc45 100755
--- a/libvideoeditor/osal/src/M4OSA_FileCommon.c
+++ b/libvideoeditor/osal/src/M4OSA_FileCommon.c
@@ -45,7 +45,6 @@
#include "M4OSA_Memory.h"
#include "M4OSA_CharStar.h"
-//#define FILE_LOWER_CASE //defined to support limitaion of lower case file system in sdcard.
/**
************************************************************************
* @brief This function opens the provided URL and returns its context.
@@ -86,9 +85,6 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
FILE* pFileHandler = M4OSA_NULL;
M4OSA_FileContext *pFileContext = M4OSA_NULL;
-#ifdef FILE_LOWER_CASE
- M4OSA_Char *tmpLowerCaseUrl = M4OSA_NULL;
-#endif
#ifdef UTF_CONVERSION
/*FB: to test the UTF16->UTF8 conversion into Video Artist*/
@@ -108,7 +104,6 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
printf("file open %s\n", tempConversionBuf);
#endif /*UTF CONVERSION*/
-///*tmpLSA*/M4OSA_TRACE1_2("### M4OSA_fileCommonOpen %s 0x%X", pUrl, fileModeAccess);
M4OSA_TRACE3_4("M4OSA_fileCommonOpen\t\tM4OSA_UInt16 %d\tM4OSA_Context* 0x%x\t"
"M4OSA_Char* %s\tfileModeAccess %d", core_id, pContext, pUrl, fileModeAccess);
@@ -139,15 +134,6 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
M4OSA_DEBUG_IF1((M4OSA_FILE_WRITER == core_id) && !(fileModeAccess & M4OSA_kFileWrite),
M4ERR_FILE_BAD_MODE_ACCESS, "M4OSA_fileCommonOpen: M4OSA_kFileWrite");
-#ifdef FILE_LOWER_CASE
- tmpLowerCaseUrl = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(strlen(pUrl) +1, 0, "conversion buf");
- for(i=0; i<strlen(pUrl); i++)
- {
- tmpLowerCaseUrl[i] = M4OSA_chrToLower(pUrl[i]);
- }
- tmpLowerCaseUrl[i] = '\0'; //null terminate
-#endif
-
/* Create flag necessary for opening file */
if ((fileModeAccess & M4OSA_kFileRead) &&
(fileModeAccess & M4OSA_kFileWrite)&&(fileModeAccess & M4OSA_kFileCreate))
@@ -189,12 +175,7 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
/*Free the temporary decoded buffer*/
free(tempConversionBuf);
#else /* UTF_CONVERSION */
-#ifdef FILE_LOWER_CASE
- pFileHandler = fopen((const char *)tmpLowerCaseUrl, (const char *)mode);
- free(tmpLowerCaseUrl);
-#else
pFileHandler = fopen((const char *)pUrl, (const char *)mode);
-#endif
#endif /* UTF_CONVERSION */
if (M4OSA_NULL == pFileHandler)
@@ -326,7 +307,6 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
pFileContext->file_size = iSize;
*pContext = pFileContext;
-// /*tmpLSA*/M4OSA_TRACE1_1("### M4OSA_fileCommonOpen pFileContext 0x%X", pFileContext);
return M4NO_ERROR;
}
diff --git a/libvideoeditor/osal/src/M4OSA_Thread.c b/libvideoeditor/osal/src/M4OSA_Thread.c
index aa7666c..793c0e4 100755
--- a/libvideoeditor/osal/src/M4OSA_Thread.c
+++ b/libvideoeditor/osal/src/M4OSA_Thread.c
@@ -56,10 +56,6 @@ void* M4OSA_threadSyncForEverDo(void *context)
M4OSA_mutexLock(threadContext->stateMutex, M4OSA_WAIT_FOREVER);
- /*if(threadContext->startCallBack != M4OSA_NULL)
- {
- threadContext->startCallBack(threadContext, userData);
- }*/
threadContext->state = M4OSA_kThreadRunning;
@@ -156,11 +152,6 @@ M4OSA_ERR M4OSA_threadSyncOpen(M4OSA_Context* context,
threadContext->name = M4OSA_NULL;
threadContext->threadID = 0;
threadContext->coreID = M4OSA_THREAD;
-/*
- threadContext->userData = M4OSA_NULL;
- threadContext->stopCallBack = M4OSA_NULL;
- threadContext->startCallBack = M4OSA_NULL;
-*/
threadContext->state = M4OSA_kThreadOpened;
threadContext->priority = M4OSA_kThreadNormalPriority ;
@@ -256,29 +247,6 @@ M4OSA_ERR M4OSA_threadSyncStart(M4OSA_Context context,
{
if ( 0 == pthread_attr_setschedpolicy( &attribute, SCHED_OTHER ) )
{
-#if 0
- min = sched_get_priority_min( SCHED_OTHER );
- max = sched_get_priority_max( SCHED_OTHER );
-
- switch(threadContext->priority)
- {
- case M4OSA_kThreadLowestPriority:
- priority = min;
- break;
- case M4OSA_kThreadLowPriority:
- priority = min + ( max - min ) / 4;
- break;
- case M4OSA_kThreadNormalPriority:
- priority = min + ( max - min ) / 2;
- break;
- case M4OSA_kThreadHighPriority:
- priority = max - ( max - min ) / 4;
- break;
- case M4OSA_kThreadHighestPriority:
- priority = max;
- break;
- }
-#else
/* Tentative patches to handle priorities in a better way : */
/* Use Android's predefined priorities (range +19..-20)
*rather than Linux ones (0..99)*/
@@ -313,7 +281,6 @@ M4OSA_ERR M4OSA_threadSyncStart(M4OSA_Context context,
priority = ANDROID_PRIORITY_URGENT_AUDIO;
break;
}
-#endif
sched.sched_priority = priority;
if ( 0 == pthread_attr_setschedparam( &attribute, &sched ) )
@@ -546,48 +513,6 @@ M4OSA_ERR M4OSA_threadSleep(M4OSA_UInt32 time)
return M4NO_ERROR;
}
-
-
-
-#if(M4OSA_OPTIONID_THREAD_STARTED == M4OSA_TRUE)
-
-/*M4OSA_ERR M4OSA_SetThreadSyncStarted(M4OSA_Context context,
- M4OSA_DataOption optionValue)
-{
- M4OSA_ThreadContext* threadContext = (M4OSA_ThreadContext*)context ;
-
- M4OSA_TRACE2_2("M4OSA_SetThreadSyncStarted\t\tM4OSA_Context 0x%x\t"
- "M4OSA_DataOption 0x%x", context, optionValue);
-
- threadContext->startCallBack = (M4OSA_ThreadCallBack)optionValue;
-
- return M4NO_ERROR;
-}*/
-
-#endif /*M4OSA_OPTIONID_THREAD_STARTED*/
-
-
-
-
-#if(M4OSA_OPTIONID_THREAD_STOPPED == M4OSA_TRUE)
-
-/*M4OSA_ERR M4OSA_SetThreadSyncStopped(M4OSA_Context context,
- M4OSA_DataOption optionValue)
-{
- M4OSA_ThreadContext* threadContext = (M4OSA_ThreadContext*)context;
-
- M4OSA_TRACE2_2("M4OSA_SetThreadSyncStopped\t\tM4OSA_Context 0x%x\t"
- "M4OSA_DataOption 0x%x", context, optionValue);
-
- threadContext->stopCallBack = (M4OSA_ThreadCallBack)optionValue;
-
- return M4NO_ERROR;
-}*/
-
-#endif /*M4OSA_OPTIONID_THREAD_STOPPED*/
-
-
-
#if(M4OSA_OPTIONID_THREAD_PRIORITY == M4OSA_TRUE)
M4OSA_ERR M4OSA_SetThreadSyncPriority(M4OSA_Context context,
@@ -673,29 +598,6 @@ M4OSA_ERR M4OSA_SetThreadSyncStackSize(M4OSA_Context context,
#endif /*M4OSA_OPTIONID_THREAD_STACK_SIZE*/
-
-
-#if(M4OSA_OPTIONID_THREAD_USER_DATA == M4OSA_TRUE)
-
-/*M4OSA_ERR M4OSA_SetThreadSyncUserData(M4OSA_Context context,
- M4OSA_DataOption optionValue)
-{
- M4OSA_ThreadContext* threadContext = (M4OSA_ThreadContext*)context;
-
- M4OSA_TRACE2_2("M4OSA_SetThreadSyncUserData\t\tM4OSA_Context 0x%x\t"
- "M4OSA_DataOption 0x%x", context, optionValue);
-
- threadContext->userData = (M4OSA_Void*)optionValue;
-
- return M4NO_ERROR;
-}*/
-
-#endif /*M4OSA_OPTIONID_THREAD_USER_DATA*/
-
-
-
-
-
/**
************************************************************************
* @brief This method asks the core OSAL-Thread component to set the value
@@ -756,32 +658,6 @@ M4OSA_ERR M4OSA_threadSyncSetOption(M4OSA_Context context,
switch(optionID)
{
-#if(M4OSA_OPTIONID_THREAD_STARTED == M4OSA_TRUE)
- /*case M4OSA_ThreadStarted:
- {
- err_code = M4OSA_SetThreadSyncStarted(context, optionValue);
-
- break;
- }*/
-#endif /*M4OSA_OPTIONID_THREAD_STARTED*/
-
-#if(M4OSA_OPTIONID_THREAD_STOPPED == M4OSA_TRUE)
- /*case M4OSA_ThreadStopped:
- {
- err_code = M4OSA_SetThreadSyncStopped(context, optionValue);
-
- break;
- }*/
-#endif /*M4OSA_OPTIONID_THREAD_STOPPED*/
-
-#if(M4OSA_OPTIONID_THREAD_USER_DATA == M4OSA_TRUE)
- /*case M4OSA_ThreadUserData:
- {
- err_code = M4OSA_SetThreadSyncUserData(context, optionValue);
-
- break;
- }*/
-#endif /*M4OSA_OPTIONID_THREAD_USER_DATA*/
#if(M4OSA_OPTIONID_THREAD_PRIORITY == M4OSA_TRUE)
case M4OSA_ThreadPriority:
@@ -876,38 +752,6 @@ M4OSA_ERR M4OSA_threadSyncGetOption(M4OSA_Context context,
switch(optionID)
{
-#if(M4OSA_OPTIONID_THREAD_STARTED == M4OSA_TRUE)
- /*case M4OSA_ThreadStarted:
- {
- M4OSA_ThreadCallBack* startCallBack = (M4OSA_ThreadCallBack*)optionValue;
-
- *startCallBack = threadContext->startCallBack;
-
- return M4NO_ERROR;
- }*/
-#endif /*M4OSA_OPTIONID_THREAD_STARTED*/
-
-#if(M4OSA_OPTIONID_THREAD_STOPPED == M4OSA_TRUE)
- /*case M4OSA_ThreadStopped:
- {
- M4OSA_ThreadCallBack* stopCallBack = (M4OSA_ThreadCallBack*)optionValue;
-
- *stopCallBack = threadContext->stopCallBack;
-
- return M4NO_ERROR;
- }*/
-#endif /*M4OSA_OPTIONID_THREAD_STOPPED*/
-
-#if(M4OSA_OPTIONID_THREAD_USER_DATA == M4OSA_TRUE)
- /*case M4OSA_ThreadUserData:
- {
- M4OSA_Void** userData = (M4OSA_Void**)optionValue;
-
- *userData = threadContext->userData;
-
- return M4NO_ERROR;
- }*/
-#endif /*M4OSA_OPTIONID_THREAD_USER_DATA*/
#if(M4OSA_OPTIONID_THREAD_PRIORITY == M4OSA_TRUE)
case M4OSA_ThreadPriority:
diff --git a/libvideoeditor/osal/src/M4PSW_MemoryInterface.c b/libvideoeditor/osal/src/M4PSW_MemoryInterface.c
index a069b9b..6c33fc1 100755
--- a/libvideoeditor/osal/src/M4PSW_MemoryInterface.c
+++ b/libvideoeditor/osal/src/M4PSW_MemoryInterface.c
@@ -68,60 +68,5 @@ M4OSA_MemAddr32 M4OSA_32bitAlignedMalloc(M4OSA_UInt32 size,
return Address;
}
-/**
- ************************************************************************
- * @fn M4OSA_MemAddr32 M4OSA_malloc(M4OSA_UInt32 size,
- * M4OSA_CoreID coreID,
- * M4OSA_Char* string)
- * @brief this function allocates a memory block (at least 32 bits aligned)
- * @note
- * @param size (IN): size of allocated block in bytes
- * @param coreID (IN): identification of the caller component
- * @param string (IN): description of the allocated block (null terminated)
- * @return address of the allocated block, M4OSA_NULL if no memory available
- ************************************************************************
-*/
-
-M4OSA_MemAddr32 M4OSA_malloc(M4OSA_UInt32 size,
- M4OSA_CoreID coreID,
- M4OSA_Char* string)
-{
- M4OSA_MemAddr32 Address = M4OSA_NULL;
-
- /**
- * If size is 0, malloc on WIN OS allocates a zero-length item in
- * the heap and returns a valid pointer to that item.
- * On other platforms, malloc could returns an invalid pointer
- * So, DON'T allocate memory of 0 byte */
- if (size == 0)
- {
- return Address;
- }
-
- if (size%4 != 0)
- {
- size = size + 4 - (size%4);
- }
-
- Address = (M4OSA_MemAddr32) malloc(size);
-
- return Address;
-}
-
-
-/**
- ************************************************************************
- * @fn M4OSA_Void M4OSA_free(M4OSA_MemAddr32 address)
- * @brief this function free the provided memory block
- * @note As in stlib.h, this function does nothing if address is NULL.
- * @param address (IN): address of the block to free
- * @return none
- ************************************************************************
-*/
-
-M4OSA_Void M4OSA_free (M4OSA_MemAddr32 address)
-{
- free(address);
-}
#endif