好像是需要设置的吧.是通过带宽设置来计算的.
- void SetSessionBandwidth(double bw)
Sets the bandwidth the session is supposed to use. The parameter
is treated in units of bits per second (bps). This value is used to
calculate the interval at which RTCP packets should be sent. The
default value is 64000 bps.
你知道他的rtcp发送的都是一些什么数据阿?提高了丢包的情况么?协议好像有.可是看他的sdk需要一些函数...他会自己发送么?
我比较关系rtcp发送的数据,你能够详细说明一下么?
int main(void)
{
RTPSession sess;
int portbase;
unsigned long destip;
int destport;
char ipstr[256];
int status,i;
char dummybuffer[1024];
int sock1,sock2;
struct timeval rttprev = {0,0},rtt,tv; //时间结构体
fd_set fdset;
/*
First, we‘ll ask for the necessary information
*/
printf("Enter the local portbase\n");
scanf("%d",&portbase);
printf("\n");
printf("Enter the destination IP address\n");
scanf("%s",ipstr);
destip = inet_addr(ipstr);
if (destip == INADDR_NONE)
{
printf("Bad IP address specified\n");
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);
printf("Enter the destination port\n");
scanf("%d",&destport);
/*
Now, we‘ll create a RTP session, set the destination, send some
packets and poll for incoming data.
*/
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD( 1, 1);
err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 ) {
/* Tell the user that we could not find a usable */
/* WinSock DLL. */
printf("winsock dll init error !\n");
return 0;
}
status = sess.Create(portbase);
checkerror(status);
status = sess.AddDestination(destip,destport);
checkerror(status);
unsigned long lssrc = 0;
sess.GetLocalSSRC(&lssrc);
unsigned long ul;
int j=0;
//bool bo =false;
for (i = 1 ; i <= 1000; i++)
sess.SendPacket("1232547680",10,0,0,(unsigned long)1);
// send the packet
// Sleep(1);
// poll for incoming data
status = sess.PollData();
checkerror(status);
// check incoming packets
if(sess.GotoFirstSource())
{
do
{
RTPSourceData *rtpsource;
if ((rtpsource = sess.GetCurrentSourceInfo()) != NULL)
{
int main(void)
{
RTPSession sess;
int portbase;
unsigned long destip;
int destport;
char ipstr[256];
int status,i;
char dummybuffer[1024];
int sock1,sock2;
struct timeval rttprev = {0,0},rtt,tv; //时间结构体
fd_set fdset;
/*
First, we‘ll ask for the necessary information
*/
printf("Enter the local portbase\n");
scanf("%d",&portbase);
printf("\n");
printf("Enter the destination IP address\n");
scanf("%s",ipstr);
destip = inet_addr(ipstr);
if (destip == INADDR_NONE)
{
printf("Bad IP address specified\n");
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);
printf("Enter the destination port\n");
scanf("%d",&destport);
/*
Now, we‘ll create a RTP session, set the destination, send some
packets and poll for incoming data.
*/
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD( 1, 1);
err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 )
{
/* Tell the user that we could not find a usable */
/* WinSock DLL. */
printf("winsock dll init error !\n");
return 0;
}
status = sess.Create(portbase);
checkerror(status);
//得到会话的RTP的SOCKET (SOCK1)
sess.GetRTPSocket((unsigned int *)&sock1);
//得到会话的RTCP的SOCKET (SOCK2)
sess.GetRTCPSocket((unsigned int *)&sock2);
unsigned long assrc = 0;
sess.GetLocalSSRC(&assrc);
status = sess.AddDestination(destip,destport);
checkerror(status);
bool bRecv = true;
int j=0;
while(bRecv)
//等待1秒
// poll for incoming data
status = sess.PollData();
// check incoming packets
if (sess.GotoFirstSource())
{
do
{