?? hust_rtcprecv.c
字號:
/*------------------------------------------------------------------------- * rtcprecv.c - rtcprecv, processrtcp *------------------------------------------------------------------------- */#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 <stdlib.h>///#include <sys/types.h>///#include <sys/socket.h>///#include <unistd.h>/*------------------------------------------------------------------------ * rtcprecv - receive and process a (compound) RTCP packet *------------------------------------------------------------------------ *//*intrtcprecv(struct session *psn){ struct rtcp *prtcp, *prtcp2; u32_t from; int fromlen, len; char rtcpbuf[RTCP_MAXPACKETSZ]; prtcp = (struct rtcp *) rtcpbuf; fromlen = sizeof(from); len = recvfrom(psn->sn_rtcpfd, (char *) prtcp, RTCP_MAXPACKETSZ, 0, (struct sockaddr *) &from, &fromlen); if (len < 0) return ERROR; */ /* * Extract source address as RTCP destination for unicast session * if not already learned. */ /*if (psn->sn_rtcpto == INADDR_ANY) psn->sn_rtcpto = from;*/ /* * Iterate over the compound packet. stop if we discover packet * is truncated due to the use of fixed-sized buffers. */ /* prtcp2 = prtcp; while(len > RTCP_HEADERSZ) { ///prtcp2->rtcp_length = ntohs(prtcp2->rtcp_length); if (len < RTCP_LENGTH_BYTE(prtcp2)) break; rtcpprocess(psn, prtcp2); len -= RTCP_LENGTH_BYTE(prtcp2); prtcp2 = (struct rtcp *) ((char *) prtcp2 + RTCP_LENGTH_BYTE(prtcp2)); } return OK;}*//*------------------------------------------------------------------------ * processrtcp - process a single RTCP packet by dispatching the * the appropriate function. *------------------------------------------------------------------------ */intrtcpprocess(struct session *psn, struct rtcp *prtcp, struct netbuf *udpnb){ if (prtcp->rtcp_ver != RTP_CURRVERS) return ERROR; switch (prtcp->rtcp_type) { case RTCP_SR: return rtcpsr(psn, prtcp, udpnb); case RTCP_RR: return rtcprr(psn, prtcp, udpnb); case RTCP_SDES: return rtcpsdes(psn, prtcp, udpnb); case RTCP_BYE: return rtcpbye(psn, prtcp, udpnb); case RTCP_APP: return rtcpapp(psn, prtcp, udpnb); default: return ERROR; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -