Merge svn changes up to r28461
[mplayer.git] / libvo / videodev_mjpeg.h
blob74962e9f5ec95b9f92232b0d5434c7a56b6fbf00
1 /* These are the MJPEG API extensions for the Video4Linux API,
2 first introduced by the Iomega Buz driver by Rainer Johanni
3 <rainer@johanni.de>
4 */
6 #ifndef MPLAYER_VIDEODEV_MJPEG_H
7 #define MPLAYER_VIDEODEV_MJPEG_H
9 #include <stdlib.h>
11 /* This is identical with the mgavideo internal params struct,
12 please tell me if you change this struct here ! <gz@lysator.liu.se) */
13 struct mjpeg_params
16 /* The following parameters can only be queried */
18 int major_version; /* Major version number of driver */
19 int minor_version; /* Minor version number of driver */
21 /* Main control parameters */
23 int input; /* Input channel: 0 = Composite, 1 = S-VHS */
24 int norm; /* Norm: VIDEO_MODE_PAL or VIDEO_MODE_NTSC */
25 int decimation; /* decimation of captured video,
26 enlargement of video played back.
27 Valid values are 1, 2, 4 or 0.
28 0 is a special value where the user
29 has full control over video scaling */
31 /* The following parameters only have to be set if decimation==0,
32 for other values of decimation they provide the data how the image is captured */
34 int HorDcm; /* Horizontal decimation: 1, 2 or 4 */
35 int VerDcm; /* Vertical decimation: 1 or 2 */
36 int TmpDcm; /* Temporal decimation: 1 or 2,
37 if TmpDcm==2 in capture every second frame is dropped,
38 in playback every frame is played twice */
39 int field_per_buff; /* Number of fields per buffer: 1 or 2 */
40 int img_x; /* start of image in x direction */
41 int img_y; /* start of image in y direction */
42 int img_width; /* image width BEFORE decimation,
43 must be a multiple of HorDcm*16 */
44 int img_height; /* image height BEFORE decimation,
45 must be a multiple of VerDcm*8 */
47 /* --- End of parameters for decimation==0 only --- */
49 /* JPEG control parameters */
51 int quality; /* Measure for quality of compressed images.
52 Scales linearly with the size of the compressed images.
53 Must be beetween 0 and 100, 100 is a compression
54 ratio of 1:4 */
56 int odd_even; /* Which field should come first ???
57 This is more aptly named "top_first",
58 i.e. (odd_even==1) --> top-field-first */
60 int APPn; /* Number of APP segment to be written, must be 0..15 */
61 int APP_len; /* Length of data in JPEG APPn segment */
62 char APP_data[60]; /* Data in the JPEG APPn segment. */
64 int COM_len; /* Length of data in JPEG COM segment */
65 char COM_data[60]; /* Data in JPEG COM segment */
67 unsigned long jpeg_markers; /* Which markers should go into the JPEG output.
68 Unless you exactly know what you do, leave them untouched.
69 Inluding less markers will make the resulting code
70 smaller, but there will be fewer aplications
71 which can read it.
72 The presence of the APP and COM marker is
73 influenced by APP0_len and COM_len ONLY! */
74 #define JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
75 #define JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
76 #define JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
77 #define JPEG_MARKER_COM (1<<6) /* Comment segment */
78 #define JPEG_MARKER_APP (1<<7) /* App segment, driver will allways use APP0 */
80 int VFIFO_FB; /* Flag for enabling Video Fifo Feedback.
81 If this flag is turned on and JPEG decompressing
82 is going to the screen, the decompress process
83 is stopped every time the Video Fifo is full.
84 This enables a smooth decompress to the screen
85 but the video output signal will get scrambled */
87 /* Misc */
89 char reserved[312]; /* Makes 512 bytes for this structure */
92 struct mjpeg_requestbuffers
94 unsigned long count; /* Number of buffers for MJPEG grabbing */
95 unsigned long size; /* Size PER BUFFER in bytes */
98 struct mjpeg_sync
100 unsigned long frame; /* Frame (0 - n) for double buffer */
101 unsigned long length; /* number of code bytes in buffer (capture only) */
102 unsigned long seq; /* frame sequence number */
103 struct timeval timestamp; /* timestamp */
106 struct mjpeg_status
108 int input; /* Input channel, has to be set prior to BUZIOC_G_STATUS */
109 int signal; /* Returned: 1 if valid video signal detected */
110 int norm; /* Returned: VIDEO_MODE_PAL or VIDEO_MODE_NTSC */
111 int color; /* Returned: 1 if color signal detected */
115 Private IOCTL to set up for displaying MJPEG
117 #define MJPIOC_G_PARAMS _IOR ('v', BASE_VIDIOCPRIVATE+0, struct mjpeg_params)
118 #define MJPIOC_S_PARAMS _IOWR('v', BASE_VIDIOCPRIVATE+1, struct mjpeg_params)
119 #define MJPIOC_REQBUFS _IOWR('v', BASE_VIDIOCPRIVATE+2, struct mjpeg_requestbuffers)
120 #define MJPIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOCPRIVATE+3, int)
121 #define MJPIOC_QBUF_PLAY _IOW ('v', BASE_VIDIOCPRIVATE+4, int)
122 #define MJPIOC_SYNC _IOR ('v', BASE_VIDIOCPRIVATE+5, struct mjpeg_sync)
123 #define MJPIOC_G_STATUS _IOWR('v', BASE_VIDIOCPRIVATE+6, struct mjpeg_status)
125 #endif /* MPLAYER_VIDEODEV_MJPEG_H */