易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux摄像头编程小结

转自:http://blog.chinaunix.net/u/7547/showart_122619.html
1.open device:
      video_dev = open("\dev\video0",O_RDWR));
2.get the information of the video device
    struct video_capability video_cap;
    memset(&video_cap,0,sizeof(video_cap));
    if(ioctl(video_dev,VIDIOCGCAP,&video_cap) == -1)
    {
        perror("Cann't get the information of the video device");
        close(video_dev);
        exit(1);
    }
3.get the information of the channels
    struct video_channel video_chan;
    memset(&video_chan,0,sizeof(video_chan));
    for(channel = 0;channel < video_cap.channels;channel++)
    {
        video_chan.channel = channel;
        if(ioctl(video_dev,VIDIOCGCHAN,&video_chan) == -1)
        {
            perror("Cann't get the information of the channels");
            close(video_dev);
            exit(3);
        }
        if(video_chan.type == VIDEO_TYPE_TV)
        {
                  #ifdef DEBUG
            printf("NO.%d channel is %s,type is tv!\n",channel,video_chan.name);
                  #endif
        }
        if(video_chan.type == VIDEO_TYPE_CAMERA)
   


相关文档:

linux ip dns getway的配置

转帖自:http://bbs.61job.cn/space/viewspacepost.aspx?postid=4489
在Linux中不管你是做服务器还是只是平常使用,上网肯定都是最重要和不可缺少的一个因素之一,
所以就涉及到它的ip gateway dns等network配置和使用。但是设置linux网络的方法有两种:
第一种:使用命令修改(直接即时生效,重启失效)
  &n ......

linux 初学命令

1.系统信息显示命令 # uname -a               # 查看内核/操作系统/CPU信息
# head -n 1 /etc/issue   # 查看操作系统版本
# cat /proc/cpuinfo      # 查看CPU信息
# hostname   ......

linux 系统安装和软件推荐

1、安装基本系统
这里安装使用的是Ubuntu 7.04 的 Alternate CD。使用 Alternate CD 引导启动,然后选择 “安装命令行系统(Install Command Line)” 进行最小化安装,在这一步,要注意,一定不要选择中文语言环境,否则在终端窗口下的各种提示,有很多都是中文的。在没有装载完成X Window之前,你只能看到一堆 ......

Linux线程pthread笔记


在阅读Nginx的代码.先碰到的是线程部分的
因为从main开始最早是做线程部分的工作
实习一下pthread方面的内容
#include "pthread.h"
#include "stdio.h"
void* thread_test(void* ptr)
{
        while(1)
        printf("i am child pthread\n");
}
int ma ......

Linux下串口信息的读取

1. 打开串口
  与其他的关于设备编程的方法一样,在Linux下,操作、控制串口也是通过操作起设备文件进行的。在Linux下,串口的设备文件是/dev/ttyS0或/dev/ttyS1等。因此要读写串口,我们首先要打开串口:
 
  char *dev = "/dev/ttyS0"; //串口1
 
  int fd = open( dev, O_RDWR );
 
  //| O_NOCT ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号