Share via


PIPELINE_TIME Class

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:

typedef struct stcFRAMERATE
{
   WORD wFrames;
   WORD wMilliSecond;
} FRAMERATE;

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.

Operators

Left value Operator Right value Description
FRAMERATE == FRAMERATE Returns True if both members of the FRAMERATE structures are equal; otherwise, returns False.
N/A PIPELINE_TIME This is the unary negation operator. It returns a copy of the PIPELINE_TIME object, with the reference time or frame count time as negative values, depending on the type of the current object.
this += PIPELINE_TIME Adds the right value to the current object.
this -= PIPELINE_TIME Subtracts the right value from the current object.
this + PIPELINE_TIME Returns a new PIPELINE_TIME with the left and right values added.
this - PIPELINE_TIME Returns a new PIPELINE_TIME with the right value subtracted from the current object.
PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

<= PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

Boolean <= comparison.
PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

< PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

Boolean < comparison.
PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

>= PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

Boolean >= comparison.
PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

> PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

Boolean > comparison.
PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

== PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

Boolean == comparison.
PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

!= PIPELINE_TIME

or

REFERENCE_TIME

or

DWORD time in milliseconds

Boolean != comparison.

Requirements

Client: Windows Vista

Header: Defined in GPUPipelineTime.h; include gputransformplugin.h.

See Also