IMFCaptureSink::Prepare method (mfcaptureengine.h)

Prepares the capture sink by loading any required pipeline components, such as encoders, video processors, and media sinks.

Syntax

HRESULT Prepare();

Return value

This method can return one of these values.

Return code Description
S_OK
Success.
MF_E_INVALIDREQUEST
Invalid request.

Remarks

Calling this method is optional. This method gives the application an opportunity to configure the pipeline components before they are used. The method is asynchronous. If the method returns a success code, the caller will receive an MF_CAPTURE_SINK_PREPARED event through the IMFCaptureEngineOnEventCallback::OnEvent method. After this event is received, call IMFCaptureSink::GetService to configure individual components.

Before calling this method, configure the capture sink by adding at least one stream. To add a stream, call IMFCaptureSink::AddStream.

The Prepare method fails if the capture sink is currently in use. For example, calling Prepare on the preview sink fails if the capture engine is currently previewing.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header mfcaptureengine.h

See also

IMFCaptureSink