IMFVirtualCamera::Start method (mfvirtualcamera.h)

Creates and registers the virtual camera.

Syntax

HRESULT Start(
  IMFAsyncCallback *pCallback
);

Parameters

pCallback

Optional pointer to an IMFAsyncCallback object that the pipeline will use to notify the caller of the state of the virtual camera. The callback, if provided, may be invoked with a IMFMediaEvent. When invoked, the IMFMediaEvent::GetType method will return an MEExtendedType or an MEError. If an MEExtendedType is returned, the IMFMediaEvent::GetExtendedType method may return one of the following event types:

Extended event type Description
MF_FRAMESERVER_VCAMEVENT_EXTENDED_SOURCE_INITIALIZE The custom media source representing the virtual camera was initialized by an application.
MF_FRAMESERVER_VCAMEVENT_EXTENDED_SOURCE_START A stream (or streams) on the virtual camera’s custom media source was started by an application.
MF_FRAMESERVER_VCAMEVENT_EXTENDED_SOURCE_STOP All streams on the virtual camera’s custom media source were stopped by the application.
MF_FRAMESERVER_VCAMEVENT_EXTENDED_SOURCE_UNINITIALIZE The virtual camera’s custom media source was uninitialized.
MF_FRAMESERVER_VCAMEVENT_EXTENDED_PIPELINE_SHUTDOWN The virtual camera’s pipeline was shutdown.
MF_FRAMESERVER_VCAMEVENT_EXTENDED_CUSTOM_EVENT A custom event was generated by the virtual camera’s custom media source. The schema for the IMFMediaEvent is vendor specific.

The callback may be called at any time after the IMFVirtualCamera::Start has successfully returned.

Return value

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

Error code Description
S_OK Succeeded
E_INVALIDARG An input parameter is invalid.

Remarks

Until a successful call to the Start method has been made, the IMFVirtualCamera represents the virtual camera configuration information and the underlying virtual camera does not yet exist - unless the MFCreateVirtualCamera is re-opening an existing virtual camera. Once Start has been called successfully, the IMFAttributes that IMFVirtualCamera inherits from will contain the newly created virtual camera’s symbolic link name, MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK.

If MFCreateVirtualCamera is called with the same parameters as a prior call, specifying a IMFVirtualCamera that was already started with a successful call to IMFVirtualCamera::Start, the result IMFVirtualCamera is already in a valid state and subsequent calls to IMFVirtualCamera::Start may be used to register new callbacks.

Requirements

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

See also

IMFAsyncCallback

IMFMediaEvent

MFCreateVirtualCamera