video.c.patch
上传用户:lijia5631
上传日期:2008-11-10
资源大小:1214k
文件大小:3k
源码类别:

视频捕捉/采集

开发平台:

MultiPlatform

  1. --- video.c.orig 2005-03-07 16:11:11.558649856 -0800
  2. +++ video.c 2005-03-07 16:15:01.402708248 -0800
  3. @@ -120,6 +120,8 @@
  4.      AR2VideoParamT            *vid;
  5.      ARUint32                  p1,p2;
  6.      quadlet_t                 value;
  7. +    struct stat               statbuf; /* sjd */
  8. +    char                      videodev[256]; /*sjd*/
  9.      char                      *a, line[256];
  10.      int                       i;
  11.  
  12. @@ -303,6 +305,19 @@
  13.          exit(0);
  14.      }
  15.  
  16. +/*
  17. + * sjd - check for /dev/video1394/0 or /dev/video1394 and select 
  18. + * dynamically, for better compatibility
  19. + */
  20. +    if( stat( "/dev/video1394/0", &statbuf ) == 0 ) {
  21. +        sprintf( videodev, "/dev/video1394/0" );
  22. +    } else if( stat( "/dev/video1394", &statbuf ) == 0 ) {
  23. +        sprintf( videodev, "/dev/video1394" );
  24. +    } else {
  25. +      fprintf( stderr, "unable to find / access video1394 camera devicen" );
  26. +      exit(0);
  27. +    }
  28. +
  29.      /*-----------------------------------------------------------------------*/
  30.      /*  setup capture                                                        */
  31.      /*-----------------------------------------------------------------------*/
  32. @@ -314,6 +329,7 @@
  33.            vid->speed,
  34.            vid->int_rate,
  35.            vid->dma_buf_num,
  36. +  1 /* drop frames*/, videodev, /* sjd*/
  37.            &(vid->camera)) != DC1394_SUCCESS ) {
  38.          fprintf( stderr,"unable to setup camera-n"
  39.                  "check if you did 'insmod video1394' or,n"
  40. @@ -363,11 +379,27 @@
  41.  
  42.  int ar2VideoCapStart( AR2VideoParamT *vid )
  43.  {
  44. +  struct stat statbuf;   /* sjd */
  45. +  char videodev[256];  /* sjd */
  46. +
  47.      if(vid->status != 0 && vid->status != 3){
  48.          printf("arVideoCapStart has already been called.n");
  49.          return -1;
  50.      }
  51.  
  52. +/*
  53. + * sjd - check for /dev/video1394/0 or /dev/video1394 and select 
  54. + * dynamically, for better compatibility
  55. + */
  56. +    if( stat( "/dev/video1394/0", &statbuf ) == 0 ) {
  57. +        sprintf( videodev, "/dev/video1394/0" );
  58. +    } else if( stat( "/dev/video1394", &statbuf ) == 0 ) {
  59. +        sprintf( videodev, "/dev/video1394" );
  60. +    } else {
  61. +      fprintf( stderr, "unable to find / access video1394 camera devicen" );
  62. +      exit(0);
  63. +    }
  64. +
  65.      /*-----------------------------------------------------------------------*/
  66.      /*  setup capture                                                        */
  67.      /*-----------------------------------------------------------------------*/
  68. @@ -380,6 +412,7 @@
  69.                vid->speed,
  70.                vid->int_rate,
  71.                vid->dma_buf_num,
  72. +      1 /* drop frames*/, videodev, /*sjd*/
  73.                &(vid->camera)) != DC1394_SUCCESS ) {
  74.              fprintf( stderr,"unable to setup camera-n"
  75.                      "check if you did 'insmod video1394' or,n"