📄 hust_rtpclose.c
字号:
/*------------------------------------------------------------------------- * rtpclose.c - rtpclose *------------------------------------------------------------------------- */#include "hust_rtp.h"#include "hust_rtcp.h"#include "hust_event.h"#include "hust_hash.h"///#include <unistd.h>///#include <stdlib.h>///#include <hash.h>///#include <stdio.h>///#include <arpa/inet.h>/*------------------------------------------------------------------------ * rtpclose - close the rtp session pointed to by psn *------------------------------------------------------------------------ */intrtpclose(struct session *psn){ bool false = FALSE; /* * Stop threads cleanly. */ ///rtpctl(psn, RTP_CTL_RTCPRECVTHREAD, (char *) &false, 0, 0); ///rtpctl(psn, RTP_CTL_RTPRECVTHREAD, (char *) &false, 0, 0); ///rtpctl(psn, RTP_CTL_RTCPCYCLETHREAD, (char *) &false, 0, 0); /* * Send RTCP bye message to group. */ rtcpsendbye(psn, "Leaving"); /* * Release all resources. */ ///close(psn->sn_rtpfd); ///close(psn->sn_rtcpfd); htdestroy(psn->sn_cnames); htdestroy(psn->sn_ssrcs); ///bufpooldestroy(&psn->sn_bpool); heap_free(psn->sn_cyclesources); heap_free(psn->sn_cyclebuf); /* assume no mutexes held at this point */ /*pthread_cond_destroy(&psn->sn_cond); pthread_mutex_destroy(&psn->sn_mutex); pthread_mutex_destroy(&psn->sn_rtpthrmutex); pthread_mutex_destroy(&psn->sn_rtcpthrmutex); pthread_mutex_destroy(&psn->sn_rtcpcyclethrmutex); pthread_mutex_destroy(&psn->sn_getstreammutex); pthread_mutex_destroy(&psn->sn_cnamemutex);*/ heap_free(psn); /////要重新实现free return OK;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -