Media Foundation 控制摄像头属性
原文链接http://blogs.microsoft.co.il/pavely/2012/05/19/windows-media-foundation-controlling-camera-properties/
原文链接
//示例
HRESULT SetupCamera(IMFMediaSource* pCameraSource)
{
CComQIPtr<IAMCameraControl> spCameraControl(pCameraSource);
HRESULT hr = S_OK;
if (spCameraControl) {
long min, max, step, def, control;
hr = spCameraControl->GetRange(CameraControl_Exposure, &min, &max, &step, &def, &control);
if (SUCCEEDED(hr))
{
hr = spCameraControl->Set(CameraControl_Exposure, max, CameraControl_Flags_Manual);
}
}
CComQIPtr<IAMVideoProcAmp> spVideo(pCameraSource);
if (spVideo)
hr = spVideo->Set(VideoProcAmp_WhiteBalance, 0, VideoProcAmp_Flags_Auto);
return hr;
}