From 16357909f5b5818ad468f3ceb8bde406fd87fb38 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 5 Apr 2012 08:21:11 +0200 Subject: capture: Allow specifying an index --- capture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- cgit