⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtpappsession.cpp

📁 利用RTP协议实现的客户端例程
💻 CPP
字号:

#pragma comment(lib, "jrtplib.lib")

#pragma comment(lib, "jthread.lib")

#pragma comment(lib, "WS2_32.lib")
#include "stdafx.h"
#include "rtpsession.h"
#include "rtpappsession.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 <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>

/*------------------------------------------*/
/* OnRTPPacket
/*------------------------------------------*/
void RTPAppSession::OnRTPPacket(RTPPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
{
 //   printf("%d bytes of data received\n", pack->GetPayloadLength());
//	BYTE *pfBuffer;
//	BYTE *pBuffer;
//	int length = pack->GetPayloadLength();
//	printf("%d bytes of data received\n", pack->GetPayloadLength());
//	pfBuffer = (unsigned char*)pack->GetPayloadData();
//	pBuffer = new BYTE[length+1];
//	memcpy(pBuffer,pfBuffer,length);
//	pBuffer[length] = 0;
//	printf("%s",pBuffer);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -