jrtp安装测试笔记

来源:互联网 发布:淘宝客收费公式 编辑:程序博客网 时间:2024/05/16 10:54

jrtp安装测试笔记wang@20120327
-----PC 编译---------------
tar zxvf jthread-1.2.1.tar.gz -C /wxl
cd /wxl
cd jthread-1.2.1
./configure --prefix=/opt/pc-jrtp
make
sudo make install

tar zxvf jrtplib-3.7.1.tar.gz -C /wxl
cd /wxl
cd jrtplib-3.7.1
./configure --prefix=/opt/pc-jrtp/ --with-jthread-includes=/opt/pc-jrtp/include/jthread LDFLAGS=-L/opt/pc-jrtp/lib

修改文件 gedit src/rtpdefines.h
增加头文件
#include <stdio.h>
#include <stdarg.h>
#include <string.h>

修改#define RTP_SNPRINTF snprintf 为 #define RTP_SNPRINTF printf
---------------------
make
sudo make install

---------------------arm编译------------------------------
tar zxvf jthread-1.2.1.tar.gz -C /wxl/arm-rtp
cd /wxl/arm-rtp
cd jthread-1.2.1
./configure --prefix=/opt/arm-jrtp -host=arm-linux CC=arm-linux-gcc CXX=arm-linux-g++
make
make install

tar zxvf jrtplib-3.7.1.tar.gz -C /wxl/arm-rtp
cd jrtplib-3.7.1
./configure --prefix=/opt/arm-jrtp -host=arm-linux -with-jthread-includes=/opt/arm-jrtp/includes CC=arm-linux-gcc CXX=arm-linux-g++ LDFLAGS=-L/opt/arm-jrtp/lib

修改文件 gedit src/rtpconfig_unix.h
//#define RTP_BIG_ENDIAN  如果开发板是小端模式注释掉RTP_BIG_ENDIAN 定义

make
make install

------------------------------------------
测试板子大小端
gedti testbig.c

#include <stdio.h>
#include <string.h>

int main(void)
{
 int num=0x1234;
 char *p=&num;
 if(*p==0x12)
 {
  printf("Big Endian\n");
 }
 else
 {
  printf("Little Endian\n");
 }
 return 0;
}

编译:arm-linux-gcc -o testbig testbig.c
开发板上运行 ./testbig
----------------------------
测试
(1) 首先把编译为 PC 所用的库文件: libjrtp-3.7.1.so 与 libjthread.so 复制到ubuntu 的 /lib 。

(2) 把交叉编译后生成的库文件 :libjrtp-3.7.1.so 与 libjthread.so 复制到开发板上的 /lib 。

(3) PC执行 /wxl/jrtp-3.7.1/example 下的 example4 。
[root@localhost examples]# ./example4

Enter local portbase:

9090

Number of seconds you wish to wait:

200

(4) 把 /wxl/arm-jrtp/jrtp-3.7.1/example/example1 复制到开发板上并执行 ./example1

[root@6410]# ./example1

Enter local portbase:

9090

Enter the destination IP address

192.168.0.178

Enter the destination port

9090

Number of packets you wish to be sent:

50

(5) 如果在 PC 上出现 Got packet 则表示可以收到开发板发过来的数据包

Got packet 32390 from SSRC 609572025

Got packet 32391 from SSRC 609572025

 

 

 

 

 

 

 


 

原创粉丝点击