?? hust_rtcprr.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 + -