get cpu cores for android

This commit is contained in:
volvet 2014-03-04 15:50:41 +08:00
parent ff94e7053d
commit 4d729c9418
3 changed files with 10 additions and 3 deletions

View File

@ -216,7 +216,7 @@ void WelsXmmRegEmptyOp(void * pSrc) {
#if defined(HAVE_NEON)//For supporting both android platform and iOS platform
#if defined(ANDROID_NDK)
uint32_t WelsCPUFeatureDetectAndroid()
uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors)
{
uint32_t uiCPU = 0;
AndroidCpuFamily cpuFamily = ANDROID_CPU_FAMILY_UNKNOWN;
@ -234,6 +234,11 @@ uint32_t WelsCPUFeatureDetectAndroid()
uiCPU |= WELS_CPU_NEON;
}
}
if( pNumberOfLogicProcessors != NULL ){
*pNumberOfLogicProcessors = android_getCpuCount();
}
return uiCPU;
}

View File

@ -82,7 +82,9 @@ void WelsXmmRegEmptyOp(void * pSrc);
#if defined(HAVE_NEON)
#if defined(ANDROID_NDK)
uint32_t WelsCPUFeatureDetectAndroid();
uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors);
#endif
#if defined(APPLE_IOS)

View File

@ -148,7 +148,7 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx) {
pCtx->uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores);
#elif defined(HAVE_NEON)
#if defined(ANDROID_NDK)
pCtx->uiCpuFlag = WelsCPUFeatureDetectAndroid();
pCtx->uiCpuFlag = WelsCPUFeatureDetect(&iCpuCores);
#endif
#if defined(APPLE_IOS)
pCtx->uiCpuFlag = WelsCPUFeatureDetectIOS();