基于Android系统PJSIP库植入g729编码

前言

有时候由于工作的需求,我们需要基于Android系统的PJSIP库支持G.729编码,原来的库在编译的时候并没有支持此编码,通话会听不见声音,下面我就介绍下如何构建支持G.729编码的PJSIP库,希望能够帮助到需要的小伙伴。

操作步骤

1.从仓库下载最新的 PJSIP。

下载地址:https://github.com/pjsip/pjproject/releases
在这里插入图片描述

2.下载补丁
下载地址:https://github.com/saravnandm/pjsip2.5-g729codec
在这里插入图片描述

3.将你的PJSIP项目中的所有文件作为给定补丁中的目录。

在这里插入图片描述

PJSip 2.5 + G729 codec

Steps to integrate g729 codec with the pjsip-2.5 library.

    Download g729 patch here
    Download pjsip-2.5 library here
    Unzip both the downloaded zip files. 
    Set the permission of the ./pjsip-2.5 folder to 777, By executing the below command in terminal.
        $chmod -R 777 /pjproject-2.5
    Apply pjproject-2.5.diff patch first.
    Copy the source and build files of g729 codec from "./pjsip2.5-g729codec/pjproject-2.5/" to the corresponding location of your pjproject-2.5. Make sure you are moving the files to the same location as the patch(pjproject-2.5). Create the dir structure if not exists.


NOTE

    Patch is tested with pjsip2.5 only
    g729 codec is not an open source library. So make sure you have the licence to use.
    g729 codec source(pj.diff file) taken from linphone opensource project.


COMMON ERRORS
Error 1:
bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
Fix:
open your script with vi or vim and enter in vi command mode (key ESC), then type this:
:set fileformat=unix
Press return and finally save it
:x! or :wq!
Error 2:
Undefined symbols for architecture armv7s:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../bin/samples/arm-apple-darwin9/pjsua2_demo] Error 1
make[2]: *** [pjsua2_demo] Error 2
make[1]: *** [samples] Error 2
make: *** [all] Error 1
Fix:
$ make clean
$ rm pjsip-apps/build/output/pjsua2_sample-arm-apple-darwin9/pjsua2_demo.o

Error 3:
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv7s, VALID_ARCHS=armv7)

Fix:
To solve this issue, just turn off the ONLY_ACTIVE_ARCH flag. Open the Build Settings->Build Active Architecutre Only flag-> change from YES to NO.

帮助文档地址

4.按照 pjproject-2.5.diff 的说明应用更改。
5.构建。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

五一编程

程序之路有我与你同行

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值