rtplib是国外的一个牛人用C++实现的RTP协议库,完全开源,可以在Windows、linux、wince等一些常用的系统中使用。jrtplib-3.7.1的使用需要jthread-1.2.1,你可以在这位牛人的主页里下载这两个源代码包:
jrtplib-3.7.1:http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jrtplib
jthread-1.2.1:http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jthread
编译设置过程:
1.解压jrtplib-3.7.1和jthread-1.2.1
2.用VC打开工程文件jthread.dsw
3. 编译jrtplib.lib和jthread.lib需要注意VC6要求安装Vs6sp6,在编译jrtplib.lib和jthread.lib前,在 project——settings——C/C++——Code generation:use run-time library中,对于debug,选择:Debug Multithreaded DLL,对于release,则选择:Multithreaded DLL。
4.首先编译jthread库,然后将jthread-1.2.1/src内的"jmutex.h"和"jthread.h"两个头文件放入jrtplib-3.7.1/src目录下,然后将jrtplib-3.7.1/src文件夹下所有头文件中的<jmutex.h>和<jthread.h>语句修改为"jmutex.h"和"jthread.h",需要修改的文件为rtpudpv4transmitter.h、rtpsession.h和rtppollthread.h。编译时注意编译方式和jthread.lib一致。
5.编译生成的jthread.lib和jrtplib.lib拷贝到系统目录:C:/Program Files/Microsoft Visual Studio/VC98/Lib下,将jrtplib-3.7.1/src下所有的.h头文件复制到C:/Program Files/Microsoft Visual Studio/VC98/Include,以便以后使用。
6.现在我们就可以编译jrtplib-3.7.1/examples下的实例程序了。建立VC工程,打开example1.c,在Project Settings的link页添加jthread.lib jrtplib.lib ws2_32.lib,在project——settings——C/C++——Code generation:use run-time library中,对于debug,选择:Debug Multithreaded DLL,对于release,则选择:Multithreaded DLL。
7.编译源程序,运行就OK啦