summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-04-05 08:21:11 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-04-05 12:08:52 +0200
commit16357909f5b5818ad468f3ceb8bde406fd87fb38 (patch)
tree6daa52e6bd2e19360f357a1087fa57db5e039ec7
parent351e57955755d9cc200155d6f9c1b7b5940fd979 (diff)
downloadcv-16357909f5b5818ad468f3ceb8bde406fd87fb38.zip
cv-16357909f5b5818ad468f3ceb8bde406fd87fb38.tar.gz
cv-16357909f5b5818ad468f3ceb8bde406fd87fb38.tar.bz2
capture: Allow specifying an index
-rw-r--r--capture.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/capture.c b/capture.c
index 095c587..dc0e643 100644
--- a/capture.c
+++ b/capture.c
@@ -195,12 +195,16 @@ int
main(int argc, char *argv[])
{
struct ct ct;
+ int index = CV_CAP_ANY;
memset(&ct, 0, sizeof ct);
gtk_init(&argc, &argv);
- ct.capture = cvCreateCameraCapture(CV_CAP_ANY);
+ if (argc > 1)
+ index = atoi(argv[argc-1]);
+
+ ct.capture = cvCreateCameraCapture(index);
if (!ct.capture) {
fprintf(stderr, "ERROR: capture is NULL \n");
exit(EXIT_FAILURE);