diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-04-05 08:21:11 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-04-05 12:08:52 +0200 |
commit | 16357909f5b5818ad468f3ceb8bde406fd87fb38 (patch) | |
tree | 6daa52e6bd2e19360f357a1087fa57db5e039ec7 | |
parent | 351e57955755d9cc200155d6f9c1b7b5940fd979 (diff) | |
download | cv-16357909f5b5818ad468f3ceb8bde406fd87fb38.tar.gz cv-16357909f5b5818ad468f3ceb8bde406fd87fb38.tar.bz2 cv-16357909f5b5818ad468f3ceb8bde406fd87fb38.zip |
capture: Allow specifying an index
-rw-r--r-- | capture.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |