summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@x-bsw12.sh.intel.com>2015-04-22 16:55:53 +0800
committerroot <root@x-bsw12.sh.intel.com>2015-04-22 16:55:53 +0800
commit1294d60886c877f34f9271a62ccfe70c67e3bcd6 (patch)
tree45032f87f1774abe26ec304e52197a587b20fccf
parent1444853478b2e7fcda336080bf4fc8dd88c97a0a (diff)
Add -s
Signed-off-by: root <root@x-bsw12.sh.intel.com>
-rw-r--r--tools/QRdecode.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/QRdecode.cpp b/tools/QRdecode.cpp
index 37e2c0c..d75715d 100644
--- a/tools/QRdecode.cpp
+++ b/tools/QRdecode.cpp
@@ -79,6 +79,7 @@ static char QR4Ddir[256];
static char child_exist = 1;
char *screen_ori;
+int times_capture = MAX_CAP_FRAME;
void sighandler(int signo)
{
@@ -205,7 +206,7 @@ void resume_screen()
munmap(fbp, screensize);
close(fbfd);
- kill(pid_test, SIGUSR2);
+// kill(pid_test, SIGUSR2);
return;
}
@@ -415,10 +416,11 @@ process_image(void *p, int dev_id)
printf("SaveAs:%s\n", filename);
printf("Captured Camera: %s\n", dev_names[dev_id]);
- kill(pid_test, SIGUSR1);
+// kill(pid_test, SIGUSR1);
+ exit(0);
mode_count ++;
}
- else if ( f_count/dev_count == MAX_CAP_FRAME)
+ else if ( f_count/dev_count == times_capture)
{
sprintf(filename, "%s/saveimages/",QR4Ddir);
exist_dir(filename);
@@ -430,11 +432,12 @@ process_image(void *p, int dev_id)
cvSaveImage(filename, image);
printf("SaveAs:%s\n", filename);
}
- else if ( f_count/dev_count > MAX_CAP_FRAME )
+ else if ( f_count/dev_count > times_capture )
{
f_count = 0;
- kill(pid_test, SIGUSR1);
+ exit(1);
+// kill(pid_test, SIGUSR1);
mode_count ++;
}
@@ -923,11 +926,12 @@ usage(FILE *fp, int argc,char **argv)
argv[0]);
}
-static const char short_options [] = "t:d:hmpAO:D:P:T";
+static const char short_options [] = "t:d:s:hmpAO:D:P:T";
static const struct option
long_options [] = {
{ "device", required_argument, NULL, 'd' },
+ { "times_capture", required_argument, NULL, 's' },
{ "test", required_argument, NULL, 't' },
{ "help", no_argument, NULL, 'h' },
{ "preview", no_argument, NULL, 'p' },
@@ -977,6 +981,10 @@ int main(int argc,char *argv[])
// memcpy(dev_names[0], optarg, strlen(optarg));
dev_count = 1;
break;
+ case 's':
+ times_capture = atoi(optarg);
+ break;
+
case 't':
run_test = 1;