?? hust_rtpnewstream.c
字號:
/*------------------------------------------------------------------------- * rtpnewstream.c - rtpnrestream *------------------------------------------------------------------------- */#include <ipHAL.h>///#include <limits.h>#include "hust_rtp.h"///#include <pthread.h>///#include <stdlib.h>///#include <strings.h>#include "hust_hash.h"#include "hust_event.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, u32_t ssrc )*/struct stream *rtpnewstream(){ struct stream *pstm; pstm = (struct stream *) heap_alloc(sizeof(struct stream)); ///為stream結構分配內存空間 if (pstm == NULL) return NULL; memset(pstm, 0, sizeof(struct stream)); //按照struct stream的格式設置內存 rtpqinit(&pstm->stm_queue); ///初始化stream中的queue ///pthread_mutex_init(&pstm->stm_mutex, NULL);/// pstm->stm_ssrc = ssrc; pstm->stm_ssrc = 0; pstm->stm_ip = INADDR_ANY; /////表示可以和任何主機通信 pstm->stm_enqueue=TRUE; pstm->stm_payload = MPEG2TYPE; pstm->stm_inactthresh = RTP_DEFAULT_INACTIVETHRESH; pstm->stm_probation = RTP_MINSEQUENTIAL; pstm->stm_refcnt = 1; ///pstm->stm_hiseq=hiseq-1; pstm->stm_cname=NULL; pstm->stm_name=NULL; pstm->stm_email=NULL; pstm->stm_phone=NULL; pstm->stm_loc=NULL; pstm->stm_tool=NULL; pstm->stm_note=NULL; pstm->stm_priv=NULL; /// htadd(psn->sn_ssrcs, ssrc, pstm); ///把隊列加入到哈希表中/// rtpcheckcollision(psn, ssrc); ///判斷接收到的stream的同步源標識符 ///是否和自己的沖突// rtppostevent(psn, EVENT_PARTICIPANT_NEW, ssrc, NULL, 0); ///發出事件,告知有新成員加入 return pstm;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -