Export (0) Print
Expand All

IAsyncReader::WaitForNext method

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

Syntax


HRESULT WaitForNext(
  [in]   DWORD dwTimeout,
  [out]  IMediaSample **ppSample,
  [out]  DWORD_PTR *pdwUser
);

Parameters

dwTimeout [in]

Specifies a time-out in milliseconds. Use the value INFINITE to wait indefinitely

ppSample [out]

Address of a variable that receives an IMediaSample interface pointer.

pdwUser [out]

Pointer to a variable that receives the value of the dwUser parameter specified in the IAsyncReader::Request method.

Return value

Returns an HRESULT value. Possible values include the following.

Return codeDescription
VFW_E_TIMEOUT

The time-out expired, or the pin is flushing.

VFW_E_WRONG_STATE

The pin is flushing.

E_FAIL

A read error occurred.

S_OK

Success.

S_FALSE

Reached the end of the file; retrieved fewer bytes than requested.

 

Remarks

If the method succeeds, the ppSample parameter contains a pointer to a media sample, whose buffer holds the requested data. Call the IMediaSample::GetTime method and divide the results by 10,000,000 to determine the start and stop bytes. Samples may be returned out of order. Release the sample when you are finished processing the data.

The method fails if the pin is flushing. However, it may return an empty sample in ppSample. If *ppSample is non-NULL, release the sample and discard it. For more information, see IAsyncReader::BeginFlush.

If a read error occurs, the source filter sends an error event to the Filter Graph Manager; the caller does not have to signal an error.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Strmif.h (include Dshow.h)

Library

Strmiids.lib

See also

Error and Success Codes
IAsyncReader Interface

 

 

Community Additions

ADD
Show:
© 2014 Microsoft