Compartilhar via


IAMTimelineSrc::SetMediaTimes

 
Microsoft DirectShow 9.0

IAMTimelineSrc::SetMediaTimes

The SetMediaTimes method sets the media stop and start times.

Syntax

  HRESULT SetMediaTimes(
    REFERENCE_TIME Start,
    REFERENCE_TIME Stop
);

Parameters

Start

Media start time, in 100-nanosecond units.

Stop

Media stop time, in 100-nanosecond units.

Return Value

Returns S_OK.

Remarks

The media times are the stop and start times relative to the original media file. Always set the media times when you add a video or audio source to the timeline. Otherwise, rendering problems might occur. The stop time must be greater than the start time.

To use a still frame from a video source, set the stop time to a fractional amount more than the start time, such as 100 nanoseconds. Setting them to the same value causes a rendering error.

If the timeline duration does not match the media duration, the source stretches or shrinks accordingly. This causes the clip to play slower or faster than the authored rate. (Pitch shifting will occur in an audio source.) For more information, see Time in DirectShow Editing Services.

You can specify the duration of the source file by calling the SetMediaLength method. If you set a media stop time that exceeds the duration, DES truncates the stop time.

Requirements

Header: Include Qedit.h. This header file is not compatible with Microsoft® Direct3D® headers later than version 7.

Library: Use strmiids.lib.

See Also