Microsoft DirectX 8.0

IMPEG2StreamIdMap Interface

This interface is implemented on each output pin of the MPEG-2 Demultiplexer filter (Demux) and is used in program stream mode only. It is called by applications or other filters to associate the pin with a specified Stream ID and to inform the pin whether substream filtering is required on the stream.

For transport streams, use the IMPEG2PIDMap interface.

MethodNameDescription
MapStreamIdMaps the Stream ID of an elementary stream within an MPEG-2 program stream to a media content type and substream filtering information.
UnmapStreamIdUnmaps the Stream ID mapping created in a previous call to MapStreamId.
EnumStreamIdMapReturns a collection of all the mapped Stream IDs on this pin.

IMPEG2StreamIdMap::MapStreamId

IMPEG2StreamIdMap Interface

Maps the Stream ID of an elementary stream within an MPEG-2 program stream to a media content type and substream filtering information.

Syntax

HRESULT MapStreamId(
    ULONG ulStreamId,
    DWORD MediaSampleContent,
    ULONG ulSubstreamFilterValue,
    int iDataOffset
);

Parameters

ulStreamId
[in] Variable of type ULONG that specifies the stream ID of the PES stream.
MediaSampleContent
[in] Variable of type ULONG that specifies the contents of the stream. Currently the only value supported is MPEG2_PROGRAM_ELEMENTARY_STREAM (defined as 0x00000001 in axextend.idl).
ulSubstreamFilterValue
[in] Variable of type ULONG that specifies which substream within this elementary stream to pass on to the downstream decoder. Only the low-order byte can contain a valid filter value. If iDataOffset = 0, this parameter is ignored.
iDataOffset
[in] Variable of type int that specifies the byte offset into the payload at which the substream begins.

Return Value

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

Remarks

The Stream ID mapped by this method is the stream ID in the PES header. Substream filtering is most commonly used to provide multiple channels on a single audio stream.

IMPEG2StreamIdMap::UnmapStreamId

IMPEG2StreamIdMap Interface

Unmaps the Stream ID mapping created in a previous call to MapStreamId.

Syntax

HRESULT UnmapStreamId(
    ULONG culStreamId,
    ULONG* pulStreamID
);

Parameters

culStreamId
[in] Variable of type ULONG that specifies the number of elements in the pulStreamID array.
pulStreamID
[in] Array of Stream IDs 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

There is typically only one stream ID mapped to a given pin, therefore pulStreamID will typically contain a single element.

IMPEG2StreamIdMap::EnumStreamIdMap

IMPEG2StreamIdMap Interface

Returns a collection of all the mapped Stream IDs on this pin.

Syntax

HRESULT EnumStreamIdMap(
    IEnumStreamIdMap** ppIEnumStreamIdMap
);

Parameters

ppIEnumStreamIdMap
[in] IEnumStreamIdMap 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.

Remarks

Currently, there is only one stream ID mapped to a given pin, therefore this collection will contain a single item.