Called when the presentation clock starts.
public:
HRESULT OnClockStart(
MFTIME hnsSystemTime,
LONGLONG llClockStartOffset
)
hnsSystemTime
Type: MFTIME
The system time when the clock started, in 100-nanosecond units.
llClockStartOffset
Type: LONGLONG
The new starting time for the clock, in 100-nanosecond units. This parameter can also equal PRESENTATION_CURRENT_POSITION, indicating the clock has started or restarted from its current position.
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Refer to Media Foundation return codes.
This method is called whe the presentation clock’s IMFPresentationClock::Start method is called, with the following exception: If the clock is paused and Start is called with the value PRESENTATION_CURRENT_POSITION, IMFClockStateSink::OnClockRestart is called instead of OnClockStart.
The clock notifies the presentation time source by calling the time source’s OnClockStart method. This call occurs synchronously within the Start method. If the time source returns an error from OnClockStart, the presentation clock’s Start method returns an error and the state change does not take place.
For any object that is not the presentation time source, the OnClockStart method is called asynchronously, after the state change is completed. In that case, the return value from this method is ignored.
The value given in llClockStartOffset is the presentation time when the clock starts, so it is relative to the start of the presentation. Media sinks should not render any data with a presentation time earlier than llClockStartOffSet. If a sample straddles the offset—that is, if the offset falls between the sample’s start and stop times—the sink should either trim the sample so that only data after llClockStartOffset is rendered, or else simply drop the sample.
Header: Declared in mfidl.h.
Library: Use mfuuid.lib.