Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

MediaClock

Functions for media sychronization

Synopsis:

static MediaClock media_clock =
 {
    Initialize,
    Uninitialize,
    Value,
    SetScale
 };

Description:

The Multimedia library implements a default MediaClock interface that your filters can use. This interface defines the functions needed for media clock synchronization. Synchronization is normally defined in an audio output filter, since it yields the best synchronization. MediaClock allows multiple filters to get accurate timestamps for accurate synchronization.

MediaClock defines the following functions:

Initialize()

int32_t (*Initialize)(MmFilter_t *filter); 

This function should initialize the filter's media clock portion.

If successful, this function should return 0.

Uninitialize()

int32_t (*Uninitialize)(MmFilter_t *filter); 

This function should free the filter's media clock data.

If successful, this function should return 0.

Value()

MmTime_t (*Value)(MmFilter_t filter); 

This function should return the filter's current timestamp. The timestamp is independent of your position in any media stream; it's an incrementing value you can use to perform synchronization. This function returns an MmTime_t, an int_64 that represents time in microseconds.

SetScale()

int32_t (*SetScale)(MmFilter_t *filter,
                    int32_t scale);

This function should set the scale for the returned time from the given filter. The default time should be in microseconds, and is divided by scale when this function is called. For example, if scale is set to 1000, then the filter should return time in milliseconds.

Classification:

Neutrino

See also:

Extending the Multimedia Framework.