IMediaSeeking::SetTimeFormat

 
Microsoft DirectShow 9.0

IMediaSeeking::SetTimeFormat

The SetTimeFormat method sets the time format for subsequent seek operations.

Syntax

  HRESULT SetTimeFormat(
  const GUID *pFormat
);

Parameters

pFormat

[in] Pointer to a GUID that specifies the time format. See Time Format GUIDs.

Return Values

Returns an HRESULT value. Possible values include the following.

Return code Description
S_OK Success.
E_INVALIDARG Invalid argument.
E_NOTIMPL Method is not supported.
E_POINTER NULL pointer argument.
VFW_E_WRONG_STATE Filter graph is not stopped.

Remarks

This method specifies the time units used by other IMediaSeeking methods, such as IMediaSeeking::GetPositions and IMediaSeeking::SetPositions. Whenever you call one of these other methods, any parameters that express time values are given in units of the current time format.

The default time format is REFERENCE_TIME units (100 nanoseconds). Other time formats include frames, samples, and bytes. To determine if a given format is supported, call the IMediaSeeking::IsFormatSupported method. If a format is supported, you can switch to that format by calling SetTimeFormat. Only one time format is active at any one time.

Requirements

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also