|
|
@ -322,6 +322,8 @@ struct CvCaptureCAM_V4L : public CvCapture |
|
|
|
return focus; |
|
|
|
return focus; |
|
|
|
case CV_CAP_PROP_AUTOFOCUS: |
|
|
|
case CV_CAP_PROP_AUTOFOCUS: |
|
|
|
return Range(0, 1); |
|
|
|
return Range(0, 1); |
|
|
|
|
|
|
|
case CV_CAP_PROP_AUTO_EXPOSURE: |
|
|
|
|
|
|
|
return Range(0, 4); |
|
|
|
default: |
|
|
|
default: |
|
|
|
return Range(0, 255); |
|
|
|
return Range(0, 255); |
|
|
|
} |
|
|
|
} |
|
|
@ -512,7 +514,7 @@ static void v4l2_control_range(CvCaptureCAM_V4L* cap, __u32 id) |
|
|
|
case V4L2_CID_GAIN: |
|
|
|
case V4L2_CID_GAIN: |
|
|
|
cap->gain = range; |
|
|
|
cap->gain = range; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case V4L2_CID_EXPOSURE: |
|
|
|
case V4L2_CID_EXPOSURE_ABSOLUTE: |
|
|
|
cap->exposure = range; |
|
|
|
cap->exposure = range; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case V4L2_CID_FOCUS_ABSOLUTE: |
|
|
|
case V4L2_CID_FOCUS_ABSOLUTE: |
|
|
@ -1557,8 +1559,10 @@ static inline __u32 capPropertyToV4L2(int prop) { |
|
|
|
return V4L2_CID_HUE; |
|
|
|
return V4L2_CID_HUE; |
|
|
|
case CV_CAP_PROP_GAIN: |
|
|
|
case CV_CAP_PROP_GAIN: |
|
|
|
return V4L2_CID_GAIN; |
|
|
|
return V4L2_CID_GAIN; |
|
|
|
|
|
|
|
case CV_CAP_PROP_AUTO_EXPOSURE: |
|
|
|
|
|
|
|
return V4L2_CID_EXPOSURE_AUTO; |
|
|
|
case CV_CAP_PROP_EXPOSURE: |
|
|
|
case CV_CAP_PROP_EXPOSURE: |
|
|
|
return V4L2_CID_EXPOSURE; |
|
|
|
return V4L2_CID_EXPOSURE_ABSOLUTE; |
|
|
|
case CV_CAP_PROP_AUTOFOCUS: |
|
|
|
case CV_CAP_PROP_AUTOFOCUS: |
|
|
|
return V4L2_CID_FOCUS_AUTO; |
|
|
|
return V4L2_CID_FOCUS_AUTO; |
|
|
|
case CV_CAP_PROP_FOCUS: |
|
|
|
case CV_CAP_PROP_FOCUS: |
|
|
@ -1645,6 +1649,9 @@ static double icvGetPropertyCAM_V4L (const CvCaptureCAM_V4L* capture, |
|
|
|
case CV_CAP_PROP_GAIN: |
|
|
|
case CV_CAP_PROP_GAIN: |
|
|
|
fprintf (stderr, "Gain"); |
|
|
|
fprintf (stderr, "Gain"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case CV_CAP_PROP_AUTO_EXPOSURE: |
|
|
|
|
|
|
|
fprintf (stderr, "Auto Exposure"); |
|
|
|
|
|
|
|
break; |
|
|
|
case CV_CAP_PROP_EXPOSURE: |
|
|
|
case CV_CAP_PROP_EXPOSURE: |
|
|
|
fprintf (stderr, "Exposure"); |
|
|
|
fprintf (stderr, "Exposure"); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -1704,6 +1711,13 @@ static bool icvSetControl (CvCaptureCAM_V4L* capture, |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(control.id == V4L2_CID_EXPOSURE_AUTO && control.value == V4L2_EXPOSURE_MANUAL) { |
|
|
|
|
|
|
|
// update the control range for expose after disabling autoexposure
|
|
|
|
|
|
|
|
// as it is not read correctly at startup
|
|
|
|
|
|
|
|
// TODO check this again as it might be fixed with Linux 4.5
|
|
|
|
|
|
|
|
v4l2_control_range(capture, V4L2_CID_EXPOSURE_ABSOLUTE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* all was OK */ |
|
|
|
/* all was OK */ |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|