home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / usbd0906.zip / usb_20020906.zip / usbcalls / samples / ultracam / usbvideo.h < prev   
C/C++ Source or Header  |  2001-11-15  |  18KB  |  503 lines

  1. /*
  2.  * This program is free software; you can redistribute it and/or modify
  3.  * it under the terms of the GNU General Public License as published by
  4.  * the Free Software Foundation; either version 2, or (at your option)
  5.  * any later version.
  6.  *
  7.  * This program is distributed in the hope that it will be useful,
  8.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10.  * GNU General Public License for more details.
  11.  *
  12.  * You should have received a copy of the GNU General Public License
  13.  * along with this program; if not, write to the Free Software
  14.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15.  */
  16. #ifndef usbvideo_h
  17.   #define    usbvideo_h
  18.  
  19. /*
  20. #include <linux/proc_fs.h>
  21. #include <linux/videodev.h>
  22. #include <linux/usb.h>
  23. #include <linux/version.h>
  24. */
  25.  
  26. /* Most helpful debugging aid */
  27.   #define assert(expr) ((void) ((expr) ? 0 : (printf("assert failed at line %d",__LINE__))))
  28.  
  29.   #define USES_PROC_FS    (defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS))
  30.  
  31. /* We use new-style probe introduced in early 2.4 kernels */
  32.   #define    USES_NEW_STYLE_PROBE    (((LINUX_VERSION_CODE >> 16) >= 2) && (((LINUX_VERSION_CODE >> 8) & 0xFF) >= 4))
  33.  
  34.   #define USBVIDEO_REPORT_STATS    1    /* Set to 0 to block statistics on close */
  35.  
  36. /* Bit flags (options) */
  37.   #define FLAGS_RETRY_VIDIOCSYNC        (1 << 0)
  38.   #define    FLAGS_MONOCHROME        (1 << 1)
  39.   #define FLAGS_DISPLAY_HINTS        (1 << 2)
  40.   #define FLAGS_OVERLAY_STATS        (1 << 3)
  41.   #define FLAGS_FORCE_TESTPATTERN        (1 << 4)
  42.   #define FLAGS_SEPARATE_FRAMES        (1 << 5)
  43.   #define FLAGS_CLEAN_FRAMES        (1 << 6)
  44.   #define    FLAGS_NO_DECODING        (1 << 7)
  45.  
  46. /* Bit flags for frames (apply to the frame where they are specified) */
  47.   #define USBVIDEO_FRAME_FLAG_SOFTWARE_CONTRAST    (1 << 0)
  48.  
  49. /* Camera capabilities (maximum) */
  50.   #define CAMERA_URB_FRAMES       32
  51.   #define CAMERA_MAX_ISO_PACKET   1023 /* 1022 actually sent by camera */
  52.   #define FRAMES_PER_DESC        (CAMERA_URB_FRAMES)
  53.   #define FRAME_SIZE_PER_DESC    (CAMERA_MAX_ISO_PACKET)
  54.  
  55. /* This macro restricts an int variable to an inclusive range */
  56.   #define RESTRICT_TO_RANGE(v,mi,ma) { if ((v) < (mi)) (v) = (mi); else if ((v) > (ma)) (v) = (ma); }
  57.  
  58.   #define V4L_BYTES_PER_PIXEL     3    /* Because we produce RGB24 */
  59.  
  60. /*
  61.  * Use this macro to construct constants for different video sizes.
  62.  * We have to deal with different video sizes that have to be
  63.  * configured in the device or compared against when we receive
  64.  * a data. Normally one would define a bunch of VIDEOSIZE_x_by_y
  65.  * #defines and that's the end of story. However this solution
  66.  * does not allow to convert between real pixel sizes and the
  67.  * constant (integer) value that may be used to tag a frame or
  68.  * whatever. The set of macros below constructs videosize constants
  69.  * from the pixel size and allows to reconstruct the pixel size
  70.  * from the combined value later.
  71.  */
  72.   #define    VIDEOSIZE(x,y)    (((x) & 0xFFFFL) | (((y) & 0xFFFFL) << 16))
  73.   #define    VIDEOSIZE_X(vs)    ((vs) & 0xFFFFL)
  74.   #define    VIDEOSIZE_Y(vs)    (((vs) >> 16) & 0xFFFFL)
  75. typedef unsigned long videosize_t;
  76.  
  77. /*
  78.  * This macro checks if the camera is still operational. The 'uvd'
  79.  * pointer must be valid, uvd->dev must be valid, we are not
  80.  * removing the device and the device has not erred on us.
  81.  */
  82.   #define CAMERA_IS_OPERATIONAL(uvd) (\
  83.     (uvd != NULL) && \
  84.     ((uvd)->dev != NULL) && \
  85.     ((uvd)->last_error == 0) && \
  86.     (!(uvd)->remove_pending))
  87.  
  88. /*
  89.  * We use macros to do YUV -> RGB conversion because this is
  90.  * very important for speed and totally unimportant for size.
  91.  *
  92.  * YUV -> RGB Conversion
  93.  * ---------------------
  94.  *
  95.  * B = 1.164*(Y-16)            + 2.018*(V-128)
  96.  * G = 1.164*(Y-16) - 0.813*(U-128) - 0.391*(V-128)
  97.  * R = 1.164*(Y-16) + 1.596*(U-128)
  98.  *
  99.  * If you fancy integer arithmetics (as you should), hear this:
  100.  *
  101.  * 65536*B = 76284*(Y-16)          + 132252*(V-128)
  102.  * 65536*G = 76284*(Y-16) -  53281*(U-128) -  25625*(V-128)
  103.  * 65536*R = 76284*(Y-16) + 104595*(U-128)
  104.  *
  105.  * Make sure the output values are within [0..255] range.
  106.  */
  107.   #define LIMIT_RGB(x) (((x) < 0) ? 0 : (((x) > 255) ? 255 : (x)))
  108.   #define YUV_TO_RGB_BY_THE_BOOK(my,mu,mv,mr,mg,mb) { \
  109.     int mm_y, mm_yc, mm_u, mm_v, mm_r, mm_g, mm_b; \
  110.     mm_y = (my) - 16;  \
  111.     mm_u = (mu) - 128; \
  112.     mm_v = (mv) - 128; \
  113.     mm_yc= mm_y * 76284; \
  114.     mm_b = (mm_yc        + 132252*mm_v    ) >> 16; \
  115.     mm_g = (mm_yc -  53281*mm_u -  25625*mm_v    ) >> 16; \
  116.     mm_r = (mm_yc + 104595*mm_u            ) >> 16; \
  117.     mb = LIMIT_RGB(mm_b); \
  118.     mg = LIMIT_RGB(mm_g); \
  119.     mr = LIMIT_RGB(mm_r); \
  120. }
  121.  
  122.   #define    RING_QUEUE_ADVANCE_INDEX(rq,ind,n) (rq)->ind = ((rq)->ind + (n)) % (rq)->length
  123.   #define    RING_QUEUE_DEQUEUE_BYTES(rq,n) RING_QUEUE_ADVANCE_INDEX(rq,ri,n)
  124.   #define    RING_QUEUE_PEEK(rq,ofs) ((rq)->queue[((ofs) + (rq)->ri) % (rq)->length])
  125.  
  126. typedef struct
  127. {
  128.   unsigned char *queue; /* Data from the Isoc data pump */
  129.   int length;   /* How many bytes allocated for the queue */
  130.   int wi;     /* That's where we write */
  131.   int ri;     /* Read from here until you hit write index */
  132.   //wait_queue_head_t wqh;    /* Processes waiting */
  133. } RingQueue_t;
  134.  
  135. typedef enum
  136. {
  137.   ScanState_Scanning, /* Scanning for header */
  138.   ScanState_Lines   /* Parsing lines */
  139. } ScanState_t;
  140.  
  141. /* Completion states of the data parser */
  142. typedef enum
  143. {
  144.   scan_Continue,    /* Just parse next item */
  145.   scan_NextFrame,   /* Frame done, send it to V4L */
  146.   scan_Out,   /* Not enough data for frame */
  147.   scan_EndParse   /* End parsing */
  148. } ParseState_t;
  149.  
  150. typedef enum
  151. {
  152.   FrameState_Unused,  /* Unused (no MCAPTURE) */
  153.   FrameState_Ready, /* Ready to start grabbing */
  154.   FrameState_Grabbing,  /* In the process of being grabbed into */
  155.   FrameState_Done,  /* Finished grabbing, but not been synced yet */
  156.   FrameState_Done_Hold, /* Are syncing or reading */
  157.   FrameState_Error  /* Something bad happened while processing */
  158. } FrameState_t;
  159.  
  160. /*
  161.  * Some frames may contain only even or odd lines. This type
  162.  * specifies what type of deinterlacing is required.
  163.  */
  164. typedef enum
  165. {
  166.   Deinterlace_None=0,
  167.   Deinterlace_FillOddLines,
  168.   Deinterlace_FillEvenLines
  169. } Deinterlace_t;
  170.  
  171. struct usb_device;
  172.  
  173.   #define USBVIDEO_NUMFRAMES    2    /* How many frames we work with */
  174.   #define USBVIDEO_NUMSBUF    2    /* How many URBs linked in a ring */
  175.  
  176. /* This structure represents one Isoc request - URB and buffer */
  177. typedef struct
  178. {
  179.   char *data;
  180.   void *urb; //    urb_t *urb;
  181. } usbvideo_sbuf_t;
  182.  
  183. typedef struct
  184. {
  185.   char *data;   /* Frame buffer */
  186.   unsigned long header; /* Significant bits from the header */
  187.  
  188.   videosize_t canvas; /* The canvas (max. image) allocated */
  189.   videosize_t request;  /* That's what the application asked for */
  190.   unsigned short palette; /* The desired format */
  191.  
  192.   FrameState_t frameState;/* State of grabbing */
  193.   ScanState_t scanstate;  /* State of scanning */
  194.   Deinterlace_t deinterlace;
  195.   int flags;    /* USBVIDEO_FRAME_FLAG_xxx bit flags */
  196.  
  197.   int curline;    /* Line of frame we're working on */
  198.  
  199.   long seqRead_Length;  /* Raw data length of frame */
  200.   long seqRead_Index; /* Amount of data that has been already read */
  201.  
  202.   void *user;   /* Additional data that user may need */
  203. } usbvideo_frame_t;
  204.  
  205. /* Statistics that can be overlaid on screen */
  206. typedef struct
  207. {
  208.   unsigned long frame_num;  /* Sequential number of the frame */
  209.   unsigned long urb_count;        /* How many URBs we received so far */
  210.   unsigned long urb_length;       /* Length of last URB */
  211.   unsigned long data_count;       /* How many bytes we received */
  212.   unsigned long header_count;     /* How many frame headers we found */
  213.   unsigned long iso_skip_count; /* How many empty ISO packets received */
  214.   unsigned long iso_err_count;  /* How many bad ISO packets received */
  215. } usbvideo_statistics_t;
  216.  
  217. struct s_usbvideo_t;
  218.  
  219. typedef struct
  220. {
  221.   char *marker_data;
  222.   int marker_size;
  223. } DatastreamMarker_t;
  224.  
  225. typedef struct
  226. {
  227.   ULONG ulDummy;
  228. }video_device ;
  229.  
  230. #define VIDEO_PALETTE_RGB24 24
  231. typedef  struct
  232. {
  233.   char colour;
  234.   char hue;
  235.   char brightness;
  236.   char contrast;
  237.   char whiteness;
  238.   char depth;
  239.   char palette;
  240. } video_picture;  /* Picture settings */
  241.  
  242. #define VID_TYPE_CAPTURE 2 
  243. typedef struct
  244. {
  245.   int type;
  246.   char name[30];
  247.   int minheight, maxheight;
  248.   int minwidth, maxwidth;
  249.   int audios;
  250.   int channels;
  251. } video_capability;   /* Video capabilities */
  252. #define VIDEO_TYPE_CAMERA 1
  253. typedef struct video_channel 
  254. {
  255.   int type;
  256.   char name[30];
  257.   int flags;
  258.   int tuners;
  259.   int channel;
  260. } vchan; /* May be used for tuner support */
  261.  
  262. typedef struct
  263. {
  264.   video_device vdev;  /* Must be the first field! */
  265.   USBHANDLE dev;//struct usb_device *dev;
  266.   struct s_usbvideo_t *handle;  /* Points back to the usbvideo_t */
  267.   void *user_data;    /* Camera-dependent data */
  268.   int user_size;      /* Size of that camera-dependent data */
  269.   DatastreamMarker_t emptyMarker; /* Optional empty marker for empty frames
  270.              in an iso-stream. The empty marker is 
  271.              inserted in ringbuffer when a 0 length
  272.              frame is recieved in the iso stream and 
  273.              the empty_marker_size > 0. Needed for 
  274.              webcamgo driver */
  275.   int debug;      /* Debug level for usbvideo */
  276.   unsigned char iface;    /* Video interface number */
  277.   unsigned char video_endp;
  278.   unsigned char ifaceAltActive;
  279.   unsigned char ifaceAltInactive; /* Alt settings */
  280.   unsigned long flags;    /* FLAGS_USBVIDEO_xxx */
  281.   unsigned long paletteBits;  /* Which palettes we accept? */
  282.   unsigned short defaultPalette;  /* What palette to use for read() */
  283.   HSEM lock;//struct semaphore lock;
  284.   int user;   /* user count for exclusive use */
  285.  
  286.   videosize_t videosize;  /* Current setting */
  287.   videosize_t canvas; /* This is the width,height of the V4L canvas */
  288.   int max_frame_size; /* Bytes in one video frame */
  289.  
  290.   int uvd_used;         /* Is this structure in use? */
  291.   int streaming;    /* Are we streaming Isochronous? */
  292.   int grabbing;   /* Are we grabbing? */
  293.   int settingsAdjusted; /* Have we adjusted contrast etc.? */
  294.   int last_error;   /* What calamity struck us? */
  295.  
  296.   char *fbuf;   /* Videodev buffer area */
  297.   int fbuf_size;    /* Videodev buffer size */
  298.  
  299.   int curframe;
  300.   int iso_packet_len; /* Videomode-dependent, saves bus bandwidth */
  301.  
  302.   RingQueue_t dp;   /* Isoc data pump */
  303.   usbvideo_frame_t frame[USBVIDEO_NUMFRAMES];
  304.   usbvideo_sbuf_t sbuf[USBVIDEO_NUMSBUF];
  305.  
  306.   volatile int remove_pending;  /* If set then about to exit */
  307.   video_picture vpic, vpic_old;  /* Picture settings */
  308.   video_capability vcap;   /* Video capabilities */
  309.   video_channel vchan; /* May be used for tuner support */
  310.   usbvideo_statistics_t stats;
  311.   #if 0
  312.   struct proc_dir_entry *procfs_vEntry; /* /proc/video/MYDRIVER/video2 */
  313.   #endif
  314.   char videoName[32];   /* Holds name like "video7" */
  315. } uvd_t;
  316.  
  317. /*
  318.  * usbvideo callbacks (virtual methods). They are set when usbvideo
  319.  * services are registered. All of these default to NULL, except those
  320.  * that default to usbvideo-provided methods.
  321.  */
  322. #define off_t int
  323. typedef struct
  324. {
  325.   #if USES_NEW_STYLE_PROBE
  326.   /* New style probe (for 2.4.x kernels with hotplugging) */
  327.   void *(*probe)(struct usb_device *, unsigned int,const struct usb_device_id *);
  328.   #else
  329.   /* Old style probe (for 2.2.x kernels) */
  330.   void *(*probe)(struct usb_device *, unsigned int);
  331.   #endif
  332.   void (*userFree)(uvd_t *);
  333.   void (*disconnect)(struct usb_device *, void *);
  334.   int (*setupOnOpen)(uvd_t *);
  335.   void (*videoStart)(uvd_t *);
  336.   void (*videoStop)(uvd_t *);
  337.   void (*processData)(uvd_t *, usbvideo_frame_t *);
  338.   void (*postProcess)(uvd_t *, usbvideo_frame_t *);
  339.   void (*adjustPicture)(uvd_t *);
  340.   int (*getFPS)(uvd_t *);
  341.   int (*overlayHook)(uvd_t *, usbvideo_frame_t *);
  342.   int (*getFrame)(uvd_t *, int);
  343.   int (*procfs_read)(char *page,char **start,off_t off,int count,int *eof,void *data);
  344.   int (*procfs_write)(struct file *file,const char *buffer,unsigned long count,void *data);
  345. } usbvideo_cb_t;
  346.  
  347. struct s_usbvideo_t
  348. {
  349.   int num_cameras;    /* As allocated */
  350.   //struct usb_driver usbdrv; /* Interface to the USB stack */
  351.   char drvName[80];   /* Driver name */
  352.   HEV lock;//struct semaphore lock;    /* Mutex protecting camera structures */
  353.   usbvideo_cb_t cb;   /* Table of callbacks (virtual methods) */
  354.   video_device vdt;  /* Video device template */
  355.   uvd_t *cam;     /* Array of camera structures */
  356.   int uses_procfs;    /* Non-zero if we create /proc entries */
  357.   struct proc_dir_entry *procfs_dEntry; /* /proc/video/MYDRIVER */
  358.   struct module *md_module; /* Minidriver module */
  359. };
  360. typedef struct s_usbvideo_t usbvideo_t;
  361.  
  362. /*
  363.  * This macro retrieves callback address from the uvd_t object.
  364.  * No validity checks are done here, so be sure to check the
  365.  * callback beforehand with VALID_CALLBACK.
  366.  */
  367.   #define    GET_CALLBACK(uvd,cbName) ((uvd)->handle->cb.cbName)
  368.  
  369. /*
  370.  * This macro returns either callback pointer or NULL. This is safe
  371.  * macro, meaning that most of components of data structures involved
  372.  * may be NULL - this only results in NULL being returned. You may
  373.  * wish to use this macro to make sure that the callback is callable.
  374.  * However keep in mind that those checks take time.
  375.  */
  376.   #define    VALID_CALLBACK(uvd,cbName) ((((uvd) != NULL) && \
  377.         ((uvd)->handle != NULL)) ? GET_CALLBACK(uvd,cbName) : NULL)
  378.  
  379.   #if 0
  380. void RingQueue_Initialize(RingQueue_t *rq);
  381. void RingQueue_Allocate(RingQueue_t *rq, int rqLen);
  382. int  RingQueue_IsAllocated(const RingQueue_t *rq);
  383. void RingQueue_Free(RingQueue_t *rq);
  384. int  RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len);
  385. int  RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n);
  386. int  RingQueue_GetLength(const RingQueue_t *rq);
  387. void RingQueue_InterruptibleSleepOn(RingQueue_t *rq);
  388. void RingQueue_WakeUpInterruptible(RingQueue_t *rq);
  389.  
  390. void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame);
  391. void usbvideo_DrawLine(
  392.                       usbvideo_frame_t *frame,
  393.                       int x1, int y1,
  394.                       int x2, int y2,
  395.                       unsigned char cr, unsigned char cg, unsigned char cb);
  396. void usbvideo_HexDump(const unsigned char *data, int len);
  397. void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame, int x, int y, int ch);
  398. void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame, int x, int y, const char *str);
  399. void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame);
  400. void usbvideo_ReportStatistics(const uvd_t *uvd);
  401. void usbvideo_SayAndWait(const char *what);
  402. void usbvideo_TestPattern(uvd_t *uvd, int fullframe, int pmode);
  403. void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs);
  404.  
  405. /* Memory allocation routines */
  406. unsigned long usbvideo_uvirt_to_kva(pgd_t *pgd, unsigned long adr);
  407. unsigned long usbvideo_uvirt_to_bus(unsigned long adr);
  408. unsigned long usbvideo_kvirt_to_bus(unsigned long adr);
  409. unsigned long usbvideo_kvirt_to_pa(unsigned long adr);
  410. void *usbvideo_rvmalloc(unsigned long size);
  411. void usbvideo_rvfree(void *mem, unsigned long size);
  412.  
  413. int usbvideo_register(
  414.                      usbvideo_t **pCams,
  415.                      const int num_cams,
  416.                      const int num_extra,
  417.                      const char *driverName,
  418.                      const usbvideo_cb_t *cbTable,
  419.                      struct module *md);
  420. uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams);
  421. int usbvideo_RegisterVideoDevice(uvd_t *uvd);
  422. void usbvideo_Deregister(usbvideo_t **uvt);
  423. void usbvideo_Disconnect(struct usb_device *dev, void *ptr);
  424. void usbvideo_CameraRelease(uvd_t *uvd);
  425.  
  426. void usbvideo_v4l_close(struct video_device *dev);
  427. int usbvideo_v4l_initialize(struct video_device *dev);
  428. int usbvideo_v4l_ioctl(struct video_device *dev, unsigned int cmd, void *arg);
  429. int usbvideo_v4l_mmap(struct video_device *dev, const char *adr, unsigned long size);
  430. int usbvideo_v4l_open(struct video_device *dev, int flags);
  431. long usbvideo_v4l_read(struct video_device *dev, char *buf,
  432.                        unsigned long count, int noblock);
  433. long usbvideo_v4l_write(struct video_device *dev, const char *buf,
  434.                         unsigned long count, int noblock);
  435.  
  436. int usbvideo_GetFrame(uvd_t *uvd, int frameNum);
  437. int usbvideo_NewFrame(uvd_t *uvd, int framenum);
  438. int usbvideo_StartDataPump(uvd_t *uvd);
  439. void usbvideo_StopDataPump(uvd_t *uvd);
  440. void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame);
  441. void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd, usbvideo_frame_t *frame);
  442.   #endif
  443. /*
  444.  * This code performs bounds checking - use it when working with
  445.  * new formats, or else you may get oopses all over the place.
  446.  * If pixel falls out of bounds then it gets shoved back (as close
  447.  * to place of offence as possible) and is painted bright red.
  448.  *
  449.  * There are two important concepts: frame width, height and
  450.  * V4L canvas width, height. The former is the area requested by
  451.  * the application -for this very frame-. The latter is the largest
  452.  * possible frame that we can serve (we advertise that via V4L ioctl).
  453.  * The frame data is expected to be formatted as lines of length
  454.  * VIDEOSIZE_X(fr->request), total VIDEOSIZE_Y(frame->request) lines.
  455.  */
  456. static inline void RGB24_PUTPIXEL(
  457.                                  usbvideo_frame_t *fr,
  458.                                  int ix, int iy,
  459.                                  unsigned char vr,
  460.                                  unsigned char vg,
  461.                                  unsigned char vb)
  462. {
  463.   register unsigned char *pf;
  464.   int limiter = 0, mx, my;
  465.   mx = ix;
  466.   my = iy;
  467.   if (mx < 0)
  468.   {
  469.     mx=0;
  470.     limiter++;
  471.   }
  472.   else if (mx >= VIDEOSIZE_X((fr)->request))
  473.   {
  474.     mx= VIDEOSIZE_X((fr)->request) - 1;
  475.     limiter++;
  476.   }
  477.   if (my < 0)
  478.   {
  479.     my = 0;
  480.     limiter++;
  481.   }
  482.   else if (my >= VIDEOSIZE_Y((fr)->request))
  483.   {
  484.     my = VIDEOSIZE_Y((fr)->request) - 1;
  485.     limiter++;
  486.   }
  487.   pf = (UCHAR*)(fr)->data + V4L_BYTES_PER_PIXEL*((iy)*VIDEOSIZE_X((fr)->request) + (ix));
  488.   if (limiter)
  489.   {
  490.     *pf++ = 0;
  491.     *pf++ = 0;
  492.     *pf++ = 0xFF;
  493.   }
  494.   else
  495.   {
  496.     *pf++ = (vb);
  497.     *pf++ = (vg);
  498.     *pf++ = (vr);
  499.   }
  500. }
  501.  
  502. #endif /* usbvideo_h */
  503.