If that logitech webcam is a UVC compliant then with the help of DirectShow Interface IAMCameraControl you can programmatically disable the auto-focus of your webcam. A specific value can be set for the autofocus and can be set at any flags so that it doesnt works automatically. To poll current state you can use IAMCameraControl::Get since turning off the focus isnt supported by many cameras.
Code:
IAMCameraControl *pCameraControl;
HRESULT hr;
hr = pFilter->QueryInterface(IID_IAMCameraControl, (void **)&pCameraControl);
if (hr == S_OK) {
long defaultFocusValue; hr = pCameraControl->GetRange(CameraControl_Focus,
NULL, // min
NULL, // max
NULL, // minstep
&defaultFocusValue, // default
NULL); // capflags
hr = pCameraControl->Set(CameraControl_Focus, // property
defaultFocusValue, // value
CameraControl_Flags_Manual);
}
You can also use the System Device Enumerator for finding which one suits your camera by following the link here - http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
Bookmarks