Advertisement
Guest User

Untitled

a guest
Sep 24th, 2011
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.58 KB | None | 0 0
  1. diff -u uvccapture-0.5-nonoo-r3/Makefile uvccapture-0.5-nonoo-r4/Makefile
  2. --- uvccapture-0.5-nonoo-r3/Makefile    2011-09-24 19:41:52.000000000 +1000
  3. +++ uvccapture-0.5-nonoo-r4/Makefile    2011-09-24 22:53:22.000000000 +1000
  4. @@ -1,7 +1,7 @@
  5.  CC=gcc
  6.  CPP=g++
  7.  APP_BINARY=uvccapture
  8. -VERSION = 0.5.3
  9. +VERSION = 0.5.4
  10.  PREFIX=/usr/local/bin
  11.  
  12.  WARNINGS = -Wall
  13. diff -u uvccapture-0.5-nonoo-r3/uvccapture.c uvccapture-0.5-nonoo-r4/uvccapture.c
  14. --- uvccapture-0.5-nonoo-r3/uvccapture.c    2011-09-24 20:05:29.000000000 +1000
  15. +++ uvccapture-0.5-nonoo-r4/uvccapture.c    2011-09-24 22:53:04.000000000 +1000
  16. @@ -79,7 +79,9 @@
  17.    fprintf (stderr,
  18.        "-D<integer>\tPre-delay before capture\n");
  19.    fprintf (stderr,
  20. -      "-W\t\tConstantly capture images during the pre-delay loop\n");
  21. +      "-P<integer>\tPost-delay after capture\n");
  22. +  fprintf (stderr,
  23. +      "-W\t\tConstantly capture images during the pre-delay and post-delay loops\n");
  24.    fprintf (stderr, "Camera Settings:\n");
  25.    fprintf (stderr, "-B<integer>\tBrightness\n");
  26.    fprintf (stderr, "-C<integer>\tContrast\n");
  27. @@ -307,6 +309,7 @@
  28.    unsigned char* imageWithDHT = NULL;
  29.    int imageWithDHTSize = 0;
  30.    int preDelay = 0;
  31. +  int postDelay = 0;
  32.    int backGround = 0;
  33.    int preDelayCapture = 0;
  34.    int cameraControlsEnabled = 0;
  35. @@ -412,6 +415,10 @@
  36.        preDelay = atoi (&argv[1][2]);
  37.        break;
  38.  
  39. +    case 'P':
  40. +      postDelay = atoi (&argv[1][2]);
  41. +      break;
  42. +
  43.      case 'h':
  44.        usage ();
  45.        break;
  46. @@ -440,7 +447,7 @@
  47.        fprintf (stderr, "Taking images using read\n");
  48.      if (pre_capture_command[0])
  49.        fprintf (stderr, "Executing '%s' before each image capture\n",
  50. -          pre_capture_command[0]);    
  51. +          pre_capture_command[0]);
  52.      if (post_capture_command[0])
  53.        fprintf (stderr, "Executing '%s' after each image capture\n",
  54.            post_capture_command[0]);
  55. @@ -516,7 +523,7 @@
  56.    }
  57.  
  58.    while (run) {
  59. -    if (preDelay) {
  60. +    if (preDelay > 0) {
  61.        if (verbose > 0)
  62.          fprintf (stderr, "Pre-delay: %d, sleeping...\n", preDelay);
  63.  
  64. @@ -600,6 +607,23 @@
  65.      }
  66.      if (delay == 0)
  67.        break;
  68. +
  69. +    if (postDelay > 0) {
  70. +      if (verbose > 0)
  71. +        fprintf (stderr, "Post-delay: %d, sleeping...\n", postDelay);
  72. +
  73. +      for (int i = 0; i < postDelay; i++) {
  74. +        if (run == 0)
  75. +          break;
  76. +        // allowing camera to adjust exposure
  77. +        if (i == 0 || preDelayCapture) {
  78. +          uvcGrab(videoIn);
  79. +          videoIn->getPict = 0;
  80. +        }
  81. +
  82. +        sleep(1);
  83. +      }
  84. +    }
  85.    }
  86.    close_v4l2 (videoIn);
  87.    free (videoIn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement