Microsoft DirectX 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 Value

Returns an HRESULT value. Possible values include the following.

Value 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.

See Also