IAMStreamControl interface (strmif.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The IAMStreamControl interface controls individual streams on a filter. Pins on some filters expose this interface. For example, the AVI Mux Filter supports this interface on its input pins, and the Audio Capture Filter and WDM Video Capture Filter support it on their output pins.

This interface enables an application to turn streams on and off at specified times. For example, an application might turn off an audio stream to mute the audio during video preview. Capture applications can use this interface to specify exact start and stop times for capture, and to control capture and preview streams independently of each other.

To use this interface, call the IAMStreamControl::StartAt method to specify when the pin will start delivering data, and the IAMStreamControl::StopAt method to specify when it will stop delivering data. Then call IMediaControl::Run on the Filter Graph Manager to run the filter graph. All times are relative to when the graph starts running.

When you use this interface, be aware of the following limitations:

  • There must be a reference clock in the filter graph.
  • Preview pins on capture cards with hardware overlay do not support this interface.
  • If you are capturing audio and video to an interleaved AVI file, the AVI Mux filter requires data both streams. If you stop one stream, the filter cannot interleave the data. For more information, see IConfigInterleaving Interface.
Depending on the application, you might find the ICaptureGraphBuilder2::ControlStream method more convenient, because it supports stream control at the graph level, so that you do not have to enumerate individual filters and pins.

Filter developers: The CBaseStreamControl base class implements this interface.

Inheritance

The IAMStreamControl interface inherits from the IUnknown interface. IAMStreamControl also has these types of members:

Methods

The IAMStreamControl interface has these methods.

 
IAMStreamControl::GetInfo

The GetInfo method retrieves information about the current stream-control settings, including the start and stop times.
IAMStreamControl::StartAt

The StartAt method informs the pin when to start delivering data.
IAMStreamControl::StopAt

The StopAt method informs the pin when to stop delivering data.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)

See also

CBaseStreamControl Class

Error and Success Codes