1、准备源码
(1)下载ortp源码:https://github.com/dmonakhov/ortp
(2)存放到临时工作目录并解压
2、源码修改
(1)由于这个没有支持H.264,所以增加H.264的payload支持。
在src/avprofile.c中357行添加:
rtp_profile_set_payload(profile,96,&payload_type_h264);
3、配置和编译、安装
(1)进入ortp目录执行./autogen.sh
(2)错误1:./autogen.sh: line 44: libtoolize: command not found
解决:sudo apt-get install libtool*
(2)错误2:libtoolize: error: Please install GNU M4, or 'export M4=/path/to/gnu/m4'.
解决:sudo apt-get install m4
(3)错误3:Automake - aclocal: command not found
解决:sudo apt-get install automake
运行结果:下面表示成功
+ aclocal
+ autoheader
+ automake --force-missing --add-missing --copy
configure.ac:41: installing './compile'
configure.ac:3: installing './config.guess'
configure.ac:3: installing './config.sub'
configure.ac:31: installing './install-sh'
configure.ac:31: installing './missing'
Makefile.am:20: warning: docdir was already defined in condition TRUE, which includes condition HAVE_DOXYGEN ...
configure.ac:2: ... 'docdir' previously defined here
Makefile.am:27: warning: <D: non-POSIX variable name
Makefile.am:60: warning: shell pwd: non-POSIX variable name
Makefile.am:60: (probably a GNU make extension)
src/Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/Makefile.am: installing './depcomp'
src/tests/Makefile.am:32: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
+ autoconf
(4)继续执行./configure --prefix=/tmp/ortp --host=arm-hisiv300-linux
--prefix:安装位置
--host:交叉编译工具链
(5)make && make install
4、到/tmp/ortp目录下查看移植好的库和头文件
aston@ubuntu:/tmp/ortp/lib$ ls
libortp.la libortp.so libortp.so.9 libortp.so.9.0.0 pkgconfig
aston@ubuntu:/tmp/ortp/lib$ cd ../include/
aston@ubuntu:/tmp/ortp/include$ ls
ortp
aston@ubuntu:/tmp/ortp/include$ cd ortp/
aston@ubuntu:/tmp/ortp/include/ortp$ ls
b64.h logging.h ortp_srtp.h port.h rtp.h rtpsession.h sessionset.h stun.h telephonyevents.h
event.h ortp.h payloadtype.h rtcp.h rtpprofile.h rtpsignaltable.h str_utils.h stun_udp.h zrtp.h