📄 zoran.h
字号:
/* * zoran - Iomega Buz driver * * Copyright (C) 1999 Rainer Johanni <Rainer@Johanni.de> * * based on * * zoran.0.0.3 Copyright (C) 1998 Dave Perks <dperks@ibm.net> * * and * * bttv - Bt848 frame grabber driver * Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) * & Marcus Metzler (mocm@thp.uni-koeln.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */#ifndef _BUZ_H_#define _BUZ_H_struct zoran_requestbuffers { unsigned long count; /* Number of buffers for MJPEG grabbing */ unsigned long size; /* Size PER BUFFER in bytes */};struct zoran_sync { unsigned long frame; /* number of buffer that has been free'd */ unsigned long length; /* number of code bytes in buffer (capture only) */ unsigned long seq; /* frame sequence number */ struct timeval timestamp; /* timestamp */};struct zoran_status { int input; /* Input channel, has to be set prior to BUZIOC_G_STATUS */ int signal; /* Returned: 1 if valid video signal detected */ int norm; /* Returned: VIDEO_MODE_PAL or VIDEO_MODE_NTSC */ int color; /* Returned: 1 if color signal detected */};struct zoran_params { /* The following parameters can only be queried */ int major_version; /* Major version number of driver */ int minor_version; /* Minor version number of driver */ /* Main control parameters */ int input; /* Input channel: 0 = Composite, 1 = S-VHS */ int norm; /* Norm: VIDEO_MODE_PAL or VIDEO_MODE_NTSC */ int decimation; /* decimation of captured video, * enlargement of video played back. * Valid values are 1, 2, 4 or 0. * 0 is a special value where the user * has full control over video scaling */ /* The following parameters only have to be set if decimation==0, * for other values of decimation they provide the data how the image is captured */ int HorDcm; /* Horizontal decimation: 1, 2 or 4 */ int VerDcm; /* Vertical decimation: 1 or 2 */ int TmpDcm; /* Temporal decimation: 1 or 2, * if TmpDcm==2 in capture every second frame is dropped, * in playback every frame is played twice */ int field_per_buff; /* Number of fields per buffer: 1 or 2 */ int img_x; /* start of image in x direction */ int img_y; /* start of image in y direction */ int img_width; /* image width BEFORE decimation, * must be a multiple of HorDcm*16 */ int img_height; /* image height BEFORE decimation, * must be a multiple of VerDcm*8 */ /* --- End of parameters for decimation==0 only --- */ /* JPEG control parameters */ int quality; /* Measure for quality of compressed images. * Scales linearly with the size of the compressed images. * Must be beetween 0 and 100, 100 is a compression * ratio of 1:4 */ int odd_even; /* Which field should come first ??? */ int APPn; /* Number of APP segment to be written, must be 0..15 */ int APP_len; /* Length of data in JPEG APPn segment */ char APP_data[60]; /* Data in the JPEG APPn segment. */ int COM_len; /* Length of data in JPEG COM segment */ char COM_data[60]; /* Data in JPEG COM segment */ unsigned long jpeg_markers; /* Which markers should go into the JPEG output. * Unless you exactly know what you do, leave them untouched. * Inluding less markers will make the resulting code * smaller, but there will be fewer aplications * which can read it. * The presence of the APP and COM marker is * influenced by APP0_len and COM_len ONLY! */#define JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */#define JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */#define JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */#define JPEG_MARKER_COM (1<<6) /* Comment segment */#define JPEG_MARKER_APP (1<<7) /* App segment, driver will allways use APP0 */ int VFIFO_FB; /* Flag for enabling Video Fifo Feedback. * If this flag is turned on and JPEG decompressing * is going to the screen, the decompress process * is stopped every time the Video Fifo is full. * This enables a smooth decompress to the screen * but the video output signal will get scrambled */ /* Misc */ char reserved[312]; /* Makes 512 bytes for this structure */};/*Private IOCTL to set up for displaying MJPEG*/#define BUZIOC_G_PARAMS _IOR ('v', BASE_VIDIOCPRIVATE+0, struct zoran_params)#define BUZIOC_S_PARAMS _IOWR('v', BASE_VIDIOCPRIVATE+1, struct zoran_params)#define BUZIOC_REQBUFS _IOWR('v', BASE_VIDIOCPRIVATE+2, struct zoran_requestbuffers)#define BUZIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOCPRIVATE+3, int)#define BUZIOC_QBUF_PLAY _IOW ('v', BASE_VIDIOCPRIVATE+4, int)#define BUZIOC_SYNC _IOR ('v', BASE_VIDIOCPRIVATE+5, struct zoran_sync)#define BUZIOC_G_STATUS _IOWR('v', BASE_VIDIOCPRIVATE+6, struct zoran_status)#ifdef __KERNEL__#define MAJOR_VERSION 0 /* driver major version */#define MINOR_VERSION 9 /* driver minor version */#define RELEASE_VERSION 5 /* release version */#define ZORAN_NAME "ZORAN" /* name of the device */#define ZR_DEVNAME(zr) ((zr)->name)#define BUZ_MAX_WIDTH (zr->timing->Wa)#define BUZ_MAX_HEIGHT (zr->timing->Ha)#define BUZ_MIN_WIDTH 32 /* never display less than 32 pixels */#define BUZ_MIN_HEIGHT 24 /* never display less than 24 rows */#define BUZ_NUM_STAT_COM 4#define BUZ_MASK_STAT_COM 3#define BUZ_MAX_FRAME 256 /* Must be a power of 2 */#define BUZ_MASK_FRAME 255 /* Must be BUZ_MAX_FRAME-1 */#define BUZ_MAX_INPUT 8#if VIDEO_MAX_FRAME <= 32# define V4L_MAX_FRAME 32#elif VIDEO_MAX_FRAME <= 64# define V4L_MAX_FRAME 64#else# error "Too many video frame buffers to handle"#endif#define V4L_MASK_FRAME (V4L_MAX_FRAME - 1)#define MAX_KMALLOC_MEM (128*1024)#include "zr36057.h"enum card_type { UNKNOWN = -1, /* Pinnacle/Miro */ DC10_old, /* DC30 like */ DC10_new, /* DC10plus like */ DC10plus, DC30, DC30plus, /* Linux Media Labs */ LML33, LML33R10, /* Iomega */ BUZ, /* total number of cards */ NUM_CARDS};enum zoran_codec_mode { BUZ_MODE_IDLE, /* nothing going on */ BUZ_MODE_MOTION_COMPRESS, /* grabbing frames */ BUZ_MODE_MOTION_DECOMPRESS, /* playing frames */ BUZ_MODE_STILL_COMPRESS, /* still frame conversion */ BUZ_MODE_STILL_DECOMPRESS /* still frame conversion */};enum zoran_buffer_state { BUZ_STATE_USER, /* buffer is owned by application */ BUZ_STATE_PEND, /* buffer is queued in pend[] ready to feed to I/O */ BUZ_STATE_DMA, /* buffer is queued in dma[] for I/O */ BUZ_STATE_DONE /* buffer is ready to return to application */};enum zoran_map_mode { ZORAN_MAP_MODE_RAW, ZORAN_MAP_MODE_JPG_REC,#define ZORAN_MAP_MODE_JPG ZORAN_MAP_MODE_JPG_REC ZORAN_MAP_MODE_JPG_PLAY,};enum gpio_type { GPIO_JPEG_SLEEP = 0, GPIO_JPEG_RESET, GPIO_JPEG_FRAME, GPIO_VID_DIR, GPIO_VID_EN, GPIO_VID_RESET, GPIO_CLK_SEL1, GPIO_CLK_SEL2, GPIO_MAX,};enum gpcs_type { GPCS_JPEG_RESET = 0, GPCS_JPEG_START, GPCS_MAX,};struct zoran_format { char *name; int palette; __u32 fourcc; int colorspace; int depth; __u32 flags;};/* flags */#define ZORAN_FORMAT_COMPRESSED 1<<0#define ZORAN_FORMAT_OVERLAY 1<<1#define ZORAN_FORMAT_CAPTURE 1<<2#define ZORAN_FORMAT_PLAYBACK 1<<3/* overlay-settings */struct zoran_overlay_settings { int is_set; int x, y, width, height; /* position */ int clipcount; /* position and number of clips */ const struct zoran_format *format; /* overlay format */};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -