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