资源简介
开源jrtp代码,rtp协议代码,支持视频单播组播技术,视频会议系统常用的协议
代码片段和文件信息
/*
Here‘s a small IPv4 example: it asks for a portbase and a destination and
starts sending packets to that destination.
*/
#include “rtpsession.h“
#include “rtpudpv4transmitter.h“
#include “rtpipv4address.h“
#include “rtpsessionparams.h“
#include “rtperrors.h“
#ifndef WIN32
#include
#include
#else
#include
#endif // WIN32
#include
#include
#include
#include
using namespace jrtplib;
//
// This function checks if there was a RTP error. If so it displays an error
// message and exists.
//
void checkerror(int rtperr)
{
if (rtperr < 0)
{
std::cout << “ERROR: “ << RTPGetErrorString(rtperr) << std::endl;
exit(-1);
}
}
//
// The main routine
//
int main(void)
{
#ifdef WIN32
WSADATA dat;
WSAStartup(MAKEWORD(22)&dat);
#endif // WIN32
RTPSession sess;
uint16_t portbasedestport;
uint32_t destip;
std::string ipstr;
int statusinum;
// First we‘ll ask for the necessary information
std::cout << “Enter local portbase:“ << std::endl;
std::cin >> portbase;
std::cout << std::endl;
std::cout << “Enter the destination IP address“ << std::endl;
std::cin >> ipstr;
destip = inet_addr(ipstr.c_str());
if (destip == INADDR_NONE)
{
std::cerr << “Bad IP address specified“ << std::endl;
return -1;
}
// The inet_addr function returns a value in network byte order but
// we need the IP address in host byte order so we use a call to
// ntohl
destip = ntohl(destip);
std::cout << “Enter the destination port“ << std::endl;
std::cin >> destport;
std::cout << std::endl;
std::cout << “Number of packets you wish to be sent:“ << std::endl;
std::cin >> num;
// Now we‘ll create a RTP session set the destination send some
// packets and poll for incoming data.
RTPUDPv4TransmissionParams transparams;
RTPSessionParams sessparams;
// IMPORTANT: The local timestamp unit MUST be set otherwise
// RTCP Sender Report info will be calculated wrong
// In this case we‘ll be sending 10 samples each second so we‘ll
// put the timestamp unit to (1.0/10.0)
sessparams.SetOwnTimestampUnit(1.0/10.0);
sessparams.SetAcceptOwnPackets(true);
transparams.SetPortbase(portbase);
status = sess.Create(sessparams&transparams);
checkerror(status);
RTPIPv4Address addr(destipdestport);
status = sess.AddDestination(addr);
checkerror(status);
for (i = 1 ; i <= num ; i++)
{
printf(“\nSending packet %d/%d\n“inum);
// send the packet
status = sess.SendPacket((void *)“1234567890“100false10);
checkerror(status);
sess.BeginDataAccess();
// check incoming packets
if (sess.GotoFirstSourceWithData())
{
do
{
RTPPacket *pack;
while ((pack = sess.GetNextPacket()) != NULL)
{
// You can examine the data here
printf(“Got packet !\n“);
// we don‘t longer need the packet so
// we‘ll delete it
sess.DeletePacket(pack);
}
} while (ses
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-07-29 08:17 jrtplib-3.9.0\
文件 0 2011-07-25 14:53 jrtplib-3.9.0\TODO
文件 7340 2006-02-21 09:29 jrtplib-3.9.0\aboutrfc3550
目录 0 2011-07-29 08:17 jrtplib-3.9.0\cmake\
文件 1191 2011-07-25 14:53 jrtplib-3.9.0\cmake\FindJThread.cmake
文件 109 2011-07-25 14:53 jrtplib-3.9.0\cmake\JRTPLIBConfig.cmake.in
文件 3861 2011-07-25 14:53 jrtplib-3.9.0\cmake\Macros.cmake
目录 0 2011-07-29 08:17 jrtplib-3.9.0\doc\
文件 13846 2011-07-25 14:53 jrtplib-3.9.0\doc\jrtplib.h
目录 0 2011-07-29 08:17 jrtplib-3.9.0\tools\
文件 475 2011-07-25 14:53 jrtplib-3.9.0\tools\ipv6mcasttest.cpp
文件 442 2011-07-25 14:53 jrtplib-3.9.0\tools\ipv4mcasttest.cpp
文件 338 2011-07-25 14:53 jrtplib-3.9.0\tools\salentest.cpp
文件 876 2010-09-30 08:38 jrtplib-3.9.0\tools\gettypes.cpp
文件 90 2011-07-25 14:53 jrtplib-3.9.0\tools\getloginrtest.cpp
文件 359 2011-07-25 14:53 jrtplib-3.9.0\tools\ipv6test.cpp
文件 385 2011-07-25 14:53 jrtplib-3.9.0\tools\socklentest.cpp
目录 0 2011-07-29 08:17 jrtplib-3.9.0\src\
文件 2790 2011-07-22 21:08 jrtplib-3.9.0\src\rtcpunknownpacket.h
文件 2734 2011-07-22 21:08 jrtplib-3.9.0\src\rtpipv4address.cpp
文件 7574 2011-07-22 21:08 jrtplib-3.9.0\src\rtppacket.h
文件 10972 2011-07-22 21:08 jrtplib-3.9.0\src\rtperrors.h
文件 3374 2011-07-22 21:08 jrtplib-3.9.0\src\rtprandomrand48.cpp
文件 5896 2011-07-22 21:08 jrtplib-3.9.0\src\rtcpcompoundpacket.cpp
文件 4451 2011-07-22 21:08 jrtplib-3.9.0\src\rtcpsdesinfo.cpp
文件 10936 2011-07-22 21:08 jrtplib-3.9.0\src\rtpsessionparams.h
文件 18851 2011-07-22 21:08 jrtplib-3.9.0\src\rtcppacketbuilder.cpp
文件 11442 2011-07-25 14:53 jrtplib-3.9.0\src\rtpudpv6transmitter.h
文件 4669 2011-07-22 21:08 jrtplib-3.9.0\src\rtpinternalsourcedata.h
文件 26464 2011-07-25 14:53 jrtplib-3.9.0\src\rtpsession.h
文件 7317 2011-07-22 21:08 jrtplib-3.9.0\src\rtcpscheduler.h
............此处省略92个文件信息
- 上一篇:IOS五子棋小
- 下一篇:MicroMouse_高级实验
相关资源
- 基于FPGA的sdi视频传输工程(k7_sdi_rx
- 郭天祥ARM9视频教程
- vc编写中国象棋详细源码注释并附有视
- 视频处理控件TVideoGrabber.v6.7.5.For.Del
- 视频会议,VC视频会议源码.
- 液晶显示器VGA视频接口及显示规范
- 2019最新黑马程序员前端39期全套视频
- 千锋elasticsearch视频教程带笔记
- 基于Linux、QT的视频监控系统的设计与
- 233网校视频器2018最新绿色版
- 网络视频嗅探器
- 视频嗅探器 任意视频
- ts格式视频
- 易语言版迅雷视频转换器源码
- 基于Blackfin的无线IP视频监控解决方案
- 天津市卫生局视频会议系统规划建设
- 幼儿园手机视频监控应用方案
- 2017年-传智播客-张志君老师-SpringBoo
- AxureRP8.0学习视频以及免费的软件和元
- Infortrend小型视频编辑解决方案加快您
- Infortrend ESVA强力支持江苏电视台日益
- Infortrend中型视频编辑解决方案
- H.264视频编码基本知识
- LSI 3ware 6Gb提高视频采集和编辑的吞吐
- 12种测试视频文件
- 百万年薪架构师公开课视频
- 一个很好用的屏幕录像工具,支持x
- 基于工业以太网的嵌入式视频监控系
- 基于V4L2的视频采集,能够采集YUVJPE
- springcloud 微服务(全套视频)
评论
共有 条评论