Поделиться через


IWMReaderAdvanced::DeliverTime method (wmsdkidl.h)

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The DeliverTime method provides the reader with a clock time. Use this method only when the application is providing the clock.

Syntax

HRESULT DeliverTime(
  [in] QWORD cnsTime
);

Parameters

[in] cnsTime

The time, in 100-nanosecond units.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
E_UNEXPECTED
The method failed for an unspecified reason.

Remarks

Before making the first call to this method, call the IWMReaderAdvanced::SetUserProvidedClock method with the value TRUE, to specify that the application is providing the clock. Otherwise, the DeliverTime method returns E_UNEXPECTED.

After DeliverTime is called, the reader reads data as fast as possible until it reaches the specified time. When the reader reaches that time, it calls IWMReaderCallbackAdvanced::OnTime, and then sends samples to the callback.

In general, the value of cnsTime should increase each time the method is called (that is, the clock should run forward). However, sometimes it may be possible to pass a smaller value. The DeliverTime method is asynchronous, meaning the reader object reads the data on another thread. The application can specify a smaller time value only if the reader object has not reached that point in the file. For example, if the application calls DeliverTime with the value 100 seconds, and immediately calls it again with the value 50 seconds, the call would probably succeed, because the reader object will not reach the 50-second point in the file. However, you cannot be sure the call will succeed in this case, because the application does not control the reader's thread.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only],Windows Media Format 7 SDK, or later versions of the SDK
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wmsdkidl.h (include Wmsdk.h)
Library Wmvcore.lib; WMStubDRM.lib (if you use DRM)

See also

Broadcasting ASF Data

IWMReaderAdvanced Interface

IWMReaderAdvanced2