IMFStreamSink::ProcessSample method

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

Syntax

HRESULT ProcessSample(
  IMFSample *pSample
);

Parameters

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 presenation 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

   
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