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;
}
本文介绍了如何通过Media Foundation API来控制和调整摄像头的各种属性,包括图像质量、分辨率等,适用于C++开发者。
1645

被折叠的 条评论
为什么被折叠?



