共用方式為


IMFExtendedCameraControl::CommitSettings 方法 (mfidl.h)

將設定的控制項設定認可至相機驅動程式。

Syntax

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