Export (0) Print
Expand All

IMFSeekInfo::GetNearestKeyFrames method

For a particular seek position, gets the two nearest key frames.

Syntax


HRESULT GetNearestKeyFrames(
  [in]   const GUID *pguidTimeFormat,
  [in]   const PROPVARIANT *pvarStartPosition,
  [out]  PROPVARIANT *pvarPreviousKeyFrame,
  [out]  PROPVARIANT *pvarNextKeyFrame
);

Parameters

pguidTimeFormat [in]

A pointer to a GUID that specifies the time format. The time format defines the units for the other parameters of this method. If the value is GUID_NULL, the time format is 100-nanosecond units. Some media sources might support additional time format GUIDs.

pvarStartPosition [in]

The seek position. The units for this parameter are specified by pguidTimeFormat.

pvarPreviousKeyFrame [out]

Receives the position of the nearest key frame that appears earlier than pvarStartPosition. The units for this parameter are specified by pguidTimeFormat.

pvarNextKeyFrame [out]

Receives the position of the nearest key frame that appears earlier than pvarStartPosition. The units for this parameter are specified by pguidTimeFormat.

Return value

This method can return one of these values.

Return codeDescription
S_OK

The method succeeded.

MF_E_UNSUPPORTED_TIME_FORMAT

The time format specified in pguidTimeFormat is not supported.

 

Remarks

If an application seeks to a non–key frame, the decoder must start decoding from the previous key frame. This can increase latency, because several frames might get decoded before the requested frame is reached. To reduce latency, an application can call this method to find the two key frames that are closest to the desired time, and then seek to one of those key frames.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Mfidl.h

See also

IMFSeekInfo

 

 

Community Additions

ADD
Show:
© 2014 Microsoft