rtp与rtcp的VC编程例子

w_zhen_x 2009-03-02 11:02:44
谁有rtp与rtcp的VC编程例子。。给个网址看看,或者发到我邮箱:w_zhen_x@163.com
谢谢了。。
...全文
327 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
sos2999 2010-03-09
  • 打赏
  • 举报
回复
同样想了解,帮顶。。。
gengzhiwei 2009-03-05
  • 打赏
  • 举报
回复

jrtplib

首先从http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jrtplib,下载最新版的jrtplib,到http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jthread 下载最新的jthread

再搜索些编译的方式,就可以了!!!
csbinchina 2009-03-04
  • 打赏
  • 举报
回复
jf
w_zhen_x 2009-03-04
  • 打赏
  • 举报
回复
有没有实例
xyj0663 2009-03-03
  • 打赏
  • 举报
回复
LZ,帖个例子给你,记得给分啊
/*
This IPv4 example uses the background thread itself to process all packets.
You can use example one to send data to the session that's created in this
example.
*/

#include "rtpsession.h"
#include "rtppacket.h"
#include "rtpudpv4transmitter.h"
#include "rtpipv4address.h"
#include "rtpsessionparams.h"
#include "rtperrors.h"
#ifndef WIN32
#include <netinet/in.h>
#include <arpa/inet.h>
#else
#include <winsock2.h>
#endif // WIN32
#include "rtpsourcedata.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>

#ifdef RTP_SUPPORT_THREAD

//
// 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 new class routine
//

class MyRTPSession : public RTPSession
{
protected:
void OnPollThreadStep();
void ProcessRTPPacket(const RTPSourceData &srcdat,const RTPPacket &rtppack);
};

void MyRTPSession::OnPollThreadStep()
{
BeginDataAccess();

// check incoming packets
if (GotoFirstSourceWithData())
{
do
{
RTPPacket *pack;
RTPSourceData *srcdat;

srcdat = GetCurrentSourceInfo();

while ((pack = GetNextPacket()) != NULL)
{
ProcessRTPPacket(*srcdat,*pack);
DeletePacket(pack);
}
} while (GotoNextSourceWithData());
}

EndDataAccess();
}

void MyRTPSession::ProcessRTPPacket(const RTPSourceData &srcdat,const RTPPacket &rtppack)
{
// You can inspect the packet and the source's info here
std::cout << "Got packet " << rtppack.GetExtendedSequenceNumber() << " from SSRC " << srcdat.GetSSRC() << std::endl;
}

//
// The main routine
//

int main(void)
{
#ifdef WIN32
WSADATA dat;
WSAStartup(MAKEWORD(2,2),&dat);
#endif // WIN32

MyRTPSession sess;
uint16_t portbase;
std::string ipstr;
int status,num;

// First, we'll ask for the necessary information

std::cout << "Enter local portbase:" << std::endl;
std::cin >> portbase;
std::cout << std::endl;

std::cout << std::endl;
std::cout << "Number of seconds you wish to wait:" << std::endl;
std::cin >> num;

// Now, we'll create a RTP session, set the destination
// 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 just use 8000 samples per second.
sessparams.SetOwnTimestampUnit(1.0/8000.0);

transparams.SetPortbase(portbase);
status = sess.Create(sessparams,&transparams);
checkerror(status);

// Wait a number of seconds
RTPTime::Wait(RTPTime(num,0));

sess.BYEDestroy(RTPTime(10,0),0,0);

#ifdef WIN32
WSACleanup();
#endif // WIN32
return 0;
}

#else

int main(void)
{
std::cerr << "Thread support is required for this example" << std::endl;
return 0;
}

#endif // RTP_SUPPORT_THREAD
w_zhen_x 2009-03-03
  • 打赏
  • 举报
回复
没有人知道吗
Joan201401 2009-03-03
  • 打赏
  • 举报
回复
up
vagrantisme 2009-03-03
  • 打赏
  • 举报
回复
学习中... ...
csjtxy 2009-03-02
  • 打赏
  • 举报
回复
先顶一个。

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧