易截截图软件、单文件、免安装、纯绿色、仅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 Bluetooth编程(三) HCI层编程

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 初学命令

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之前,你只能看到一堆 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号