Microsoft DirectX 8.0

IMPEG2PIDMap Interface

This interface is implemented on each output pin of the MPEG-2 Demultiplexer filter (Demux) and is used in transport stream mode only. It is called by applications or other filters to associate the pin with one or more Packet IDs (PID). Once a PID has been mapped, the Demux will deliver all packets with that ID to the output pin.

For program streams, use the IMPEG2StreamIdMap interface.

MethodNameDescription
MapPIDMaps the packets of a specified PID to the pin.
UnmapPIDUnmaps the PID mapping created in a previous call to MapPID.
EnumPIDMapReturns a collection of all the currently mapped PIDs on this pin.

IMPEG2PIDMap::MapPID

IMPEG2PIDMap Interface

Maps the packets of a specified PID to the pin.

Syntax

HRESULT MapPID(
    ULONG culPID,
    ULONG* pulPID,
    MEDIA_SAMPLE_CONTENT MediaSampleContent
);

Parameters

culPID
[in] Variable of type ULONG that specifies the number of elements in the pulPID array.
pulPID
[in] Pointer to a variable of type ULONG that specifies the PID to map.
MediaSampleContent
[in] Variable of type MEDIA_SAMPLE_CONTENT that specifies the contents of the stream.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

There may be no more than 255 distinct PIDs mapped at any given time. This includes the PIDs that the Demux maps internally for its own use; this number varies depending on the transport stream. This limitation should never present a problem because applications will typically map no more than 10-12 PIDs on any given transport stream.

IMPEG2PIDMap::UnmapPID

IMPEG2PIDMap Interface

Unmaps the PID mapping created in a previous call to MapPID.

Syntax

HRESULT UnmapPID(
    ULONG culPID,
    ULONG* pulPID
);

Parameters

culPID
[in] Variable of type ULONG that specifies the number of elements in the pulPID array.
pulPID
[in] Array of PIDs mapped for this pin.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

On output pins for audio and video streams, there will typically be only one PID mapped at any given time. On an output pin such as one delivering the PSI stream to the Transport Information Filter, there may be multiple PIDs mapped to a single pin. Use the IEnumPIDMap methods to determine which PIDs are mapped to the pin, and then fill in the pulPID array with those values.

IMPEG2PIDMap::EnumPIDMap

IMPEG2PIDMap Interface

Returns a collection of all the currently mapped PIDs on this pin.

Syntax

HRESULT EnumPIDMap(
    IEnumPIDMap** ppIEnumPIDMap
);

Parameters

ppIEnumPIDMap
[in] IEnumPIDMap interface pointer that will be set to the returned collection.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.