Muokkaa

Jaa


IAMTimelineObj::SetStartStop method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

Note

[Deprecated. This API may be removed from future releases of Windows.]

 

The SetStartStop method sets the object's start and stop times, relative to the object's parent.

Syntax

HRESULT SetStartStop(
   REFERENCE_TIME Start,
   REFERENCE_TIME Stop
);

Parameters

Start

New start time, in 100-nanosecond units, or –1 to keep the existing start time.

Stop

New stop time, in 100-nanosecond units, or –1 to keep the existing stop time.

Return value

Returns one of the following HRESULT values:

Return code Description
S_OK
Success.
E_INVALIDARG
Invalid argument.
E_NOTIMPL
Not implemented.

 

Remarks

Tracks, compositions, and groups do not implement this method. For these objects, the start time is always zero, and the stop time is the maximum stop time of the objects they contain.

Do not set overlapping times on source objects within the same track. Doing so can cause undefined behaviors.

For source objects, the start and stop times are independent of the media start and media stop times. Changing one pair of values does not change the other. To set the media start and stop times, call the IAMTimelineSrc::SetMediaTimes method. For more information, see Time in DirectShow Editing Services.

To get frame-accurate cuts and transitions, set the Start and Stop parameters to frame boundaries. You can use the IAMTimelineObj::FixTimes method to convert a time value into the nearest frame boundary, or use the following function to convert from frame number to reference time:

REFERENCE_TIME inline FrameNumToTime(LONGLONG frame, double fps)
{
    double dt = (frame * 10000000 / fps);
    if (frame >= 0) 
    {
        dt += 0.5;    }
    else
    {
        dt -= 0.5;
    }
    return (REFERENCE_TIME)dt;
}

Note

The header file Qedit.h is not compatible with Direct3D headers later than version 7.

 

Note

To obtain Qedit.h, download the Microsoft Windows SDK Update for Windows Vista and .NET Framework 3.0. Qedit.h is not available in the Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1.

 

Requirements

Requirement Value
Header
Qedit.h
Library
Strmiids.lib

See also

IAMTimelineObj Interface

Error and Success Codes