IMFMediaSource::Pause method

Pauses all active streams in the media source.

Syntax

HRESULT Pause();

Parameters

This method has no parameters.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
MF_E_INVALID_STATE_TRANSITION
Invalid state transition. The media source must be in the started state.
MF_E_SHUTDOWN
The media source's Shutdown method has been called.

Remarks

This method is asynchronous. When the operation completes, the media source sends and MESourcePaused event, and every active stream sends an MEStreamPaused event. If the method returns a failure code, no events are raised.

The media source must be in the started state. The method fails if the media source is paused or stopped.

While the source is paused, calls to IMFMediaStream::RequestSample succeed, but the streams will not deliver any samples until after the source is started again. Note that the source's event queue is not serialized with the stream event queues, so the client might receive some samples after the MESourcePaused event, due to multi-threading issues. But the client will not receive any samples from a stream after the MEStreamPaused event.

Not every media source can pause. If a media source can pause, the IMFMediaSource::GetCharacteristics method returns the MFMEDIASOURCE_CAN_PAUSE flag.

Requirements

   
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header mfidl.h
Library Mfuuid.lib

See also

IMFMediaSource

Media Sources