上大学时做的linux上视频传输的程序
源文来自http://blog.csdn.net/dog0138/archive/2007/03/23/1539277.aspx
C/S 架构 程序很大以部分修改自SPCAVIEW 加入了XVID编解码和JRTP传输 需要安装相应的库 另外摄像头用的中星微电子的 所以 驱动最好装那个万能驱动 在一个国外网站上下的 忘记是什么了 好像叫SPCAXX
只要你装对了东西 这程序保证能用:-}
文件server.cpp中的程序代码
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
#include <wait.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <linux/videodev.h>
#include <pthread.h>
#include "jrtplib3/rtpsession.h"
#include "jrtplib3/rtppacket.h"
#include "jrtplib3/rtpudpv4transmitter.h"
#include "jrtplib3/rtpipv4address.h"
#include "jrtplib3/rtpsessionparams.h"
#include "jrtplib3/rtperrors.h"
#include <iostream>
#include "cxvid.h"
#include "tcp.h"
#define OUTFRMNUMB 4
static int XDIM=320,YDIM=240;
uint8_t localip[] = { 202, 194, 26, 67 };
#define Packetfixlength 7000
#define frameheadfixlength 50
RTPTime delay (0.0001);
int status;
int nread;
RTPSession session;
RTPSessionParams sessionparams;
RTPUDPv4TransmissionParams transparams;
int sendpacket (unsigned char *framepointer, int framelength);
struct frame_t{
char header[5];
int nbframe;
double seqtimes;
int deltatimes;
int w;
int h;
int size;
int format;
unsigned short bright;
unsigned short contrast;
unsigned short colors;
unsigned short exposure;
unsigned char wakeup;
&n
相关文档:
1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI) 就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......
在Linux操作系统中,有一项特殊的功能——初始化内存盘INITRD(INITial Ram Disk)技术,而且内核支持压缩的文件系统映像。有了这两项功能,我们可以让Linux系统从小的初始化内存盘启动,并把系统内存的一部分作为根文件系统挂载。
Ramdisk就是将内存的一部分分配为一个分区并作为硬盘来使用。对于系统运行 ......
mail+uuencode
[root@room i386]# uuencode openvpn-2.0.5-1.i386.rpm openvpn-2.0.5-1.i386.rpm | mail -s youname@domain.com openvpn-2.0.5-1.i386.rpm
如果没有找到 uuencode 命令,则需要安装sharutils
[root@room i386]# yum install sharutils
未做测试,不知道是否可行,暂做保存 ......
Linux系统越来越受到电脑用户的欢迎,于是很多人开始学习Linux时,在很多时候,我们需要将在Linux桌面上的操作过程录制下来,比如制作屏幕
演示、视频教学等。这里将介绍在Linux桌面下值得使用的5个屏幕录像软件,包括Istanbul、Wink、Xvidcap、Vnc2swf、
Recordmydesktop,希望对有此需求的朋友提供参考。
Istanbul ......
1.时间表示
在程序当中,我们经常要输出系统当前的时间,比如我们使用date命令的输出结果.这个时候我们可以使用下面两个函数:
#include
time_t time(time_t *tloc);
char *ctime(const time_t *clock);
time函数返回从1970年1月1日0点以来的秒数.存储在time_t结构之中.不过这个函数的返回值对于我们 ......