Share via


IWMWriterFileSink3::SetControlStream 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 SetControlStream method enables you to specify that a stream should be used as a control stream. You can also use this method to indicate that a previously specified control stream should no longer be used as a control stream.

Syntax

HRESULT SetControlStream(
  [in] WORD wStreamNumber,
  [in] BOOL fShouldControlStartAndStop
);

Parameters

[in] wStreamNumber

A WORD specifying the stream number to configure. Stream numbers must be in the range of 1 through 63.

[in] fShouldControlStartAndStop

A BOOL specifying whether or not the stream should be used as a control stream.

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_INVALIDARG
The stream number specified by wStreamNumber is greater than the maximum.

Remarks

Control streams add accuracy to Start and Stop calls. Instead of trying to find the best starting or stopping place for the file based on times in interleaved streams, the file sink starts and stops the file at exactly the specified time in the control stream. The other streams are then synchronized with the control stream.

You can have more than one control stream, by making multiple calls to this method. The file sink will start or stop at the first encountered instance of the desired time.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only],Windows Media Format 9 Series 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

IWMWriterFileSink3 Interface