1 | [root@linuxgam src]# bzip2 -dc jrtplib-2.7b.tar.bz2 | tar xvf - |
1 2 3 | [root@linuxgam src]# cd jrtplib-2.7 [root@linuxgam jrtplib-2.7b]# ./configure [root@linuxgam jrtplib-2.7b]# make |
1 | [root@linuxgam jrtplib-2.7b]# make install |
1 2 3 4 5 6 7 8 | #include "rtpsession.h" int main(void) { RTPSession sess; sess.Create(5000); return 0; } |
1 2 3 4 5 6 7 8 9 10 11 12 | #include <stdio.h> #include "rtpsession.h" int main(void) { RTPSession sess; int status; char* msg; sess.Create(6000); msg = RTPGetErrorString(status); printf("Error String: %s\\n", msg); return 0; } |
1 | sess.SetTimestampUnit(1.0/8000.0); |
1 2 | unsigned long addr = ntohl(inet_addr("127.0.0.1")); sess.AddDestination(addr, 6000); |
1 2 3 4 5 6 | int SendPacket(void *data,int len) int SendPacket(void *data,int len,unsigned char pt,bool mark,unsigned long timestampinc) int SendPacket(void *data,int len,unsigned short hdrextID,void *hdrextdata, int numhdrextwords) int SendPacket(void *data,int len,unsigned char pt,bool mark,unsigned long timestampinc, unsigned short hdrextID,void *hdrextdata,int numhdrextwords) |
1 | sess.SendPacket(buffer, 5, 0, false, 10); |
1 2 3 | sess.SetDefaultPayloadType(0); sess.SetDefaultMark(false); sess.SetDefaultTimeStampIncrement(10); |
1 | sess.SendPacket(buffer, 5); |
1 2 3 4 5 6 7 8 | if (sess.GotoFirstSourceWithData()) { do { RTPPacket *pack; pack = sess.GetNextPacket(); // 处理接收到的数据 delete pack; } while (sess.GotoNextSourceWithData()); } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |