home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lxapi32.zip / Include / lxapiv4l.h < prev    next >
C/C++ Source or Header  |  2002-04-22  |  10KB  |  273 lines

  1. /*
  2.  * lxapiv4l.h
  3.  * Autor:               Stefan Milcke
  4.  * Erstellt am:         14.01.2002
  5.  * Letzte Aenderung am: 14.04.2002
  6.  *
  7. */
  8.  
  9. #ifndef LXAPIV4L_H_INCLUDED
  10. #define LXAPIV4L_H_INCLUDED
  11.  
  12. #pragma pack(1)
  13.  
  14. #define V4L_IOCTLFN_GCAP                                    0x001
  15. #define V4L_IOCTLFN_GCHAN                                   0x002
  16. #define V4L_IOCTLFN_SCHAN                                   0x003
  17. #define V4L_IOCTLFN_GTUNER                                  0x004
  18. #define V4L_IOCTLFN_STUNER                                  0x005
  19. #define V4L_IOCTLFN_GPICT                                   0x006
  20. #define V4L_IOCTLFN_SPICT                                   0x007
  21. #define V4L_IOCTLFN_CAPTURE                                 0x008
  22. #define V4L_IOCTLFN_GWIN                                    0x009
  23. #define V4L_IOCTLFN_SWIN                                    0x00a
  24. #define V4L_IOCTLFN_GFBUF                                   0x00b
  25. #define V4L_IOCTLFN_SFBUF                                   0x00c
  26. #define V4L_IOCTLFN_KEY                                     0x00d
  27. #define V4L_IOCTLFN_GFREQ                                   0x00e
  28. #define V4L_IOCTLFN_SFREQ                                   0x00f
  29. #define V4L_IOCTLFN_GAUDIO                                  0x010
  30. #define V4L_IOCTLFN_SAUDIO                                  0x011
  31. #define V4L_IOCTLFN_SYNC                                    0x012
  32. #define V4L_IOCTLFN_MCAPTURE                                0x013
  33. #define V4L_IOCTLFN_GMBUF                                   0x014
  34. #define V4L_IOCTLFN_GUNIT                                   0x015
  35. #define V4L_IOCTLFN_GCAPTURE                                0x016
  36. #define V4L_IOCTLFN_SCAPTURE                                0x017
  37. #define V4L_IOCTLFN_SPLAYMODE                               0x018
  38. #define V4L_IOCTLFN_SWRITEMODE                              0x019
  39. #define V4L_IOCTLFN_GPLAYINFO                               0x01a
  40. #define V4L_IOCTLFN_SMICROCODE                              0x01b
  41. #define V4L_IOCTLFN_GVBIFMT                                 0x01c
  42. #define V4L_IOCTLFN_SVBIFMT                                 0x01d
  43.  
  44. #define V4L_IOCTLFN_SFREQSTEP                               0x021
  45.  
  46. #define V4L_IOCTLFN_SRADIO                                  0x102
  47. #define V4L_IOCTLFN_SINPUT                                  0x111
  48.  
  49. // Define some types here
  50. #ifndef _I386_TYPES_H
  51. typedef signed char __s8;
  52. typedef unsigned char __u8;
  53. typedef signed short __s16;
  54. typedef unsigned short __u16;
  55. typedef signed int __s32;
  56. typedef unsigned int __u32;
  57. #endif
  58.  
  59. typedef struct _V4L_VIDEO_CAPABILITY
  60. {
  61.  char name[32];
  62.  int type;
  63.  int channels; // Num channels
  64.  int audios;   // Num audio devices
  65.  int maxwidth; // Supported width
  66.  int maxheight;// Supported height
  67.  int minwidth; // Supported width
  68.  int minheight;// Supported height
  69. }V4L_VIDEO_CAPABILITY,*PV4L_VIDEO_CAPABILITY;
  70.  
  71. typedef struct _V4L_VIDEO_CHANNEL
  72. {
  73.  int channel;
  74.  char name[32];
  75.  int tuners;
  76.  __u32 flags;
  77. #define VIDEO_VC_TUNER     1  // Channel has a tuner
  78. #define VIDEO_VC_AUDIO     2  // Channel has audio
  79.  __u16 type;
  80. #define VIDEO_TYPE_TV      1
  81. #define VIDEO_TYPE_CAMERA  2
  82.  __u16 norm;                 // Norm set by channel
  83. }V4L_VIDEO_CHANNEL,*PV4L_VIDEO_CHANNEL;
  84.  
  85. typedef struct _V4L_VIDEO_TUNER
  86. {
  87.  int tuner;
  88.  char name[32];
  89.  unsigned long rangelow,rangehigh;  // Tuner range
  90.  __u32 flags;
  91. #define VIDEO_TUNER_PAL       1
  92. #define VIDEO_TUNER_NTSC      2
  93. #define VIDEO_TUNER_SECAM     4
  94. #define VIDEO_TUNER_LOW       8     // Uses KHz not MHz
  95. #define VIDEO_TUNER_NORM      16    // Tuner can set norm
  96. #define VIDEO_TUNER_STEREO_ON 128   // Tuner is seeing stereo
  97. #define VIDEO_TUNER_RDS_ON    256   // Tuner is seeing an RDS datastream
  98. #define VIDEO_TUNER_MBS_ON    512   // Tuner is seeing an MBS datastream
  99.  __u16 mode;                 // PAL/NTSC/SECAM/OTHER
  100. #define VIDEO_MODE_PAL        0
  101. #define VIDEO_MODE_NTSC       1
  102. #define VIDEO_MODE_SECAM      2
  103. #define VIDEO_MODE_AUTO       3
  104.  __u16 signal;               // Signal strength 16bit scale
  105. }V4L_VIDEO_TUNER,*PV4L_VIDEO_TUNER;
  106.  
  107. typedef struct _V4L_VIDEO_PICTURE
  108. {
  109.  __u16 brightness;
  110.  __u16 hue;
  111.  __u16 colour;
  112.  __u16 contrast;
  113.  __u16 whiteness;             // Black and white only
  114.  __u16 depth;                 // Capture depth
  115.  __u16 palette;               // Palette in use
  116. #define VIDEO_PALETTE_GREY       1     // Linear greyscale
  117. #define VIDEO_PALETTE_HI240      2     // High 240 cube (BT848)
  118. #define VIDEO_PALETTE_RGB565     3     // 565 16 bit RGB
  119. #define VIDEO_PALETTE_RGB24      4     // 24bit RGB
  120. #define VIDEO_PALETTE_RGB32      5     // 32bit RGB
  121. #define VIDEO_PALETTE_RGB555     6     // 555 15bit RGB
  122. #define VIDEO_PALETTE_YUV422     7     // YUV422 capture
  123. #define VIDEO_PALETTE_YUYV       8
  124. #define VIDEO_PALETTE_UYVY       9     // The great thing about this standards is ...
  125. #define VIDEO_PALETTE_YUV420     10
  126. #define VIDEO_PALETTE_YUV411     11    // YUV411 capture
  127. #define VIDEO_PALETTE_RAW        12    // RAW capture (BT848)
  128. #define VIDEO_PALETTE_YUV422P    13    // YUV 4:2:2 Planar
  129. #define VIDEO_PALETTE_YUV411P    14    // YUV 4:1:1 Planar
  130. #define VIDEO_PALETTE_YUV420P    15    // YUV 4:2:0 Planar
  131. #define VIDEO_PALETTE_YUV410P    16    // YUV 4:1:0 Planar
  132. #define VIDEO_PALETTE_PLANAR     13    // start of planar entries
  133. #define VIDEO_PALETTE_COMPONENT  7     // start of component entries
  134. }V4L_VIDEO_PICTURE,*PV4L_VIDEO_PICTURE;
  135.  
  136. typedef struct _V4L_VIDEO_CLIP
  137. {
  138.  __s32 x,y;
  139.  __s32 width,height;
  140.  struct _V4L_VIDEO_CLIP *next;   // For user use/driver use only
  141. }V4L_VIDEO_CLIP,*PV4L_VIDEO_CLIP;
  142.  
  143. typedef struct _V4L_VIDEO_WINDOW
  144. {
  145.  __u32 x,y;                   // Position of window
  146.  __u32 width,height;          // Size of window
  147.  __u32 chromakey;
  148.  __u32 flags;
  149.  struct _V4L_VIDO_CLIP *clips;
  150.  int clipcount;
  151. #define VIDEO_WINDOW_INTERLACE   1
  152. #define VIDEO_WINDOW_CHROMAKEY   16    // Overlay by chromakey
  153. #define VIDEO_CLIP_BITMAP        -1
  154. #define VIDEO_CLIPMAP_SIZE       (128 * 625) // bitmap is 1024x625, a '1' bit represents a clipped pixel
  155. }V4L_VIDEO_WINDOW,*PV4L_VIDEO_WINDOW;
  156.  
  157. typedef struct _V4L_VIDEO_BUFFER
  158. {
  159.  void *base;
  160.  int height,width;
  161.  int depth;
  162.  int bytesperline;
  163. }V4L_VIDEO_BUFFER,*PV4L_VIDEO_BUFFER;
  164.  
  165. typedef struct _V4L_VIDEO_KEY
  166. {
  167.  __u8 key[8];
  168.  __u32 flags;
  169. }V4L_VIDEO_KEY,*PV4L_VIDEO_KEY;
  170.  
  171. typedef struct _V4L_VIDEO_AUDIO
  172. {
  173.  int audio;                   // Audio channel
  174. #define AUDIO_TUNER              0
  175. #define AUDIO_RADIO              1
  176. #define AUDIO_EXTERN             2
  177. #define AUDIO_INTERN             3
  178. #define AUDIO_OFF                4
  179. #define AUDIO_ON                 5
  180.  __u16 volume;                // If settable
  181.  __u16 bass,treble;
  182.  __u32 flags;
  183. #define VIDEO_AUDIO_MUTE         1
  184. #define VIDEO_AUDIO_MUTABLE      2
  185. #define VIDEO_AUDIO_VOLUME       4
  186. #define VIDEO_AUDIO_BASS         8
  187. #define VIDEO_AUDIO_TREBLE       16
  188.  char name[16];
  189. #define VIDEO_SOUND_MONO         1
  190. #define VIDEO_SOUND_STEREO       2
  191. #define VIDEO_SOUND_LANG1        4
  192. #define VIDEO_SOUND_LANG2        8
  193.  __u16 mode;
  194.  __u16 balance;               // Stereo balance
  195.  __u16 step;                  // Step actual volume uses
  196. }V4L_VIDEO_AUDIO,*PV4L_VIDEO_AUDIO;
  197.  
  198. #define VIDEO_MAX_FRAME          32
  199. typedef struct _V4L_VIDEO_MMAP
  200. {
  201.  unsigned int frame;          // Frame (0-n) for double buffer
  202.  int height,width;
  203.  unsigned int format;         // shoud be VIDEO_PALETTE_*
  204. }V4L_VIDEO_MMAP,*PV4L_VIDEO_MMAP;
  205.  
  206. typedef struct _V4L_VIDEO_MBUF
  207. {
  208.  int size;                    // Total memory to map
  209.  int frames;                  // Frames
  210.  int offsets[VIDEO_MAX_FRAME];
  211. }V4L_VIDEO_MBUF,*PV4L_VIDEO_MBUF;
  212.  
  213. #define VIDEO_NO_UNIT         (-1)
  214. typedef struct _V4L_VIDEO_UNIT
  215. {
  216.  int video;                   // Video minor
  217.  int vbi;                     // VBI minor
  218.  int radio;                   // Radio minor
  219.  int audio;                   // Audio minor
  220.  int teletext;                // Teletext minor
  221. }V4L_VIDEO_UNIT,*PV4L_VIDEO_UNIT;
  222.  
  223. typedef struct _V4L_VIDEO_CAPTURE
  224. {
  225.  __u32 x,y;                   // Offsets into image
  226.  __u32 width,height;          // Area to capture
  227.  __u16 decimation;            // Decimation divider
  228.  __u16 flags;                 // Flags for capture
  229. #define VIDEO_CAPTURE_ODD     0     // Temporal
  230. #define VIDEO_CAPTURE_EVEN    1
  231. }V4L_VIDEO_CAPTURE,*PV4L_VIDEO_CAPTURE;
  232.  
  233. typedef struct _V4L_VIDEO_PLAY_MODE
  234. {
  235.  int mode;
  236.  int p1;
  237.  int p2;
  238. }V4L_VIDEO_PLAY_MODE,*PV4L_VIDEO_PLAY_MODE;
  239.  
  240. typedef struct _V4L_VIDEO_INFO
  241. {
  242.  __u32 frame_count;           // frames output since decode/encode began
  243.  __u32 h_size;                // current unscaled horizontal size
  244.  __u32 v_size;                // current unscaled vertical size
  245.  __u32 smpte_timecode;        // current SMPTE timecode (for current GOP)
  246.  __u32 picture_type;          // current picture type
  247.  __u32 temporal_reference;    // current temporal reference
  248.  __u8 user_data[256];        // user data last found in compressed stream
  249.  // user_data[0] contains user data flags, user_data[1] has count
  250. }V4L_VIDEO_INFO,*PV4L_VIDEO_INFO;
  251.  
  252. typedef struct _V4L_VIDEO_CODE
  253. {
  254.  char loadwhat[16];           // name or tag of file being passed
  255.  int datasize;
  256.  __u8 *data;
  257. }V4L_VIDEO_CODE,*PV4L_VIDEO_CODE;
  258.  
  259. typedef struct _V4L_VBI_FORMAT
  260. {
  261.  __u32 sampling_rate;         // in Hz
  262.  __u32 samples_per_line;
  263.  __u32 sample_format;         // VIDEO_PALETTE_RAW only (1 byte)
  264.  __s32 start[2];              // Starting line for each frame
  265.  __u32 count[2];              // Count of lines for each frame
  266.  __u32 flags;
  267. #define VBI_UNSYNC            1     // can distingues between top/bottom field
  268. #define VBI_INTERLACED        2     // lines are interlaced
  269. }V4L_VBI_FORMAT,*PV4L_VBI_FORMAT;
  270.  
  271. #pragma pack()
  272. #endif //LXAPIV4L_H_INCLUDED
  273.