IMFExtendedCameraControl::CommitSettings 方法 (mfidl.h)
将配置的控件设置提交到相机驱动程序。
语法
HRESULT CommitSettings();
返回值
如果成功,则返回 S_OK。
注解
以下示例演示如何设置 KSCAMERA_EXTENDEDPROP_VIDEOTORCH_ON 标志并提交设置。
if (FAILED(m_cameraController->GetExtendedCameraControl(MF_CAPTURE_ENGINE_MEDIASOURCE,
KSPROPERTY_CAMERACONTROL_EXTENDED_TORCHMODE,
cameraControl.put())))
{
// Return false to indicate that the Torch Mode control is not available.
return false;
}
ULONGLONG capabilities = cameraControl->GetCapabilities();
// Check if the torch can be turned on.
if (capabilities & KSCAMERA_EXTENDEDPROP_VIDEOTORCH_ON)
{
// Check if the torch is off.
if ((cameraControl->GetFlags() & KSCAMERA_EXTENDEDPROP_VIDEOTORCH_ON) == 0)
{
// Torch is off. Tell the camera to turn it on.
check_hresult(cameraControl->SetFlags(KSCAMERA_EXTENDEDPROP_VIDEOTORCH_ON));
// Write the changed settings to the driver.
check_hresult(cameraControl->CommitSettings());
}
}
要求
最低受支持的客户端 | Windows 10内部版本 20348 |
最低受支持的服务器 | Windows 10内部版本 20348 |
标头 | mfidl.h |