ref: 73cc5862bad6518709f9a74f194d008fd2150734
parent: ff94e7053df980111eb7f22a04e4c0cfd6b84c97
parent: 4d729c94186457f205fc73e375a781af9468229a
author: Licai Guo <licaguo@cisco.com>
date: Tue Mar 4 11:16:39 EST 2014
Merge pull request #403 from volvet/get-cpu-cores-android get cpu cores for android
--- a/codec/common/cpu.cpp
+++ b/codec/common/cpu.cpp
@@ -216,7 +216,7 @@
#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 @@
uiCPU |= WELS_CPU_NEON;
}
}
+
+ if( pNumberOfLogicProcessors != NULL ){
+ *pNumberOfLogicProcessors = android_getCpuCount();
+ }
+
return uiCPU;
}
--- a/codec/common/cpu.h
+++ b/codec/common/cpu.h
@@ -82,7 +82,9 @@
#if defined(HAVE_NEON)
#if defined(ANDROID_NDK)
- uint32_t WelsCPUFeatureDetectAndroid();
+
+uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors);
+
#endif
#if defined(APPLE_IOS)
--- a/codec/decoder/core/src/decoder.cpp
+++ b/codec/decoder/core/src/decoder.cpp
@@ -148,7 +148,7 @@
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();