简体   繁体   English

使用Android平台的线程支持编译x264

[英]Compile x264 with Thread Support for Android Platform

I've been tryin' to compile x264 for Android with Thread Support...But with no success... 我一直在尝试使用线程支持为Android编译x264 ...但是没有成功...

I've managed to compile the same without thread support...The configure command is as follows : 我设法在没有线程支持的情况下进行了编译... configure命令如下:

./configure --prefix=$PREFIX \
--enable-pic \
--host=arm-linux \
--disable-cli \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
--sysroot=$PLATFORM 

where PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86 and PLATFORM=$NDK/platforms/android-14/arch-arm 其中PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86PLATFORM=$NDK/platforms/android-14/arch-arm

I've also tried with and without the option --enable-static and extra-ldflags="-lpthread" , but when attempted make it ends with errors. 我也试着使用和不使用选项--enable-staticextra-ldflags="-lpthread" ,但是当试图make它的错误结束。

Is there any way to accomplish the above said...? 有什么办法可以完成上述...?

The error that seemed to appear in config.log in context to thread support was cannot find lpthread ... That got resolved by manually removing the -lpthread from the configure file. 在线程支持的上下文中似乎出现在config.log中的错误cannot find lpthread ...通过从configure文件中手动删除-lpthread cannot find lpthread解决。 But then the configuration started failing at the test that included the struct cpu_set_t and CPU_COUNT() ... 但是随后配置开始在包含struct cpu_set_tCPU_COUNT()的测试中失败了...

Seems that certain libc functions and definitions are not included in the code provided with Android NDK (R8D) ...In the above case CPU_COUNT() and the definition for struct cpu_set_t ... 似乎某些libc函数和定义未包含在Android NDK(R8D)随附的代码中...在上述情况下, CPU_COUNT()struct cpu_set_t的定义...

The workaround for the above was to patch sched.h with the latest version ... There are a few bug reports in the Android Issue List describing the same problem which would hopefully be addressed in the next NDK release... 上面的解决方法是用最新版本修补sched.h ... Android问题列表中有一些错误报告,描述了相同的问题,有望在下一个NDK版本中解决...

Also x264 could be compiled to include the " ARM Support Feature " by including the option --extra-cflags="-mfloat-abi=softfp" ... 还可以通过包含选项--extra-cflags="-mfloat-abi=softfp"来将x264编译为包含“ ARM支持功能--extra-cflags="-mfloat-abi=softfp" ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM