IOS webRTC library supporting both armv7 and arm64

How can I get a webRTC library that will support both armv7 and arm64 in iOS?

+5
source share
3 answers

What a score. I just finished integrating webrtc in my project for a couple of days. My solution as below:

  • Combine all * .a that you created for armv7 into libWebRTC-armv7.a: Using the command line as shown below

    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

  • Combine all * .a that you created for arm64 into libWebRTC-arm64.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

  • Create your libWebRTC, supported by both armv7 and arm64:

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

Ps: Just create your armv7 library to split the folder using arm64:

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 
+7
source

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

I wrote a shell script to create WebRTC sources for the framework (excluding the apprtc signaling library) for using iOS.

If you cannot read Chinese, you just read that the script is built into this blog, that's enough! Oh.

 ./build_webrtc.sh build_all 

There may be an error in the armv7 device. this error was caused by a stack problem over a stream in VP8 decoding in the armv7 neon function.

You can confirm this patch to fix the failure:

 diff --git a/source/libvpx/vp8/common/arm/neon/vp8_subpixelvariance_neon.cb/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 it could help you!

Diveinedu.com students have just overcome and corrected this error.

0
source

thanks phuongle, it really works ...

... but with a twist ...

... as Omer Wakas Khan noted, there may be a case where you can see an error message (while lipo-ing): both libraries cannot have the same structure .

Of course, I went to WTF ... itโ€™s lipo, whatโ€™s wrong with you ... they have a different structure ... I BUILT THEM THAT WAY ...

But then I decided to double check this:
- I went to the folder where I had arm64_merged lib and ...

 lipo -info lib's_name.a 

Both types of armv7 and arm64 were reported to exist. Puzzled, I then ...

 lipo -info *.a 

... all libraries (72 of them) reported type arm64, with the exception of 2 ...

 libisac_fix.a libisac_neon.a 

For some reason they were armv7. Earlier that day, I used the clone "webrtc thingy", consisting of several days. Then I remember that I always received only 70 libraries. But then, for other reasons, I decided

 gclient sync 

After that, I ran out of 72 ... as such, I just removed the meaningless libisac. Now 2 fat_libs were of different types, and I could successfully lipo.

0
source

Source: https://habr.com/ru/post/1213031/


All Articles