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

📄 hust_rtcpbye.c

📁 实现基于ip2022的MPEG2 TS的IP组播接收
💻 C
字号:
/*------------------------------------------------------------------------- * rtcpbye.c - rtcpbye *------------------------------------------------------------------------- */#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 <hash.h>///#include <rtcp.h>///#include <rtp.h>///#include <unistd.h>///#include <stdlib.h>///#include <strings.h>/*------------------------------------------------------------------------ * rtcpbye - process an incoming RTCP bye message *------------------------------------------------------------------------ */intrtcpbye(struct session *psn, struct rtcp *prtcp, struct netbuf *udpnb){	struct stream		*pstm;	ssrc_t		        ssrc;	u8_t			i, eventdatalen;///	char			eventdata[sizeof(ssrc_t) + 256];///	struct byereason	*preason;	if (prtcp->rtcp_type != RTCP_BYE) 		return ERROR;  	/*	 * Look for a reason string.	 */		/*	if (prtcp->rtcp_length > prtcp->rtcp_count) {		preason = (struct byereason *) (prtcp->rtcp_data + prtcp->rtcp_count * sizeof(ssrc_t));		eventdatalen = preason->bye_length + 1;		memcpy(eventdata, preason->bye_reason, preason->bye_length);		eventdata[preason->bye_length] = '\0';	} else		eventdatalen = 0;	*/	/*	 * Iterate through list of synchronization 	 * source identifiers in the bye message.	 */	for (i = 0; i < prtcp->rtcp_count; i++) {		ssrc = netbuf_fwd_read_u32(udpnb);		pstm = rtpgetstream(psn, ssrc);		if (pstm != NULL) {			if (!RTP_INACTIVE(pstm->stm_inactive)) {								/*				 * Mark the stream as inactive,				 * cleanup if necessary, and post				 * event informing of the stream's				 * exit containing the reason string				 * as data.				 */				pstm->stm_inactive = RTP_BYERECEIVED;				rtpstreamcleanup(psn, pstm);	///			rtppostevent(psn, EVENT_RTCP_BYE, ssrc, eventdata, eventdatalen);			}			rtpreleasestream(psn, pstm);		}	}	return OK;}

⌨️ 快捷键说明

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