IMFStreamSink::ProcessSample method (mfidl.h)

Delivers a sample to the stream. The media sink processes the sample.

Syntax

HRESULT ProcessSample(
  [in] IMFSample *pSample
);

Parameters

[in] pSample

Pointer to the IMFSample interface of a sample that contains valid data for the stream.

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
The media sink is in the wrong state to receive a sample. For example, preroll is complete but the presentation clock has not started yet.
MF_E_INVALID_TIMESTAMP
The sample has an invalid time stamp. See Remarks.
MF_E_INVALIDREQUEST
The media sink is paused or stopped and cannot process the sample.
MF_E_NO_CLOCK
The presentation clock was not set. Call IMFMediaSink::SetPresentationClock.
MF_E_NO_SAMPLE_TIMESTAMP
The sample does not have a time stamp.
MF_E_NOT_INITIALIZED
The stream sink has not been initialized.
MF_E_SHUTDOWN
The media sink's Shutdown method has been called.
MF_E_STREAMSINK_REMOVED
This stream was removed from the media sink and is no longer valid.

Remarks

Call this method when the stream sink sends an MEStreamSinkRequestSample event.

This method can return MF_E_INVALID_TIMESTAMP for various reasons, depending on the implementation of the media sink:

  • Negative time stamps.
  • Time stamps that jump backward (within the same stream).
  • The time stamps for one stream have drifted too far from the time stamps on another stream within the same media sink (for example, an archive sink that multiplexes the streams).
Not every media sink returns an error code in these situations.

Requirements

Requirement Value
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

IMFStreamSink

Media Sinks