?? v4l_linqijun.h
字號:
/******************************林啟俊_V4L_采集**************************************************** ****作者: 林啟俊 * ****日期: 2006-11-30 * **** * **** * ALL RIGHTS Reserved **** ***版本: 1.0 * ****環境: Linux * **** ****目的: 為3G手機的現場直播而準備 ***申明: 一切解釋權本人作解釋;不得修改(除非經本人同意),不得發表!****** e_mail: linqijun211@163.com**********************************************************************************************人生格言: 為人生理想而戰斗,不怕辛苦!! 為報答父母而奮斗,不怕勞累!! ******************************************************************************************************************說明: 此程序盡力讓V4L簡單而寫,采用調用函數來實現;希望對學習V4L的朋友有所幫助 ************ 我的攝像頭只支持兩貞采集,我的想法是,每采集一貞就保存了一個圖像;所以我設了兩個圖像文件 ************* /home/linzi.jpeg和/home/linzicheng.jpeg;用的時候可以隨便保存到任何地方的 ************************* Please email to me if you have some problems or advices to me to modify! than you !! ***********/ #ifndef _V4L_linqijun_#define _V4L_linqijun_ #include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <stdio.h> #include <unistd.h> #include <error.h> #include <assert.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/mman.h> #include <linux/videodev.h>#define NTSC_WIDTH 320 #define NTSC_HEIGHT 240#define DEFAULT "/dev/video1"#define DEFAULT1 "/dev/video0" char* map; int fd; struct video_capability capability; struct video_picture picture; struct video_window window; struct video_mbuf mbuf; struct video_mmap mmap1; typedef struct video_capability cap; typedef struct video_picture pic; typedef struct video_window win; typedef struct video_mbuf mb; typedef struct video_mmap mm; /* ***不能設置成 mmap,所以把他改成mm****/ int lin_open(char *);int lin_get_capability(int fd, struct video_capability *);int lin_get_picture( int fd, struct video_picture *);int lin_set_picture(int fd , struct video_picture * );int lin_set_window(int fd, struct video_window *);int lin_get_mbuf(int fd, struct video_mbuf *);int lin_set_mmap( struct video_mmap * );int lin_memory_map(int fd,int );int lin_map(int , int );int lin_start_capture(int , struct video_mmap *);char * lin_get_mapaddress( int );#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -