MPEG-2 Demux Run-Time Modes
The MPEG-2 Demultiplexer ("demux") can operate in push mode or pull mode. In push mode, the data comes from a live source, such as a network broadcast. In pull mode, the data comes from a local file.
- Pull mode is available only in Windows XP, and only for program streams. On down-level platforms, use the MPEG-2 Splitter filter.
- Push mode is available on all platforms, for both program streams and transport streams.
The demux therefore supports three possible modes: Program streams in pull mode, program streams in push mode, and transport streams in push mode. The demux determines which mode to use at run time. The mode is determined when the input pin connects, or when the first output pin is configured, whichever happens first:
- When the input pin connects: On Windows XP, the demux queries the upstream filter for the IAsyncReader interface; if the upstream filter exposes that interface, the demux configures itself for program streams in pull mode. Otherwise, the demux uses push mode, and the media type determines the stream type (program stream or transport stream). See MPEG-2 Demultiplexer Media Types for a list of input types.
- When the first output pin is configured: If you create an output pin and query it for IMPEG2PIDMap, the demux configures itself for transport streams in push mode. If you query the pin for IMPEG2StreamIdMap, the demux configures itself for program streams, also in push mode. Any subsequent queries for the other interface fail, because the demux cannot operate in two modes at once.
Once the demux has configured itself for a particular mode, it remains in that mode. To use a different mode, you must create a new instance of the demux.