资源简介
在linux下的实时语音聊天程序,使用了adpcm编码,同时还使用了RTP实时传输协议,是一个很好的学习实时传输协议的程序。- chats the procedure under the linux real-time pronunciation, has used the adpcm code, meanwhile has used the RTP real-time transmission agreement, is a very good study real-time transmission agreement procedure.
src
...\comm.c
...\comm.h
...\e-comm
...\e-comm.c
...\e-comm.h
...\global.h
...\lib
...\...\adpcm.c
...\...\adpcm.h
...\...\alloc.c
...\...\alloc.h
...\...\config.h
...\...\Makefile.am
...\...\Makefile.in
...\...\md5.c
...\...\md5.h
...\...\mwc1616.c
...\...\mwc1616.h
...\...\ohtbl.c
...\...\ohtbl.h
...\...\phtbl.c
...\...\phtbl.h
...\...\rand32.c
...\...\rand32.h
...\...\rtp.c
...\...\rtp.h
...\...\seterror.c
...\...\seterror.h
...\...\vstr.c
...\...\vstr.h
...\Makefile.am
...\Makefile.in
...\sound.c
...\sound.h

代码片段和文件信息
/* comm.h - Communication input/output modules
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be
* useful but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more
* details (available in COPYING).
*/
#include
#include
extern rtp_t rtp;
extern int open_soundcard (int oflag);
void *mod_cin (void *ptr)
{
int rtpfd; /* RTP socket file descriptor */
int rtcpfd; /* RTCP socket file descriptor */
int addr_len; /* Data size Bytes received */
struct sockaddr_in rtps; /* RTP socket */
struct sockaddr_in rtcps; /* RTCP socket */
struct sockaddr_in remote; /* Remote address information */
vstr_t recv_data; /* Received data */
rtp_packet_t *packet; /* Parsed RTP packet */
fd_set readset;
int fdmax;
fprintf(stderr “+ Communication input module loaded.\n“);
vstr_init (&recv_data RTP_MTU_SIZE);
if ((rtpfd = socket(AF_INET SOCK_DGRAM 0)) < 0) {
perror(“Error opening socket“);
exit(1);
}
if ((rtcpfd = socket(AF_INET SOCK_DGRAM 0)) < 0) {
perror(“Error opening socket“);
exit(1);
}
rtps.sin_family = AF_INET; /* Internet protocol */
rtps.sin_port = htons(RTP_PORT); /* Port */
rtps.sin_addr.s_addr = htonl(INADDR_ANY); /* rtps address */
memset(&(rtps.sin_zero) ‘\0‘ 8); /* Zero the rest */
if (bind(rtpfd (struct sockaddr *) &rtps sizeof(struct sockaddr)) < 0) {
perror(“Error binding socket“);
exit(1);
}
rtcps.sin_family = AF_INET; /* Internet protocol */
rtcps.sin_port = htons(RTCP_PORT); /* Port */
rtcps.sin_addr.s_addr = htonl(INADDR_ANY); /* rtcps address */
memset(&(rtcps.sin_zero) ‘\0‘ 8); /* Zero the rest */
if (bind(rtcpfd (struct sockaddr *) &rtcps sizeof(struct sockaddr)) < 0) {
perror(“Error binding socket“);
exit(1);
}
fprintf(stderr “+ RTP Listening at %s:%d...\n“
inet_ntoa(rtps.sin_addr) ntohs(rtps.sin_port));
fprintf(stderr “+ RTCP Listening at %s:%d...\n“
inet_ntoa(rtcps.sin_addr) ntohs(rtcps.sin_port));
addr_len = sizeof(struct sockaddr);
while(1)
{
FD_ZERO (&readset);
FD_SET (rtpfd &readset);
FD_SET (rtcpfd &readset);
fdmax = (rtpfd < rtcpfd) ? rtcpfd : rtpfd;
select (fdmax + 1 &readset NULL NULL NULL);
if (FD_ISSET(rtpfd &readset)) {
/* Receive data from network */
recv_data.size = recvfrom (rtpfd recv_data.data RTP_MTU_SIZE 0 &remote &addr_len);
vstr_adv_tail (&recv_data
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17956 2001-11-20 16:47 e-comm-0.71\aclocal.m4
文件 404 2001-07-05 18:07 e-comm-0.71\AUTHORS
文件 91 2001-07-05 18:07 e-comm-0.71\ChangeLog
文件 2473 2012-04-11 21:30 e-comm-0.71\config.cache
文件 31247 2001-07-05 18:07 e-comm-0.71\config.guess
文件 1115 2012-04-11 20:47 e-comm-0.71\config.h
文件 966 2001-07-05 18:16 e-comm-0.71\config.h.in
文件 2893 2012-04-11 21:30 e-comm-0.71\config.log
文件 10338 2012-04-11 21:30 e-comm-0.71\config.status
文件 24171 2001-07-05 18:07 e-comm-0.71\config.sub
文件 73728 2001-11-20 16:47 e-comm-0.71\configure
文件 676 2001-11-20 16:46 e-comm-0.71\configure.in
文件 17992 2001-07-05 18:07 e-comm-0.71\COPYING
文件 7831 2001-07-05 18:07 e-comm-0.71\INSTALL
文件 5598 2001-07-05 18:07 e-comm-0.71\install-sh
文件 142160 2012-04-11 21:30 e-comm-0.71\libtool
文件 99553 2001-07-05 18:07 e-comm-0.71\ltconfig
文件 138294 2001-07-05 18:07 e-comm-0.71\ltmain.sh
文件 11007 2012-04-11 21:34 e-comm-0.71\Makefile
文件 14 2001-07-05 18:07 e-comm-0.71\Makefile.am
文件 10852 2001-11-20 16:47 e-comm-0.71\Makefile.in
文件 6283 2001-07-05 18:07 e-comm-0.71\missing
文件 722 2001-07-05 18:07 e-comm-0.71\mkinstalldirs
文件 54 2001-07-05 18:07 e-comm-0.71\NEWS
文件 325 2001-07-05 18:07 e-comm-0.71\README
文件 6313 2001-10-20 23:42 e-comm-0.71\src\comm.c
文件 900 2001-10-20 22:00 e-comm-0.71\src\comm.h
文件 4264 2012-04-11 21:34 e-comm-0.71\src\comm.o
文件 29172 2012-04-11 21:34 e-comm-0.71\src\e-comm
文件 2712 2001-10-20 20:55 e-comm-0.71\src\e-comm.c
............此处省略57个文件信息
相关资源
- uboot到linux logo显示不间断 补丁
- UNIX/LINUX编程实践教程的源码
- Linux任务管理器
- linux应用层的华容道游戏源代码
- ubuntu9.10 可加载内核模块和字符设备驱
- MP3文件ID3v2ID3v2APEv2标签读取
- 操作系统实验——虚存管理实验
- linux下的发包工具sendip
- 尚观培训linux许巍关于c 的笔记和讲义
- 尚观培训linux董亮老师关于数据结构的
- linux 线程池源码 c 版
- linux C 电梯程序练习
- linux下用多进程同步方法解决生产者
- Linux 操作系统实验(全)
- Linux From Scratch 中文手册
- linux 网络实验 ftp程序
- Linux命令大全离线版&在线版
- 操作系统共享内存实验
- dos 下运行Linux 命令--gnu_utils
- linux 0.12内核源代码
- linux简易shell C实现
- linux实验报告及心得体会
- 基于GTK的Linux环境下的简易任务管理器
- linux扫雷游戏代码
- CAN Linux驱动代码
- Linux系统教材
- intel 82579LM 网卡驱动Linux系统版 v1.9.
- SA1110处理器掌上电脑液晶显示器设计
- 基于Linux的串口服务器设计
- Windows下访问LINUX的利器-SSH
评论
共有 条评论