简体   繁体   English

支持armv7和arm64的iOS webRTC库

[英]iOS webRTC library supporting both armv7 & arm64

如何获得支持iOS中armv7和arm64的webRTC库?

You are lucky. 你很幸运。 I have just finished to integrate webrtc in my project for couple days. 我刚刚完成将webrtc集成到我的项目中几天。 My solution as below: 我的解决方案如下:

  1. Combine all *.a you built for armv7 to libWebRTC-armv7.a: Using command lines as below 将为armv7构建的所有* .a组合到libWebRTC-armv7.a:使用如下命令行

    libtool -static -o src/out_ios_armv7/Release-iphoneos/libWebRTC-temp.a src/out_ios_armv7/Release-iphoneos/*.a libtool -static -o src / out_ios_armv7 / Release-iphoneos / libWebRTC-temp.a src / out_ios_armv7 / Release-iphoneos / * .a

    strip -S -x -o src/out_ios_armv7/Release-iphoneos/libWebRTC-armv7.a -r src/out_ios_armv7/Release-iphoneos/libWebRTC-temp.a strip -S -x -o src / out_ios_armv7 / Release-iphoneos / libWebRTC-armv7.a -r src / out_ios_armv7 / Release-iphoneos / libWebRTC-temp.a

  2. Combine all *.a you built for arm64 to libWebRTC-arm64.a: 将为arm64构建的所有* .a组合到libWebRTC-arm64.a:

    libtool -static -o src/out_ios/Release-iphoneos/libWebRTC-temp.a src/out_ios/Release-iphoneos/*.a libtool -static -o src / out_ios / Release-iphoneos / libWebRTC-temp.a src / out_ios / Release-iphoneos / * .a

    strip -S -x -o src/out_ios/Release-iphoneos/libWebRTC-arm64.a -r src/out_ios/Release-iphoneos/libWebRTC-temp.a strip -S -x -o src / out_ios / Release-iphoneos / libWebRTC-arm64.a -r src / out_ios / Release-iphoneos / libWebRTC-temp.a

  3. Create your libWebRTC supported both armv7 and arm64: 创建libWebRTC支持armv7和arm64:

    lipo -create src/out_ios_armv7/Release-iphoneos/libWebRTC-armv7.a src/out_ios/Release-iphoneos/libWebRTC-arm64.a -output libWebRTC.a lipo -create src / out_ios_armv7 / Release-iphoneos / libWebRTC-armv7.a src / out_ios / Release-iphoneos / libWebRTC-arm64.a -output libWebRTC.a

Ps: Just build your armv7 library to separated folder with arm64: Ps:使用arm64将armv7库构建到分离的文件夹:

export GYP_GENERATORS="ninja"
export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1 OS=ios target_arch=armv7"
export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_ios_armv7"
export GYP_CROSSCOMPILE=1
pushd src
gclient runhooks
ninja -C out_ios_armv7/Release-iphoneos AppRTCDemo
popd

You can refer to our blog: 你可以参考我们的博客:

http://io.diveinedu.com/2015/02/02/%E7%AC%AC%E4%BA%94%E7%AB%A0-WebRTC%E7%9A%84iOS%E6%A1%86%E6%9E%B6%E7%BC%96%E8%AF%91.html http://io.diveinedu.com/2015/02/02/%E7%AC%AC%E4%BA%94%E7%AB%A0-WebRTC%E7%9A%84iOS%E6%A1%86%E6 %9E%B6%E7%BC%96%E8%AF%91.html

I have wrote a shell script to build WebRTC sources to a framework(excluding the apprtc signaling library) for iOS use. 我编写了一个shell脚本来构建WebRTC源到一个框架(不包括apprtc信令库)供iOS使用。

If you cann't read Chinese, you just read that script embedded in that blog, it's enough! 如果你不懂中文,你只需阅读该博客中嵌入的脚本,就足够了! aha. 啊哈。

./build_webrtc.sh build_all

There may be a bug in armv7 device. armv7设备可能存在错误。 that bug was caused by a stack over flow issue in VP8 decoding in armv7 neon function. 该错误是由armv7 neon函数中的VP8解码中的堆栈溢出问题引起的。

You can confirm this patch to fixes crash for it: 您可以确认此修补程序以修复崩溃:

diff --git a/source/libvpx/vp8/common/arm/neon/vp8_subpixelvariance_neon.c b/source/libvpx/vp8/common/arm/neon/vp8_subpixelvariance_neon.c
index 8308d55..a66b6f5 100644
--- a/source/libvpx/vp8/common/arm/neon/vp8_subpixelvariance_neon.c
+++ b/source/libvpx/vp8/common/arm/neon/vp8_subpixelvariance_neon.c
@@ -1003,7 +1003,7 @@ unsigned int vp8_sub_pixel_variance8x8_neon(
         const unsigned char *dst,
         int dst_stride,
         unsigned int *sse) {
-  DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight8 * kWidth8);
+  DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight8PlusOne * kWidth8);
   DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight8PlusOne * kWidth8);
   if (xoffset == 0) {
     var_filter_block2d_bil_w8(src, temp2, src_stride, kWidth8, kHeight8,

Wish this can help you! 希望这可以帮到你!

The students of diveinedu.com have just overcome and fixed this bug. diveinedu.com的学生刚刚克服并修复了这个错误。

thanks phuongle, this really works... 谢谢phuongle,这真的有用......

...but with a twist... ......但是扭曲......

...as Omer Waqas Khan noticed, there might be a case where one might encounter the error message (while lipo-ing): both libs can't be of the same structure . ......正如Omer Waqas Khan所注意到的那样,可能会出现一个人可能会遇到错误信息的情况(同时出现问题): 两个lib都不能具有相同的结构

Of course, I went WTF...lipo, what's wrong with you...they are of different structure...I BUILT THEM THAT WAY... 当然,我去了WTF ......胖子,你怎么了......他们的结构不同......我建议他们这样做......

But then I set out to double check it: 但后来我开始仔细检查它:
- I went in the folder where I had the arm64_merged lib and... - 我进入了arm64_merged lib的文件夹...

lipo -info lib's_name.a

It reported back of being of both armv7 and arm64 type. 它报告了armv7和arm64类型。 Puzzled, I then... 困惑,我接着......

lipo -info *.a

...all the libraries (72 of them) reported being of type arm64 except for 2... ...所有的库(其中72个)报告的类型为arm64,除了2 ...

libisac_fix.a
libisac_neon.a

For whatever reason they were armv7. 无论出于何种原因,他们都是armv7。 Earlier in the day, I was using a "a few days old" clone of the webrtc thingy. 当天早些时候,我正在使用webrtc thingy的“几天之久”克隆。 Back then, I remember always obtaining only 70 libraries. 那时候,我记得总是只获得70个图书馆。 But then, for other reasons, I decided to 但是,由于其他原因,我决定

gclient sync

After that, I ended up with 72...as such, I just removed the libisac nonsense. 在那之后,我结束了72 ...因此,我刚刚删除了libisac废话。 Now the 2 fat_libs were of different types and I could successfully lipo. 现在2个fat_libs是不同类型的,我可以成功地脂肪。

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

相关问题 Worklight 6.0.0.1 iOS Native Library仅适用于ARMv7而不适用于ARMv7和ARM64? - Worklight 6.0.0.1 iOS Native Library only for ARMv7 and not for ARMv7s and ARM64? 是否有同时支持 armv7 和 arm64 的 GoogleAnalyticsServicesIOS sdk? - Is there GoogleAnalyticsServicesIOS sdk which supports both armv7 and arm64? 如果我的部署目标是 8.0,我们是否需要为“armv7”和“arm64”编译 iOS 应用程序? - Do we need to compile iOS App for both “armv7” and “arm64” if my deployment target is 8.0? unity vuforia xcode (iOS: armv7, arm64) - Unity vuforia xcode (iOS: armv7, arm64) 具有i386 x86_64 armv7 armv7s arm64的通用IOS静态库 - universal IOS static library with i386 x86_64 armv7 armv7s arm64 条件链接arm64 / armv7 - Conditional link arm64/armv7 Lipo不为arm64,armv7创建 - Lipo in not creating for arm64, armv7 具有ARMv7和ARMv8-A(arm64)指令集的iOS设备上的ARMv4,ARMv5E,ARMv6程序集用法 - ARMv4, ARMv5E, ARMv6 assembly usage on iOS devices with ARMv7 and ARMv8-A (arm64) instructions sets 适用于armv7,armv7s和arm64的iOS开源构建 - iOS open source build for armv7 , armv7s ,arm64 armv7,armv7s和arm64的ipa存档版本无法安装到iOS 5.1.1设备 - ipa archive build for armv7, armv7s and arm64 cannot be installed to iOS 5.1.1 devices
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM