git.ucc.asn.au
/
matches
/
MCTX3420.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes
[matches/MCTX3420.git]
/
server
/
image.c
diff --git
a/server/image.c
b/server/image.c
index
a24d091
..
1d35264
100644
(file)
--- a/
server/image.c
+++ b/
server/image.c
@@
-4,7
+4,8
@@
#include <string.h>
#include <stdio.h>
#include <string.h>
#include <stdio.h>
-CvCapture *captures[2] = {0};
+CvCapture *capture;
+int captureID = -1;
void Image_Handler(FCGIContext * context, char * params)
{
void Image_Handler(FCGIContext * context, char * params)
{
@@
-24,10
+25,12
@@
void Image_Handler(FCGIContext * context, char * params)
return;
}
return;
}
- CvCapture *capture = captures[num];
- if (capture == NULL) {
+ if (captureID != num) {
+ if (captureID >= 0) {
+ cvReleaseCapture(&capture);
+ }
capture = cvCreateCameraCapture(num);
capture = cvCreateCameraCapture(num);
- capture
s[num] = capture
;
+ capture
ID = num
;
}
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, width);
}
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, width);
UCC
git Repository :: git.ucc.asn.au