Microsoft DirectX 8.1 (C++) |
The IMediaSeeking interface supports several time formats, including media time (in 100-nanosecond units), video frames, and byte offsets within the stream. Each time format is defined by a globally unique identifier (GUID). For a list of the time formats that DirectShow defines, see Time Format GUIDs. Third parties can also define GUIDs for custom time formats.
The filter graph manager defaults to media time. To use another time format, call the IMediaSeeking::SetTimeFormat method. If the method succeeds, all subsequent seek commands use the new format. To determine whether the media stream supports a given time format, call the IMediaSeeking::IsFormatSupported method. The following example sets the time format to frames and stores the result in a Boolean flag, for later use:
hr = pSeek->SetTimeFormat(&TIME_FORMAT_FRAME);
BOOL bTimeInFrames = SUCCEEDED(hr);