上大学时做的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
相关文档:
Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......
Linux系统越来越受到电脑用户的欢迎,于是很多人开始学习Linux时,在很多时候,我们需要将在Linux桌面上的操作过程录制下来,比如制作屏幕
演示、视频教学等。这里将介绍在Linux桌面下值得使用的5个屏幕录像软件,包括Istanbul、Wink、Xvidcap、Vnc2swf、
Recordmydesktop,希望对有此需求的朋友提供参考。
Istanbul ......
Linux基本指令
alias
替指令取别名
◎ alias 列出目前系统所使用的所有指令别名
◎ alias 别名=Linux 指令名称 此时若输入「别名」则功能会跟输入「Linux 指令名称」相同
◎ 若想要每次开机都使用此别名,在 bash 中,一定要在 .bashrc 中指定,如果是 tcsh 中,则要在 .cshrc 中指定
ar
将许多档案备存成一个或多个 ......
本章介绍 POSIX 线程的基本线程编程例程。本章介绍缺省线程(即,具有缺省属性值的线程),这是多线程编程中最常用的线程。本章还介绍如何创建和使用具有非缺省属性的线程。
本章介绍的 POSIX 例程具有与最初的 Solaris 多线程库相似的编程接口。
线程库
下面简要论述了特定任务及其相关手册页。
创建缺省线程
如果未 ......