?? hust_rtcpapp.c
字號:
/*------------------------------------------------------------------------- * rtcpapp.c - rtcpapp *------------------------------------------------------------------------- */#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>/*------------------------------------------------------------------------ * rtcpapp - process an incoming RTCP application specific packet *------------------------------------------------------------------------ */intrtcpapp(struct session *psn, struct rtcp *prtcp, struct netbuf *udpnb){ struct app *papp; struct stream *pstm; u8_t i; addr_t appdatalen; if (prtcp->rtcp_type != RTCP_APP) return ERROR; papp = (struct app *)heap_alloc(sizeof(struct app)); prtcp->rtcp_data = papp; memset(papp, 0, sizeof(struct app)); papp->app_ssrc = netbuf_fwd_read_u32(udpnb); for(i=0;i<4;i++) { papp->app_name[i] = netbuf_fwd_read_u8(udpnb); } appdatalen = RTCP_LENGTH_BYTE(prtcp)-RTCP_HEADERSZ-APPSZ; papp->app_data = heap_alloc(appdatalen); netbuf_fwd_read_mem(udpnb, papp->app_data, appdatalen); pstm = rtpgetstream(psn, papp->app_ssrc); if (pstm == NULL) if ((pstm = rtpnewstream(psn, papp->app_ssrc)) == NULL) return ERROR; if (!RTP_INACTIVE(pstm->stm_inactive)) pstm->stm_inactive = 0; else { rtpreleasestream(psn, pstm); return OK; } rtpreleasestream(psn, pstm); /* * Post an event containing the * application-specific data. */ rtppostevent(psn, EVENT_RTCP_APP, papp->app_ssrc, (char *) prtcp, RTCP_LENGTH_BYTE(prtcp)); return OK;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -