IMFSourceReaderCallback::OnReadSample method (mfreadwrite.h)

Called when the IMFSourceReader::ReadSample method completes.

Syntax

HRESULT OnReadSample(
  [in] HRESULT   hrStatus,
  [in] DWORD     dwStreamIndex,
  [in] DWORD     dwStreamFlags,
  [in] LONGLONG  llTimestamp,
  [in] IMFSample *pSample
);

Parameters

[in] hrStatus

The status code. If an error occurred while processing the next sample, this parameter contains the error code.

[in] dwStreamIndex

The zero-based index of the stream that delivered the sample.

[in] dwStreamFlags

A bitwise OR of zero or more flags from the MF_SOURCE_READER_FLAG enumeration.

[in] llTimestamp

The time stamp of the sample, or the time of the stream event indicated in dwStreamFlags. The time is given in 100-nanosecond units.

[in] pSample

A pointer to the IMFSample interface of a media sample. This parameter might be NULL.

Return value

Returns an HRESULT value. Currently, the source reader ignores the return value.

Remarks

The pSample parameter might be NULL. For example, when the source reader reaches the end of a stream, dwStreamFlags contains the MF_SOURCE_READERF_ENDOFSTREAM flag, and pSample is NULL.

If there is a gap in the stream, dwStreamFlags contains the MF_SOURCE_READERF_STREAMTICK flag, pSample is NULL, and llTimestamp indicates the time when the gap occurred.

This interface is available on Windows Vista if Platform Update Supplement for Windows Vista is installed.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista and Platform Update Supplement for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header mfreadwrite.h

See also

IMFSourceReaderCallback

Source Reader