/* additional definitions for the v4l-API */

#include <linux/types.h>
#include <linux/version.h>

/* videodev.h - section */

#ifndef VIDIOCGVBIFMT
struct vbi_format {
	__u32	sampling_rate;	/* in Hz */
	__u32	samples_per_line;	/* number of datapoints in a field */
	__u32	sample_format;	/* VIDEO_PALETTE_RAW only (1 byte) */
	__s32	start[2];	/* starting line for each frame */
	__u32	count[2];	/* count of lines for each frame */
	__u32	flags;
#define	VBI_UNSYNC	1	/* can distingues between top/bottom field */
#define	VBI_INTERLACED	2	/* lines are interlaced	*/
};
#define VIDIOCGVBIFMT	_IOW('v', 28, struct vbi_format) /* Get VBI information */
#define VIDIOCSVBIFMT	_IOW('v', 29, struct vbi_format) /* Set VBI information */
#endif

#ifndef VIDIOCGANTENNA
struct video_antenna 
{ 
   __u16 input;                        /* number of antenna input */ 
   __u16 capabilities; 
#define VIDEO_ANTENNA_1814V          1 /* can set 18/14V (1 = yes/18V) */ 
#define VIDEO_ANTENNA_22KHZ          2 /* can switch 22kHz (1 = yes/22kHz on) */ 
#define VIDEO_ANTENNA_POWER          4 /* can switch LNB power supply (1 = yes/on) */ 
#define VIDEO_ANTENNA_12V            8 /* has a controlable 12V output (1 = yes/on) */ 
#define VIDEO_ANTENNA_SKEW          16 /* has a magnetic polarizer (1 = yes/set value in 'skew') */ 
#define VIDEO_ANTENNA_22KHZ_BURST   32 /* can send a 22kHz burst (1 = yes/send data burst) */ 
#define VIDEO_ANTENNA_SIMPLE_DISEQC 64 /* can do 'Simple' DiSEqC */ 
#define VIDEO_ANTENNA_DISEQC_1     128 /* can do DiSEqC version 1.x */ 
#define VIDEO_ANTENNA_DISEQC_2     256 /* can do DiSEqC version 2.x */ 
#define VIDEO_ANTENNA_DISEQC_3     512 /* can do DiSEqC version 3.x */ 
   __u16 settings;                     /* are the same as in 'capabilities' */

   __s16 skew;                         /* set skew value for magnetic polarizers, if in 'capabilities' */ 
                                       /* and 'settings' VIDEO_ANTENNA_SKEW is true */

   __u8  diseqc[32];                   /* array for submitting DiSEqC command bytes to the driver */
                                       /* diseqc[0] has the number of bytes to be send */
                                       /* the command-sequence starts at diseqc[1] */ 
};
#define VIDIOCGANTENNA 	_IOWR('v', 40, struct video_antenna) /* Get antenna information */
#define VIDIOCSANTENNA 	_IOW('v', 41, struct video_antenna) /* Set antenna */
#endif

#ifndef VIDIOCGAUDIOCARRIER
struct video_audio_carrier
{
	__u16 r_freq, l_freq;		    /* carrier-frequency in units of kHz */
	__u16 deemphasis;		    /* deemphasis */
#define VIDEO_AUDIO_CARRIER_WP		1   /* Wegener-Panda */
#define VIDEO_AUDIO_CARRIER_J17		2   /* J17 */
#define VIDEO_AUDIO_CARRIER_50US	3   /* 50us */
#define VIDEO_AUDIO_CARRIER_75US	4   /* 75us */
};
#define VIDIOCGAUDIOCARRIER	_IOR('v', 42, struct video_audio_carrier) /* Get audio carrier settings */
#define VIDIOCSAUDIOCARRIER	_IOW('v', 43, struct video_audio_carrier) /* Set audio carrier */
#endif

#ifndef VIDIOCGADR
struct video_adr
{
	__u16 mode;		    /* mode field */
#define VIDEO_ADR_ON		1   /* switch on adr mode */
#define VIDEO_ADR_OFF		2   /* switch off adr mode */
#define VIDEO_ADR_STATUS	4   /* get adr status and index */
#define VIDEO_ADR_REC_ON	8   /* switch on recording of a mpeg layer2 stream */
#define VIDEO_ADR_REC_OFF	16  /* switch off recording of a mpeg layer2 stream */
#define VIDEO_ADR_MP2BUF	32  /* get size of mp2 data buffer, which read() relies on */
#define VIDEO_ADR_ANCILLARY	64  /* only get: read adr ancillary data */
#define VIDEO_ADR_REC_RESTART	128 /* to restart a mp2 recording session and dump some data */
#define VIDEO_ADR_AGC           256 /* read agc register */
	__u8  ancillary[22];	    /* buffer for adr ancillary data. Byte 0=offset, byte 1=count, */
				    /* and bytes 2-21 are documented in the adr-specification */
	__u16 status;		    /* adr status */
	__u32 mp2;		    /* mp2-buffer size */
	__u32 agc;                  /* automatic gain control register */
};
#define VIDIOCGADR 	_IOWR('v', 44, struct video_adr)	/* Get astra digital radio information */
#define VIDIOCSADR 	_IOW('v', 45, struct video_adr)	/* Set astra digital radio */
#endif

/* video_decoder.h - section */

#ifndef VIDEO_MODE_TTX
#define	VIDEO_MODE_TTX		4
#endif
#ifndef VIDEO_MODE_RAW
#define	VIDEO_MODE_RAW		5
#endif

#ifndef	VIDEO_DECODER_TTX
#define	VIDEO_DECODER_TTX	32	/* can decode TTX signal */
#endif
#ifndef	VIDEO_DECODER_RAW
#define	VIDEO_DECODER_RAW	16	/* can deliver RAW signal */
#endif
#ifndef	VIDEO_DECODER_VBI
#define	VIDEO_DECODER_VBI	128	/* can deliver VBI signal */
#endif

#ifndef	DECODER_SET_VBI
#define	DECODER_SET_VBI		_IOW('d', 8, int)
#endif

