Condividi tramite


Metodo IMFExtendedCameraControl::SetFlags (mfidl.h)

Imposta i flag per una proprietà nel dispositivo di acquisizione.

Sintassi

HRESULT SetFlags(
  ULONGLONG ulFlags
);

Parametri

ulFlags

Mapping ULONGLONG ai flag delle proprietà. Le proprietà e i flag supportati sono definiti nel file di intestazione definito in ksmedia.h come costanti con la convenzione di denominazione KSCAMERA_EXTENDEDPROP_. Per altre informazioni, vedere KSPROPERTYSETID_ExtendedCameraControl.

Valore restituito

Restituisce S_OK sull'esito positivo.

Commenti

Prima di impostare un flag di proprietà, è possibile verificare la presenza di funzionalità supportate chiamando FMExtendedCameraControl::GetCapabilities. Nell'esempio seguente viene illustrato il supporto delle query per la funzionalità di 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());
    }
}

Requisiti

   
Client minimo supportato Windows 10 Build 20348
Server minimo supportato Windows 10 Build 20348
Intestazione mfidl.h