IMFVirtualCamera::CreateSyncSemaphore method (mfvirtualcamera.h)

A wrapper around the IKsControl::KsEvent method, which enables or disables an semaphore.

Syntax

HRESULT CreateSyncSemaphore(
  REFGUID             kseventSet,
  ULONG               kseventId,
  ULONG               kseventFlags,
  HANDLE              semaphoreHandle,
  LONG                semaphoreAdjustment,
  IMFCameraSyncObject **cameraSyncObject
);

Parameters

kseventSet

A GUID representing the KSEVENT.Set field.

kseventId

A ULONG representing the KSEVENT.Id field.

kseventFlags

A set of bit-wise or-ed flags representing the KSEVENT.Flags field.

semaphoreHandle

A handle representing the KSEVENTDATA.SemaphoreHandle.Semaphore field.

semaphoreAdjustment

An adjustment value representing the KSEVENTDATA.SemaphoreHandle.Adjustment field.

cameraSyncObject

An output parameter that receives an IMFSyncObject interface. The caller is responsible for releasing this object.

Return value

Returns an HRESULT value, including but not limited to the following values:

Error code Description
S_OK Succeeded

Remarks

This method allows the caller to create a semaphore object between the caller and the virtual camera for synchronization. The virtual camera implementation will receive a call to IKsControl::KsEvent when this API is called. The resulting IMFCameraSyncObject can be used to block on the event from the virtual camera.

When the IMFCameraSyncObject is obtained, the caller may choose to use the IMFCameraSyncObject::WaitOnSignal method or call WaitForSingleObject or WaitForMultipleObjects on the HANDLE that was provided to the CreateSyncObject method. The caller must not wait on both, as the signal on the event may only be set once by the driver.

The caller must call IMFCameraSyncObject::Shutdown when the synchronization object is no longer needed regardless of whether the wait operation succeeded or not.

Requirements

   
Minimum supported client Windows Build 22000
Header mfvirtualcamera.h
Library mfsensorgroup.lib
DLL mfsensorgroup.dll

See also

IKsControl::KsEvent

IMFCameraSyncObject

IMFCameraSyncObject::WaitOnSignal

WaitForSingleObject

WaitForMultipleObjects