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

📄 rtpnewstream.c

📁 linux环境下用纯c写的RTP协议的通用开发库
💻 C
字号:
/*------------------------------------------------------------------------- * rtpnewstream.c - rtpnrestream *------------------------------------------------------------------------- */#include <limits.h>#include <rtp.h>#include <pthread.h>#include <stdlib.h>#include <strings.h>#include <hash.h>/*------------------------------------------------------------------------ * rtpnewstream - create state for newly detected stream * The refcount is initialized to 1. Thus the caller must release the * stream when finished with it. *------------------------------------------------------------------------ */struct stream *rtpnewstream(struct session *psn, unsigned int ssrc){	struct stream		*pstm;	pstm = (struct stream *) malloc(sizeof(struct stream));	if (pstm == NULL)		return NULL;	memset(pstm, 0, sizeof(struct stream));	rtpqinit(&pstm->stm_queue);	pthread_mutex_init(&pstm->stm_mutex, NULL);	pstm->stm_ssrc = ssrc;	pstm->stm_ip.sin_addr.s_addr = INADDR_ANY;	pstm->stm_payload = RTP_PAYLOADUNINITIALIZED;	pstm->stm_inactthresh = RTP_DEFAULT_INACTIVETHRESH;	pstm->stm_probation = RTP_MINSEQUENTIAL;	pstm->stm_refcnt = 1;	htadd(psn->sn_ssrcs, ssrc, pstm);	rtpcheckcollision(psn, ssrc);	rtppostevent(psn, EVENT_PARTICIPANT_NEW, ssrc, NULL, 0);  	return pstm;}

⌨️ 快捷键说明

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