IMFSourceReader::Flush method (mfreadwrite.h)

Flushes one or more streams.

Syntax

HRESULT Flush(
  DWORD dwStreamIndex
);

Parameters

dwStreamIndex

The stream to flush. The value can be any of the following.

Value Meaning
0–0xFFFFFFFB
The zero-based index of a stream.
MF_SOURCE_READER_FIRST_VIDEO_STREAM
0xFFFFFFFC
The first video stream.
MF_SOURCE_READER_FIRST_AUDIO_STREAM
0xFFFFFFFD
The first audio stream.
MF_SOURCE_READER_ALL_STREAMS
0xFFFFFFFE
All streams.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The Flush method discards all queued samples and cancels all pending sample requests.

This method can complete either synchronously or asynchronously.

If you provide a callback pointer when you create the source reader, the method is asynchronous. Otherwise, the method is synchronous. For more information about the setting the callback pointer, see MF_SOURCE_READER_ASYNC_CALLBACK.

In synchronous mode, the method blocks until the operation is complete.

In asynchronous mode, the application's IMFSourceReaderCallback::OnFlush method is called when the flush operation completes. While a flush operation is pending, the IMFSourceReader::ReadSample method returns MF_E_NOTACCEPTING.

Note  In Windows 7, there was a bug in the implementation of this method, which causes OnFlush to be called before the flush operation completes. A hotfix is available that fixes this bug. For more information, see http://support.microsoft.com/kb/979567.
 
This interface is available on Windows Vista if Platform Update Supplement for Windows Vista is installed.

Requirements

   
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

IMFSourceReader

Source Reader