Export (0) Print
Expand All

IMFRateControl::SetRate method

Sets the playback rate.

Syntax


HRESULT SetRate(
  [in]  BOOL fThin,
  [in]  float flRate
);

Parameters

fThin [in]

If TRUE, the media streams are thinned. Otherwise, the stream is not thinned. For media sources and demultiplexers, the object must thin the streams when this parameter is TRUE. For downstream transforms, such as decoders and multiplexers, this parameter is informative; it notifies the object that the input streams are thinned. For information, see About Rate Control.

flRate [in]

The requested playback rate. Postive values indicate forward playback, negative values indicate reverse playback, and zero indicates scrubbing (the source delivers a single frame).

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codeDescription
S_OK

The method succeeded.

MF_E_REVERSE_UNSUPPORTED

The object does not support reverse playback.

MF_E_THINNING_UNSUPPORTED

The object does not support thinning.

MF_E_UNSUPPORTED_RATE

The object does not support the requested playback rate.

MF_E_UNSUPPORTED_RATE_TRANSITION

The object cannot change to the new rate while in the running state.

 

Remarks

The Media Session prevents some transitions between rate boundaries, depending on the current playback state:

Playback StateForward/ReverseForward/ZeroReverse/Zero
RunningNoNoNo
PausedNoYesNo
StoppedYesYesYes

 

If the transition is not supported, the method returns MF_E_UNSUPPORTED_RATE_TRANSITION.

When a media source completes a call to SetRate, it sends the MESourceRateChanged event. Other pipeline components do not send this event.

If a media source switches between thinned and non-thinned playback, the streams send an MEStreamThinMode event to indicate the transition. Events from the media source are not synchronized with events from the media streams. After you receive the MESourceRateChanged event, you can still receive samples that were queued before the stream switched to thinned or non-thinned mode. The MEStreamThinMode event marks the exact point in the stream where the transition occurs.

When the Media Session completes a call to SetRate, it sends the MESessionRateChanged event.

Requirements

Minimum supported client

Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Mfidl.h

Library

Mfuuid.lib

See also

How to Set the Playback Rate on the Media Session
IMFRateControl

 

 

Community Additions

ADD
Show:
© 2014 Microsoft