Skip to content

Latest commit

 

History

History
83 lines (69 loc) · 2.52 KB

nf-mfidl-imfextendedcameracontrol-getflags.md

File metadata and controls

83 lines (69 loc) · 2.52 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.GetFlags
IMFExtendedCameraControl::GetFlags
11/4/2019
Windows
Queries for property flags on the capture device.
mf
function
mfidl.h
Windows 10 Build 20348
Windows 10 Build 20348
apiref
COM
mfidl.h
IMFExtendedCameraControl::GetFlags
IMFExtendedCameraControl::GetFlags
mfidl/IMFExtendedCameraControl::GetFlags
c++

-description

Queries for property flags on the capture device.

-returns

A ULONGLONG mapping to property flags. Supported properties and flags are defined in the header file defined in ksmedia.h as constants with the naming convention KSCAMERA_EXTENDEDPROP_. For more information, see KSPROPERTYSETID_ExtendedCameraControl.

-remarks

Set the property flags on the capture device by calling IMFExtendedCameraControl::SetFlags. Before setting a property flag, you can check for supported capabilities by calling IMFExtendedCameraControl::GetCapabilities. The following example demonstrates querying support for the KSCAMERA_EXTENDEDPROP_VIDEOTORCH_ON capability.

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