Older versions of Android don't have this function.
Showing the changes to codec/common/src/WelsThreadLib.cpp (1 of 1 file). Show all
Unified · Split
| @@ -58,6 +58,9 @@ · 57 unmodified lines | |||
| 58 | #ifdef ANDROID_NDK | 58 | #ifdef ANDROID_NDK |
| 59 | #include <cpu-features.h> | 59 | #include <cpu-features.h> |
| 60 | #endif | 60 | #endif |
| 61 | #ifdef __ANDROID__ | ||
| 62 | #include <android/api-level.h> | ||
| 63 | #endif | ||
| 61 | 64 | ||
| 62 | #include "WelsThreadLib.h" | 65 | #include "WelsThreadLib.h" |
| 63 | #include <stdio.h> | 66 | #include <stdio.h> |
| @@ -252,7 +255,7 @@ WELS_THREAD_ERROR_CODE WelsThreadSetName (const char* thread_name) { · 188 unmodified lines | |||
| 252 | #ifdef APPLE_IOS | 255 | #ifdef APPLE_IOS |
| 253 | pthread_setname_np(thread_name); | 256 | pthread_setname_np(thread_name); |
| 254 | #endif | 257 | #endif |
| 255 | #ifdef __ANDROID__ | 258 | #if defined(__ANDROID__) && __ANDROID_API__ >= 9 |
| 256 | pthread_setname_np(pthread_self(), thread_name); | 259 | pthread_setname_np(pthread_self(), thread_name); |
| 257 | #endif | 260 | #endif |
| 258 | // do nothing | 261 | // do nothing |