IAVIStream::FindSample

The FindSample method obtains the position in a stream of a key frame or a nonempty frame. Called when an application uses the AVIStreamFindSample function.

LONG FindSample(
  PAVISTREAM ps,  
  LONG lPos,      
  LONG lFlags     
);

Parameters

ps

Pointer to the interface to a stream.

lPos

Position of the sample or frame.

lFlags

Applicable flags. The following values are defined.

Value Description
FIND_ANY Searches for a nonempty frame.
FIND_FORMAT Searches for a format change.
FIND_KEY Searches for a key frame.
FIND_NEXT Searches forward through a stream, beginning with the current frame.
FIND_PREV Searches backward through a stream, beginning with the current frame.

The FIND_ANY, FIND_KEY, and FIND_FORMAT flags are mutually exclusive, as are the FIND_NEXT and FIND_PREV flags. You must specify one value from each group.

Return Values

Returns the location of the key frame corresponding to the frame specified by the application.

Remarks

If key frames are not significant in your custom format, return the position specified for lPos.

For handlers written in C++, FindSample has the following syntax:

LONG FindSample(LONG lPos, LONG lFlags) 
 

Requirements

**  Windows NT/2000/XP:** Included in Windows NT 3.1 and later.
**  Windows 95/98/Me:** Included in Windows 95 and later.
**  Header:** Declared in Vfw.h.
**  Library:** Use Vfw32.lib.

See Also

Custom File and Stream Handlers, Custom File and Stream Handler Interfaces, AVIStreamFindSample