--- videodev2.h.orig	Sat May 24 19:46:24 2008
+++ videodev2.h	Sat May 24 19:51:33 2008
@@ -14,7 +14,7 @@
  *		et al.
  */
 
-#include <asm/types.h>
+#include <sys/types.h>
 #include <sys/time.h>
 
 /*
@@ -23,7 +23,7 @@
 
 /*  Four-character-code (FOURCC) */
 #define v4l2_fourcc(a,b,c,d)\
-        (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
+        (((uint32_t)(a)<<0)|((uint32_t)(b)<<8)|((uint32_t)(c)<<16)|((uint32_t)(d)<<24))
 
 /*
  *	E N U M S
@@ -123,15 +123,15 @@ enum v4l2_priority {
 };
 
 struct v4l2_rect {
-	__s32   left;
-	__s32   top;
-	__s32   width;
-	__s32   height;
+	int32_t   left;
+	int32_t   top;
+	int32_t   width;
+	int32_t   height;
 };
 
 struct v4l2_fract {
-	__u32   numerator;
-	__u32   denominator;
+	uint32_t   numerator;
+	uint32_t   denominator;
 };
 
 /*
@@ -139,12 +139,12 @@ struct v4l2_fract {
  */
 struct v4l2_capability
 {
-	__u8	driver[16];	/* i.e. "bttv" */
-	__u8	card[32];	/* i.e. "Hauppauge WinTV" */
-	__u8	bus_info[32];	/* "PCI:" + pci_name(pci_dev) */
-	__u32   version;        /* should use KERNEL_VERSION() */
-	__u32	capabilities;	/* Device capabilities */
-	__u32	reserved[4];
+	uint8_t	driver[16];	/* i.e. "bttv" */
+	uint8_t	card[32];	/* i.e. "Hauppauge WinTV" */
+	uint8_t	bus_info[32];	/* "PCI:" + pci_name(pci_dev) */
+	uint32_t   version;        /* should use KERNEL_VERSION() */
+	uint32_t	capabilities;	/* Device capabilities */
+	uint32_t	reserved[4];
 };
 
 /* Values for 'capabilities' field */
@@ -169,14 +169,14 @@ struct v4l2_capability
 
 struct v4l2_pix_format
 {
-	__u32         	 	width;
-	__u32	         	height;
-	__u32	         	pixelformat;
+	uint32_t         	 	width;
+	uint32_t	         	height;
+	uint32_t	         	pixelformat;
 	enum v4l2_field  	field;
-	__u32            	bytesperline;	/* for padding, zero if unused */
-	__u32          	 	sizeimage;
+	uint32_t            	bytesperline;	/* for padding, zero if unused */
+	uint32_t          	 	sizeimage;
         enum v4l2_colorspace	colorspace;
-	__u32			priv;		/* private data, depends on pixelformat */
+	uint32_t			priv;		/* private data, depends on pixelformat */
 };
 
 /*           Pixel format    FOURCC                  depth  Description   */
@@ -226,12 +226,12 @@ struct v4l2_pix_format
  */
 struct v4l2_fmtdesc
 {
-	__u32	            index;             /* Format number      */
+	uint32_t	            index;             /* Format number      */
 	enum v4l2_buf_type  type;              /* buffer type        */
-	__u32               flags;
-	__u8	            description[32];   /* Description string */
-	__u32	            pixelformat;       /* Format fourcc      */
-	__u32	            reserved[4];
+	uint32_t               flags;
+	uint8_t	            description[32];   /* Description string */
+	uint32_t	            pixelformat;       /* Format fourcc      */
+	uint32_t	            reserved[4];
 };
 
 #define V4L2_FMT_FLAG_COMPRESSED 0x0001
@@ -242,13 +242,13 @@ struct v4l2_fmtdesc
  */
 struct v4l2_timecode
 {
-	__u32	type;
-	__u32	flags;
-	__u8	frames;
-	__u8	seconds;
-	__u8	minutes;
-	__u8	hours;
-	__u8	userbits[4];
+	uint32_t	type;
+	uint32_t	flags;
+	uint8_t	frames;
+	uint8_t	seconds;
+	uint8_t	minutes;
+	uint8_t	hours;
+	uint8_t	userbits[4];
 };
 
 /*  Type  */
@@ -285,9 +285,9 @@ enum v4l2_bitrate_mode {
 struct v4l2_bitrate {
 	/* rates are specified in kbit/sec */
 	enum v4l2_bitrate_mode	mode;
-	__u32			min;
-	__u32			target;  /* use this one for CBR */
-	__u32			max;
+	uint32_t			min;
+	uint32_t			target;  /* use this one for CBR */
+	uint32_t			max;
 };
 
 enum v4l2_mpeg_streamtype {
@@ -320,39 +320,39 @@ struct v4l2_mpeg_compression {
 	struct v4l2_bitrate		st_bitrate;
 
 	/* transport streams */
-	__u16				ts_pid_pmt;
-	__u16				ts_pid_audio;
-	__u16				ts_pid_video;
-	__u16				ts_pid_pcr;
+	uint16_t				ts_pid_pmt;
+	uint16_t				ts_pid_audio;
+	uint16_t				ts_pid_video;
+	uint16_t				ts_pid_pcr;
 
 	/* program stream */
-	__u16				ps_size;
-	__u16				reserved_1;    /* align */
+	uint16_t				ps_size;
+	uint16_t				reserved_1;    /* align */
 
 	/* audio */
 	enum v4l2_mpeg_audiotype	au_type;
 	struct v4l2_bitrate		au_bitrate;
-	__u32				au_sample_rate;
-	__u8                            au_pesid;
-	__u8                            reserved_2[3]; /* align */
+	uint32_t				au_sample_rate;
+	uint8_t                            au_pesid;
+	uint8_t                            reserved_2[3]; /* align */
 
 	/* video */
 	enum v4l2_mpeg_videotype	vi_type;
 	enum v4l2_mpeg_aspectratio	vi_aspect_ratio;
 	struct v4l2_bitrate		vi_bitrate;
-	__u32				vi_frame_rate;
-	__u16				vi_frames_per_gop;
-	__u16				vi_bframes_count;
-	__u8                            vi_pesid;
-	__u8                            reserved_3[3]; /* align */
+	uint32_t				vi_frame_rate;
+	uint16_t				vi_frames_per_gop;
+	uint16_t				vi_bframes_count;
+	uint8_t                            vi_pesid;
+	uint8_t                            reserved_3[3]; /* align */
 
 	/* misc flags */
-	__u32                           closed_gops:1;
-	__u32                           pulldown:1;
-	__u32                           reserved_4:30; /* align */
+	uint32_t                           closed_gops:1;
+	uint32_t                           pulldown:1;
+	uint32_t                           reserved_4:30; /* align */
 
 	/* I don't expect the above being perfect yet ;) */
-	__u32				reserved_5[8];
+	uint32_t				reserved_5[8];
 };
 #endif
 
@@ -368,7 +368,7 @@ struct v4l2_jpegcompression
 	int  COM_len;           /* Length of data in JPEG COM segment */
 	char COM_data[60];      /* Data in JPEG COM segment */
 
-	__u32 jpeg_markers;     /* Which markers should go into the JPEG
+	uint32_t jpeg_markers;     /* Which markers should go into the JPEG
 				 * output. Unless you exactly know what
 				 * you do, leave them untouched.
 				 * Inluding less markers will make the
@@ -392,32 +392,32 @@ struct v4l2_jpegcompression
  */
 struct v4l2_requestbuffers
 {
-	__u32	                count;
+	uint32_t	                count;
 	enum v4l2_buf_type      type;
 	enum v4l2_memory        memory;
-	__u32	                reserved[2];
+	uint32_t	                reserved[2];
 };
 
 struct v4l2_buffer
 {
-	__u32			index;
+	uint32_t			index;
 	enum v4l2_buf_type      type;
-	__u32			bytesused;
-	__u32			flags;
+	uint32_t			bytesused;
+	uint32_t			flags;
 	enum v4l2_field		field;
 	struct timeval		timestamp;
 	struct v4l2_timecode	timecode;
-	__u32			sequence;
+	uint32_t			sequence;
 
 	/* memory location */
 	enum v4l2_memory        memory;
 	union {
-		__u32           offset;
+		uint32_t           offset;
 		unsigned long   userptr;
 	} m;
-	__u32			length;
-	__u32			input;
-	__u32			reserved;
+	uint32_t			length;
+	uint32_t			input;
+	uint32_t			reserved;
 };
 
 /*  Flags for 'flags' field */
@@ -435,8 +435,8 @@ struct v4l2_buffer
  */
 struct v4l2_framebuffer
 {
-	__u32			capability;
-	__u32			flags;
+	uint32_t			capability;
+	uint32_t			flags;
 /* FIXME: in theory we should pass something like PCI device + memory
  * region + offset instead of some physical address */
 	void*                   base;
@@ -462,9 +462,9 @@ struct v4l2_window
 {
 	struct v4l2_rect        w;
 	enum v4l2_field  	field;
-	__u32			chromakey;
+	uint32_t			chromakey;
 	struct v4l2_clip	*clips;
-	__u32			clipcount;
+	uint32_t			clipcount;
 	void			*bitmap;
 };
 
@@ -474,12 +474,12 @@ struct v4l2_window
  */
 struct v4l2_captureparm
 {
-	__u32		   capability;	  /*  Supported modes */
-	__u32		   capturemode;	  /*  Current mode */
+	uint32_t		   capability;	  /*  Supported modes */
+	uint32_t		   capturemode;	  /*  Current mode */
 	struct v4l2_fract  timeperframe;  /*  Time per frame in .1us units */
-	__u32		   extendedmode;  /*  Driver-specific extensions */
-	__u32              readbuffers;   /*  # of buffers for read */
-	__u32		   reserved[4];
+	uint32_t		   extendedmode;  /*  Driver-specific extensions */
+	uint32_t              readbuffers;   /*  # of buffers for read */
+	uint32_t		   reserved[4];
 };
 /*  Flags for 'capability' and 'capturemode' fields */
 #define V4L2_MODE_HIGHQUALITY	0x0001	/*  High quality imaging mode */
@@ -487,12 +487,12 @@ struct v4l2_captureparm
 
 struct v4l2_outputparm
 {
-	__u32		   capability;	 /*  Supported modes */
-	__u32		   outputmode;	 /*  Current mode */
+	uint32_t		   capability;	 /*  Supported modes */
+	uint32_t		   outputmode;	 /*  Current mode */
 	struct v4l2_fract  timeperframe; /*  Time per frame in seconds */
-	__u32		   extendedmode; /*  Driver-specific extensions */
-	__u32              writebuffers; /*  # of buffers for write */
-	__u32		   reserved[4];
+	uint32_t		   extendedmode; /*  Driver-specific extensions */
+	uint32_t              writebuffers; /*  # of buffers for write */
+	uint32_t		   reserved[4];
 };
 
 /*
@@ -515,7 +515,7 @@ struct v4l2_crop {
  *      A N A L O G   V I D E O   S T A N D A R D
  */
 
-typedef __u64 v4l2_std_id;
+typedef uint64_t v4l2_std_id;
 
 /* one bit for each */
 #define V4L2_STD_PAL_B          ((v4l2_std_id)0x00000001)
@@ -585,12 +585,12 @@ typedef __u64 v4l2_std_id;
 
 struct v4l2_standard
 {
-	__u32	       	     index;
+	uint32_t	       	     index;
 	v4l2_std_id          id;
-	__u8		     name[24];
+	uint8_t		     name[24];
 	struct v4l2_fract    frameperiod; /* Frames, not fields */
-	__u32		     framelines;
-	__u32		     reserved[4];
+	uint32_t		     framelines;
+	uint32_t		     reserved[4];
 };
 
 
@@ -599,14 +599,14 @@ struct v4l2_standard
  */
 struct v4l2_input
 {
-	__u32	     index;		/*  Which input */
-	__u8	     name[32];	        /*  Label */
-	__u32	     type;		/*  Type of input */
-	__u32	     audioset;	        /*  Associated audios (bitfield) */
-	__u32        tuner;             /*  Associated tuner */
+	uint32_t	     index;		/*  Which input */
+	uint8_t	     name[32];	        /*  Label */
+	uint32_t	     type;		/*  Type of input */
+	uint32_t	     audioset;	        /*  Associated audios (bitfield) */
+	uint32_t        tuner;             /*  Associated tuner */
 	v4l2_std_id  std;
-	__u32	     status;
-	__u32	     reserved[4];
+	uint32_t	     status;
+	uint32_t	     reserved[4];
 };
 /*  Values for the 'type' field */
 #define V4L2_INPUT_TYPE_TUNER		1
@@ -636,13 +636,13 @@ struct v4l2_input
  */
 struct v4l2_output
 {
-	__u32	     index;		/*  Which output */
-	__u8	     name[32];	        /*  Label */
-	__u32	     type;		/*  Type of output */
-	__u32	     audioset;	        /*  Associated audios (bitfield) */
-	__u32	     modulator;         /*  Associated modulator */
+	uint32_t	     index;		/*  Which output */
+	uint8_t	     name[32];	        /*  Label */
+	uint32_t	     type;		/*  Type of output */
+	uint32_t	     audioset;	        /*  Associated audios (bitfield) */
+	uint32_t	     modulator;         /*  Associated modulator */
 	v4l2_std_id  std;
-	__u32	     reserved[4];
+	uint32_t	     reserved[4];
 };
 /*  Values for the 'type' field */
 #define V4L2_OUTPUT_TYPE_MODULATOR		1
@@ -654,31 +654,31 @@ struct v4l2_output
  */
 struct v4l2_control
 {
-	__u32		     id;
-	__s32		     value;
+	uint32_t		     id;
+	int32_t		     value;
 };
 
 /*  Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
 struct v4l2_queryctrl
 {
-	__u32	             id;
+	uint32_t	             id;
 	enum v4l2_ctrl_type  type;
-	__u8		     name[32];	/* Whatever */
-	__s32		     minimum;	/* Note signedness */
-	__s32		     maximum;
-	__s32	             step;
-	__s32		     default_value;
-	__u32                flags;
-	__u32		     reserved[2];
+	uint8_t		     name[32];	/* Whatever */
+	int32_t		     minimum;	/* Note signedness */
+	int32_t		     maximum;
+	int32_t	             step;
+	int32_t		     default_value;
+	uint32_t                flags;
+	uint32_t		     reserved[2];
 };
 
 /*  Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
 struct v4l2_querymenu
 {
-	__u32		id;
-	__u32		index;
-	__u8		name[32];	/* Whatever */
-	__u32		reserved;
+	uint32_t		id;
+	uint32_t		index;
+	uint8_t		name[32];	/* Whatever */
+	uint32_t		reserved;
 };
 
 /*  Control flags  */
@@ -721,28 +721,28 @@ struct v4l2_querymenu
  */
 struct v4l2_tuner
 {
-	__u32                   index;
-	__u8			name[32];
+	uint32_t                   index;
+	uint8_t			name[32];
 	enum v4l2_tuner_type    type;
-	__u32			capability;
-	__u32			rangelow;
-	__u32			rangehigh;
-	__u32			rxsubchans;
-	__u32			audmode;
-	__s32			signal;
-	__s32			afc;
-	__u32			reserved[4];
+	uint32_t			capability;
+	uint32_t			rangelow;
+	uint32_t			rangehigh;
+	uint32_t			rxsubchans;
+	uint32_t			audmode;
+	int32_t			signal;
+	int32_t			afc;
+	uint32_t			reserved[4];
 };
 
 struct v4l2_modulator
 {
-	__u32			index;
-	__u8			name[32];
-	__u32			capability;
-	__u32			rangelow;
-	__u32			rangehigh;
-	__u32			txsubchans;
-	__u32			reserved[4];
+	uint32_t			index;
+	uint8_t			name[32];
+	uint32_t			capability;
+	uint32_t			rangelow;
+	uint32_t			rangehigh;
+	uint32_t			txsubchans;
+	uint32_t			reserved[4];
 };
 
 /*  Flags for the 'capability' field */
@@ -769,10 +769,10 @@ struct v4l2_modulator
 
 struct v4l2_frequency
 {
-	__u32	              tuner;
+	uint32_t	              tuner;
 	enum v4l2_tuner_type  type;
-        __u32	              frequency;
-	__u32	              reserved[8];
+        uint32_t	              frequency;
+	uint32_t	              reserved[8];
 };
 
 /*
@@ -780,11 +780,11 @@ struct v4l2_frequency
  */
 struct v4l2_audio
 {
-	__u32	index;
-	__u8	name[32];
-	__u32	capability;
-	__u32	mode;
-	__u32	reserved[2];
+	uint32_t	index;
+	uint8_t	name[32];
+	uint32_t	capability;
+	uint32_t	mode;
+	uint32_t	reserved[2];
 };
 /*  Flags for the 'capability' field */
 #define V4L2_AUDCAP_STEREO		0x00001
@@ -795,11 +795,11 @@ struct v4l2_audio
 
 struct v4l2_audioout
 {
-	__u32	index;
-	__u8	name[32];
-	__u32	capability;
-	__u32	mode;
-	__u32	reserved[2];
+	uint32_t	index;
+	uint8_t	name[32];
+	uint32_t	capability;
+	uint32_t	mode;
+	uint32_t	reserved[2];
 };
 
 /*
@@ -810,14 +810,14 @@ struct v4l2_audioout
 
 struct v4l2_vbi_format
 {
-	__u32	sampling_rate;		/* in 1 Hz */
-	__u32	offset;
-	__u32	samples_per_line;
-	__u32	sample_format;		/* V4L2_PIX_FMT_* */
-	__s32	start[2];
-	__u32	count[2];
-	__u32	flags;			/* V4L2_VBI_* */
-	__u32	reserved[2];		/* must be zero */
+	uint32_t	sampling_rate;		/* in 1 Hz */
+	uint32_t	offset;
+	uint32_t	samples_per_line;
+	uint32_t	sample_format;		/* V4L2_PIX_FMT_* */
+	int32_t	start[2];
+	uint32_t	count[2];
+	uint32_t	flags;			/* V4L2_VBI_* */
+	uint32_t	reserved[2];		/* must be zero */
 };
 
 /*  VBI flags  */
@@ -839,7 +839,7 @@ struct v4l2_format
 		struct v4l2_pix_format	pix;  // V4L2_BUF_TYPE_VIDEO_CAPTURE
 		struct v4l2_window	win;  // V4L2_BUF_TYPE_VIDEO_OVERLAY
 		struct v4l2_vbi_format	vbi;  // V4L2_BUF_TYPE_VBI_CAPTURE
-		__u8	raw_data[200];        // user-defined
+		uint8_t	raw_data[200];        // user-defined
 	} fmt;
 };
 
@@ -853,7 +853,7 @@ struct v4l2_streamparm
 	{
 		struct v4l2_captureparm	capture;
 		struct v4l2_outputparm	output;
-		__u8	raw_data[200];  /* user-defined */
+		uint8_t	raw_data[200];  /* user-defined */
 	} parm;
 };
 
