MCPcopy Create free account
hub / github.com/cmauri/eviacam / getVideoSettingCamera

Method getVideoSettingCamera

creavision/videoInput.cpp:1251–1287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1249
1250
1251bool videoInput::getVideoSettingCamera(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue){
1252 if( !isDeviceSetup(deviceID) )return false;
1253
1254 HRESULT hr;
1255 bool isSuccessful = false;
1256
1257 videoDevice * VD = VDList[deviceID];
1258
1259 hr = getDevice(&VD->pVideoInputFilter, deviceID, VD->wDeviceName, VD->nDeviceName);
1260 if (FAILED(hr)){
1261 printf("setVideoSetting - getDevice Error\n");
1262 return false;
1263 }
1264
1265 IAMCameraControl *pIAMCameraControl = NULL;
1266
1267 hr = VD->pVideoInputFilter->QueryInterface(IID_IAMCameraControl, (void**)&pIAMCameraControl);
1268 if(FAILED(hr)){
1269 printf("setVideoSetting - QueryInterface Error\n");
1270 if(VD->pVideoInputFilter)VD->pVideoInputFilter->Release();
1271 if(VD->pVideoInputFilter)VD->pVideoInputFilter = NULL;
1272 return false;
1273 }
1274
1275 if (verbose) printf("Setting video setting %ld.\n", Property);
1276
1277 pIAMCameraControl->GetRange(Property, &min, &max, &SteppingDelta, &defaultValue, &flags);
1278 if (verbose) printf("Range for video setting %ld: Min:%ld Max:%ld SteppingDelta:%ld Default:%ld Flags:%ld\n", Property, min, max, SteppingDelta, defaultValue, flags);
1279 pIAMCameraControl->Get(Property, &currentValue, &flags);
1280
1281 if(pIAMCameraControl)pIAMCameraControl->Release();
1282 if(VD->pVideoInputFilter)VD->pVideoInputFilter->Release();
1283 if(VD->pVideoInputFilter)VD->pVideoInputFilter = NULL;
1284
1285 return true;
1286
1287}
1288
1289
1290// ----------------------------------------------------------------------

Callers

nothing calls this directly

Calls 2

QueryInterfaceMethod · 0.80
ReleaseMethod · 0.80

Tested by

no test coverage detected