上大学时做的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
相关文档:
一:前言
最近在研究android的sensor driver,主要是E-compass,其中用到了Linux input子系统.在网上也看了很多这方面的资料,感觉还是这篇分析的比较细致透彻,因此转载一下以便自己学习,同时和大家分享!
(这篇博客主要是以键盘驱动为例的,不过讲解的是Linux Input Subsystem,可以仔细的研究一下!)
键盘驱动将检 ......
linux库文件编写入门
一、为什么要使用库文件
我们在实际编程工作中肯定会遇到这种情况:有几个项目里有一些函数模块的功能相同,
实现代码也相同,也是我们所说的重复代码。比如,很多项目里都有一个用户验证的功能。
代码段如下:
//UserLogin.h文件,提供函数声明
int IsValidUser(char ......
Linux initial RAM disk (initrd) overview
Learn about its anatomy, creation, and use in the Linux boot process
M. Tim Jones
(mtj@mtjones.com
), Consultant Engineer, Emulex
M. Tim Jones is an embedded software architect and the author of GNU/Linux Application Programming
, AI Application Prog ......
创建时间:2003-08-22
文章提交:raodan (raod_at_30san.com)
==Phrack Inc.==
卷标 0x0b, 期刊号 0x3d, Phile #0x0d of 0x0f
|=---------------------=[ 深入Linux网络核心堆栈 ]=-----------------------= ......
信号灯与其他进程间通信方式不大相同,它主要提供对进程间共享资源访问控制机制。相当于内存中的标志,进程可以根据它判定是否能够访问某些共享资源,同时,进程也可以修改该标志。除了用于访问控制外,还可用于进程同步。
一、信号灯概述
信号灯与其他进程间通信方式不大相同,它主要提供对进程间共享资源访问控制机制 ......