__u32 palette;
int width, height;
+ int width_set, height_set;
int bufferSize;
__u32 fps;
bool convert_rgb;
FirstCapture = 1;
width = DEFAULT_V4L_WIDTH;
height = DEFAULT_V4L_HEIGHT;
+ width_set = height_set = 0;
bufferSize = DEFAULT_V4L_BUFFERS;
fps = DEFAULT_V4L_FPS;
convert_rgb = true;
static int icvSetPropertyCAM_V4L( CvCaptureCAM_V4L* capture,
int property_id, double value ){
- static int width = 0, height = 0;
bool retval = false;
bool possible;
switch (property_id) {
case CV_CAP_PROP_FRAME_WIDTH:
+ {
+ int& width = capture->width_set;
+ int& height = capture->height_set;
width = cvRound(value);
retval = width != 0;
if(width !=0 && height != 0) {
retval = v4l2_reset(capture);
width = height = 0;
}
- break;
+ }
+ break;
case CV_CAP_PROP_FRAME_HEIGHT:
+ {
+ int& width = capture->width_set;
+ int& height = capture->height_set;
height = cvRound(value);
retval = height != 0;
if(width !=0 && height != 0) {
retval = v4l2_reset(capture);
width = height = 0;
}
- break;
+ }
+ break;
case CV_CAP_PROP_FPS:
capture->fps = value;
retval = v4l2_reset(capture);