rtcprr.c

来自「linux环境下用纯c写的RTP协议的通用开发库」· C语言 代码 · 共 48 行

C
48
字号
/*------------------------------------------------------------------------- * rtcprr.c - rtcprr *------------------------------------------------------------------------- */#include <rtp.h>#include <rtcp.h>#include <hash.h>/*------------------------------------------------------------------------ * rtcprr - process an incoming RTCP receiver report *------------------------------------------------------------------------ */intrtcprr(struct session *psn, struct rtcp *prtcp){  	struct rr	*prr;	struct stream	*pstm;	if (prtcp->rtcp_type != RTCP_RR) 		return -1; 	prr = (struct rr *) prtcp->rtcp_data;	prr->rr_ssrc = ntohl(prr->rr_ssrc);	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));	return OK;}

⌨️ 快捷键说明

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