Skip to content

Latest commit

 

History

History
83 lines (69 loc) · 1.97 KB

nf-mfidl-imfextendedcameracontrol-commitsettings.md

File metadata and controls

83 lines (69 loc) · 1.97 KB
UID title ms.date targetos description tech.root req.assembly req.construct-type req.ddi-compliance req.dll req.header req.idl req.include-header req.irql req.kmdf-ver req.lib req.max-support req.namespace req.redist req.target-min-winverclnt req.target-min-winversvr req.target-type req.type-library req.umdf-ver req.unicode-ansi topic_type api_type api_location api_name f1_keywords dev_langs
NF:mfidl.IMFExtendedCameraControl.CommitSettings
IMFExtendedCameraControl::CommitSettings
11/4/2019
Windows
Commits the configured control settings to the camera driver.
mf
function
mfidl.h
Windows 10 Build 20348
Windows 10 Build 20348
apiref
COM
mfidl.h
IMFExtendedCameraControl::CommitSettings
IMFExtendedCameraControl::CommitSettings
mfidl/IMFExtendedCameraControl::CommitSettings
c++

-description

Commits the configured control settings to the camera driver.

-returns

Returns S_OK on success.

-remarks

The following example demonstrates setting the KSCAMERA_EXTENDEDPROP_VIDEOTORCH_ON flag and committing the setting.

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());
    }
}

-see-also