IAsyncReader interface (strmif.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The IAsyncReader interface performs an asynchronous data request on a filter.

This interface is exposed by output pins that perform asynchronous read operations. The interface is used by the input pin on the downstream filter. Applications do not use this interface. The Async File Source filter exposes this interface on its output pin.

Filter developers: Implement this interface if your output pin delivers data in the form of a byte stream (MEDIATYPE_Stream) and supports the pull model. During the connection process, check whether the downstream pin queries for the IAsyncReader interface. If it does not, your pin should either fail the connection or establish some other transport. (If your pin derives from CBasePin, perform this check in the CBasePin::CheckConnect method.)

For more information about using this interface, see the following topics:

Inheritance

The IAsyncReader interface inherits from the IUnknown interface. IAsyncReader also has these types of members:

Methods

The IAsyncReader interface has these methods.

 
IAsyncReader::BeginFlush

The BeginFlush method begins a flush operation. (IAsyncReader.BeginFlush)
IAsyncReader::EndFlush

The EndFlush method ends a flush operation. (IAsyncReader.EndFlush)
IAsyncReader::Length

The Length method retrieves the total length of the stream.
IAsyncReader::Request

The Request method queues an asynchronous request for data.
IAsyncReader::RequestAllocator

The RequestAllocator method requests an allocator during the pin connection.
IAsyncReader::SyncRead

The SyncRead method performs a synchronous read. The method blocks until the request is completed. The file positions and the buffer address do not have to be aligned. If the request is not aligned, the method performs a buffered read operation.
IAsyncReader::SyncReadAligned

The SyncReadAligned method performs a synchronous read. The method blocks until the request is completed. The file positions and the buffer address must be aligned; check the allocator properties for the required alignment.
IAsyncReader::WaitForNext

The WaitForNext method waits for the next pending read request to complete.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)