00001 /***************************************************************************** 00002 * Copyright (C) lavrec (see http://mjpeg.sourceforge.net) 00003 * ( XXX This file was get from the driver-zoran package and it is under GPL) 00004 * 00005 * $Id: videodev_mjpeg.h 10101 2005-03-02 16:47:31Z robux4 $ 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 00020 *****************************************************************************/ 00021 00022 /* These are the MJPEG API extensions for the Video4Linux API, 00023 first introduced by the Iomega Buz driver by Rainer Johanni 00024 <[email protected]> 00025 */ 00026 00027 /* This is identical with the mgavideo internal params struct, 00028 please tell me if you change this struct here ! <[email protected]) */ 00029 struct mjpeg_params 00030 { 00031 00032 /* The following parameters can only be queried */ 00033 00034 int major_version; /* Major version number of driver */ 00035 int minor_version; /* Minor version number of driver */ 00036 00037 /* Main control parameters */ 00038 00039 int input; /* Input channel: 0 = Composite, 1 = S-VHS */ 00040 int norm; /* Norm: VIDEO_MODE_PAL or VIDEO_MODE_NTSC */ 00041 int decimation; /* decimation of captured video, 00042 enlargement of video played back. 00043 Valid values are 1, 2, 4 or 0. 00044 0 is a special value where the user 00045 has full control over video scaling */ 00046 00047 /* The following parameters only have to be set if decimation==0, 00048 for other values of decimation they provide the data how the image is captured */ 00049 00050 int HorDcm; /* Horizontal decimation: 1, 2 or 4 */ 00051 int VerDcm; /* Vertical decimation: 1 or 2 */ 00052 int TmpDcm; /* Temporal decimation: 1 or 2, 00053 if TmpDcm==2 in capture every second frame is dropped, 00054 in playback every frame is played twice */ 00055 int field_per_buff; /* Number of fields per buffer: 1 or 2 */ 00056 int img_x; /* start of image in x direction */ 00057 int img_y; /* start of image in y direction */ 00058 int img_width; /* image width BEFORE decimation, 00059 must be a multiple of HorDcm*16 */ 00060 int img_height; /* image height BEFORE decimation, 00061 must be a multiple of VerDcm*8 */ 00062 00063 /* --- End of parameters for decimation==0 only --- */ 00064 00065 /* JPEG control parameters */ 00066 00067 int quality; /* Measure for quality of compressed images. 00068 Scales linearly with the size of the compressed images. 00069 Must be beetween 0 and 100, 100 is a compression 00070 ratio of 1:4 */ 00071 00072 int odd_even; /* Which field should come first ??? 00073 This is more aptly named "top_first", 00074 i.e. (odd_even==1) --> top-field-first */ 00075 00076 int APPn; /* Number of APP segment to be written, must be 0..15 */ 00077 int APP_len; /* Length of data in JPEG APPn segment */ 00078 char APP_data[60]; /* Data in the JPEG APPn segment. */ 00079 00080 int COM_len; /* Length of data in JPEG COM segment */ 00081 char COM_data[60]; /* Data in JPEG COM segment */ 00082 00083 unsigned long jpeg_markers; /* Which markers should go into the JPEG output. 00084 Unless you exactly know what you do, leave them untouched. 00085 Inluding less markers will make the resulting code 00086 smaller, but there will be fewer aplications 00087 which can read it. 00088 The presence of the APP and COM marker is 00089 influenced by APP0_len and COM_len ONLY! */ 00090 #define JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */ 00091 #define JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */ 00092 #define JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ 00093 #define JPEG_MARKER_COM (1<<6) /* Comment segment */ 00094 #define JPEG_MARKER_APP (1<<7) /* App segment, driver will allways use APP0 */ 00095 00096 int VFIFO_FB; /* Flag for enabling Video Fifo Feedback. 00097 If this flag is turned on and JPEG decompressing 00098 is going to the screen, the decompress process 00099 is stopped every time the Video Fifo is full. 00100 This enables a smooth decompress to the screen 00101 but the video output signal will get scrambled */ 00102 00103 /* Misc */ 00104 00105 char reserved[312]; /* Makes 512 bytes for this structure */ 00106 }; 00107 00108 struct mjpeg_requestbuffers 00109 { 00110 unsigned long count; /* Number of buffers for MJPEG grabbing */ 00111 unsigned long size; /* Size PER BUFFER in bytes */ 00112 }; 00113 00114 struct mjpeg_sync 00115 { 00116 unsigned long frame; /* Frame (0 - n) for double buffer */ 00117 unsigned long length; /* number of code bytes in buffer (capture only) */ 00118 unsigned long seq; /* frame sequence number */ 00119 struct timeval timestamp; /* timestamp */ 00120 }; 00121 00122 struct mjpeg_status 00123 { 00124 int input; /* Input channel, has to be set prior to BUZIOC_G_STATUS */ 00125 int signal; /* Returned: 1 if valid video signal detected */ 00126 int norm; /* Returned: VIDEO_MODE_PAL or VIDEO_MODE_NTSC */ 00127 int color; /* Returned: 1 if color signal detected */ 00128 }; 00129 00130 /* 00131 Private IOCTL to set up for displaying MJPEG 00132 */ 00133 #define MJPIOC_G_PARAMS _IOR ('v', BASE_VIDIOCPRIVATE+0, struct mjpeg_params) 00134 #define MJPIOC_S_PARAMS _IOWR('v', BASE_VIDIOCPRIVATE+1, struct mjpeg_params) 00135 #define MJPIOC_REQBUFS _IOWR('v', BASE_VIDIOCPRIVATE+2, struct mjpeg_requestbuffers) 00136 #define MJPIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOCPRIVATE+3, int) 00137 #define MJPIOC_QBUF_PLAY _IOW ('v', BASE_VIDIOCPRIVATE+4, int) 00138 #define MJPIOC_SYNC _IOR ('v', BASE_VIDIOCPRIVATE+5, struct mjpeg_sync) 00139 #define MJPIOC_G_STATUS _IOWR('v', BASE_VIDIOCPRIVATE+6, struct mjpeg_status)