一段基于linux V4L视频采集摄像程序的源码
/*****************************************************************************************************
linux_m4v.c
gcc -o linux_m4v linux_m4v.c -lc -lm -lxvidcore
*******************************************************************************************************/
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <linux/videodev.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <signal.h>
#include "xvid_encode.h"
void *enc_handle = NULL;
int done = 0;
int
enc_main(unsigned char *image,
unsigned char *bitstream,
int *key,
int *stats_type,
int *stats_quant,
int *stats_length,
int sse[3]);
int
enc_stop();
int
enc_init(int use_assembler);
double
msecond();
#define VIDEO_PALETTE_JPEG 21
struct vdIn {
int fd;
char *videodevice ;
struct video_capability videocap;
struct video_picture videopict;
struct video_window videowin;
int framesizeIn ;
int bppIn;
int hdrwidth;
int hdrheight;
int formatIn;
};
struct vdIn videoIn;
int init_videoIn (struct vdIn *vd, char *device, int width, int height,int format);
static int GetDepth (int format);
static int GetVideoPict (struct vdIn *vd);
static int SetVideoPict (struct vdIn *vd);
int main(int argc,char *argv[])
{
char *device;
int format = VIDEO_PALETTE_YUV420P;
int width = 352;
int height = 288;
int i;
unsigned char r_buffer[304128];
unsigned char* mp4_buffer;
double enctime;
double totalenctime = 0.;
float totalPSNR[3] = {0., 0., 0.};
device = "/dev/video0";
ARG_OUTPUTFILE = "test.m4v";
int
相关文档:
最近用友善之臂的板子,发现内核的名称是:Linux-2.6.29.4-FriendlyARM.后面那个FriendlyARM死活去不掉。后来只好看代码。
1、2.6.29.4这个版本号是是uboot在做uimage的时候加上的,看arch/arm/boot/Makefile:
quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMA ......
一、 前言
LVM是逻辑卷管理(Logical Volume Manager)的简称,他是建立在物理存储设备之上的一个抽象层,允许你生成逻辑存储卷,和直接使用物理存储在管理上相比,提供了更好灵活性。
LVM将存储虚拟化,使用逻辑卷,你不会受限于物理磁盘的大小,另外,和硬件相关的存储设置被其隐藏,你能不用停止应用或卸载文件系统来调整卷大 ......
网络设备驱动相比字符型设备的驱动要复杂一些,除了总体上驱动的框架有一些相似外,有很多地方都是不同,但网络设备驱动有一个很大的特点就是有固定的框架可以遵循,具体的框架会在后边详细的叙述,这里主要分析网络设备驱动的结构,和整个tcp/ip网络结构一样,整个网络设备驱动也是一个分层的结构。具体如下:
1 ......
本文简单介绍了当前Windows支持的各种Socket I/O模型,如果你发现其中存在什么错误请务必赐教。
一:select模型
二:WSAAsyncSelect模型
三:WSAEventSelect模型
四:Overlapped I/O 事件通知模型
五:Overlapped I/O 完成例程模型
六:IOCP模型
老陈有一个在外地工作的女儿,不能经常回来,老陈和她通过信件 ......
LR监控windows、linux、UNIX、IBM AIX系统方法
一、监控windows系统:
1、监视连接前的准备工作
1)进入被监视windows系统,开启以下二个服务Remote Procedure Call(RPC) 和Remote Registry Service (开始—)运行 中输入services.msc,开启对应服务即可)。
&nbs ......