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

📄 hust_rtcprr.c

📁 实现基于ip2022的MPEG2 TS的IP组播接收
💻 C
字号:
/*------------------------------------------------------------------------- * rtcprr.c - rtcprr *------------------------------------------------------------------------- */#include <ipOS.h>#include <ipHAL.h>#include <ipStack.h>#include <ipEthernet.h>#include "hust_rtp.h"#include "hust_rtplibcommon.h"#include "hust_rtcp.h"#include "hust_event.h"#include "hust_hash.h"#include "hust_linux.h"///#include <rtp.h>///#include <rtcp.h>///#include <hash.h>/*------------------------------------------------------------------------ * rtcprr - process an incoming RTCP receiver report *------------------------------------------------------------------------ */intrtcprr(struct session *psn, struct rtcp *prtcp, struct netbuf *udpnb){  	struct rr	*prr;	struct stream	*pstm;	addr_t		rrdatalen;	if (prtcp->rtcp_type != RTCP_RR) 		return -1; 	 	prr = (struct rr *) heap_alloc(sizeof(struct rr)); 	prtcp->rtcp_data = prr;	memset(prr, 0, sizeof(struct rr));		prr->rr_ssrc = netbuf_fwd_read_u32(udpnb);		rrdatalen = RTCP_LENGTH_BYTE(prtcp)-RTCP_HEADERSZ-RTCP_RRSZ;	if(rrdatalen)	{		prr->rr_rb = heap_alloc(rrdatalen);		netbuf_fwd_read_mem(udpnb,prr->rr_rb,rrdatalen);	}	else		prr->rr_rb = NULL;	pstm = rtpgetstream(psn, prr->rr_ssrc);	if (pstm == NULL)		if ((pstm = rtpnewstream(psn, prr->rr_ssrc)) == NULL)			return ERROR;	if (!RTP_INACTIVE(pstm->stm_inactive))		pstm->stm_inactive = 0;	else {		rtpreleasestream(psn, pstm);		return OK;	}	rtpreleasestream(psn, pstm);	/*	 * Post event with the receiver report as data.	 */	rtppostevent(psn, EVENT_RTCP_RR, prr->rr_ssrc,		     (char *) prtcp, RTCP_LENGTH_BYTE(prtcp));	heap_free(prr);	return OK;}

⌨️ 快捷键说明

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