Microsoft DirectX 8.0

IMpeg2Demultiplexer Interface

This interface is implemented on the MPEG-2 Demultiplexer filter (Demux) and is used in both program stream mode and transport stream mode. It is called by applications or other filters to create, configure and delete output pins on the Demux.

MethodNameDescription
CreateOutputPinCreates a new output pin on the Demux.
SetOutputPinMediaTypeUpdates the media type of the specified output pin. (Not implemented in DirectX® 8.)
DeleteOutputPinDeletes the specified output pin.

IMpeg2Demultiplexer::CreateOutputPin

IMpeg2Demultiplexer Interface

Creates a new output pin on the Demux.

Syntax

HRESULT CreateOutputPin(
    AM_MEDIA_TYPE* pMediaType,
     LPWSTR pszPinName,
      IPin** ppIPin
    );

Parameters

pMediaType
[in] Pointer to an AM_MEDIA_TYPE structure that specifies the media type information for the new pin.
pszPinName
[in] Pointer to a wide character string that specifies the application-defined friendly name for the new pin.
ppIPin
[out] Pointer that will be set to the new pin's IPin interface.

Return Value

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

Remarks

Duplicate pin names are not allowed. The returned IPin interface can be used to query the new pin for either an IMPEG2StreamIdMap interface (for program streams) or an IMPEG2PIDMap interface (for transport streams). Based on which interface is queried for on the first output pin, the Demux will configure itself for either transport or program stream mode. Once the Demux is configured, a call to QueryInterface to retrieve the other interface will fail.

IMpeg2Demultiplexer::SetOutputPinMediaType

IMpeg2Demultiplexer Interface

Updates the media type of the specified output pin. (Not implemented in DirectX® 8.)

Syntax

HRESULT SetOutputPinMediaType(
    LPWSTR pszPinName,
    AM_MEDIA_TYPE* pMediaType
    );

Parameters

pszPinName
[in] The friendly name of the pin as specified when the pin was created in a call to CreateOutputPin.
pMediaType
in] Pointer to an AM_MEDIA_TYPE structure that specifies the new media type information for the pin.

Return Value

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

Remarks

For DirectX 8, the pin must be assigned the media type at the time it is created. The media type cannot be modified later.

Pins can be reconfigured at any time with a new media type. If no connection exists, the media type is simply updated. If the pin is connected, the success or failure of the call will depend on the downstream input pin's acceptance or rejection of the specified media type.

The media type is not interpreted in any way by the Demux. It is used only during connection negotiation by the output pin. It has no effect on the content of the media samples. Media sample content is defined when a PID is mapped via the MEDIA_SAMPLE_CONTENT parameter in the IMPEG2PIDMap::MapPID method, or via the defined values in an IMPEG2StreamId::MapStreamId call.

IMpeg2Demultiplexer::DeleteOutputPin

IMpeg2Demultiplexer Interface

Deletes the specified output pin.

Syntax

HRESULT DeleteOutputPin(
    LPWSTR pszPinName
    );

Parameters

pszPinName
[in] The friendly name of the pin as specified when the pin was created in a call to CreateOutputPin.

Return Value

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

Remarks

Call this method only when you need to delete a pin while keeping the filter alive. When the filter is released, it will perform all necessary cleanup on the output pins.