共用方式為


PIPELINE_TIME

The PIPELINE_TIME class describes either a frame presentation time or the duration of a transition or effect. You should not need to create the class or modify its values, but you should know how to read values from it. This section covers only the basic information you need to know to get data from a PIPELINE_TIME object. If you need more details on the class, you can examine the class definition in PipelineTime.h.

PIPELINE_TIME objects can store data in two formats: absolute time (fractions of a second), and frame rate (frames per second).

  • Absolute time objects typically describe a clip duration or a presentation time.
  • Frame rate objects typically describe frames to be rendered. This object includes a frame rate and frame number of the current frame. This format is used to describe TIME_INFO parameters, and is not normally used by video transforms.

A PIPELINE_TIME object that stores information in absolute time can report information in both time and frame rate. A PIPELINE_TIME object that stores information in frame rate can report information only in frame rate. You can determine what type of object this is by calling its IsFrameCount function, which returns a Boolean value indicating whether it is a frame rate object.

The PIPELINE_TIME class defines the following two data types you will use:

REFERENCE_TIME

A LONGLONG value that describes a time in 100-nanosecond units.

FRAMERATE

A structure with the following syntax:

wFrames

The number of frames in the number of milliseconds given by wMilliSecond.

wMilliSecond

The number of milliseconds in which to present the number of frames given by wFrames.

The frame rate is expressed in wFrames frames per wMilliSecond milliseconds. For example, if a FRAMERATE had a wFrames value of 30 and a wMilliSecond value of 1000, it would be equal to 30/1000, or 30 frames per second.

To access the value in a PIPELINE_TIME object, you must use the following functions.

Syntax Description
REFERENCE_TIME 
ToReferenceTime()
Returns a time, in 100-nanosecond units.
DWORD ToMilliSecond() const 
Returns a time, in milliseconds.
FRAMERATE FrameRate() const  
Returns a FRAMERATE structure giving the frame rate.
bool 
IsFrameCount() const
Returns a Boolean value that indicates whether this is a frame rate object. True indicates a frame rate object, and False indicates a time object.
PIPELINE_TIME NextFrame() const
Returns a PIPELINE_TIME object that represents the next frame, at the current rate.
PIPELINE_TIME PrevFrame() const
Returns a PIPELINE_TIME object that represents the previous frame, at the current rate.
int 
FrameCount() const
Returns the frame number of the current object.

The PIPELINE_TIME object overloads the following operators that enable you to assign, increment, decrement, and compare PIPELINE_TIME objects.

Requirements

Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Header
GPUPipelineTime.h (include Gputransformplugin.h)

See also

Classes