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