Microsoft DirectX 9.0


The ChangeOutputFormat method dynamically changes the media type for the connection, and delivers new segment information. The change can occur while the filter graph is running. Once this method is called, samples with the old media type cannot be delivered. The caller must ensure that no old samples are pending.


HRESULT ChangeOutputFormat(
    const AM_MEDIA_TYPE *pmt,
    REFERENCE_TIME tSegmentStart,
    REFERENCE_TIME tSegmentStop,
    double dSegmentRate



Pointer to an AM_MEDIA_TYPE structure that specifies the media type.


Start time of the segment.


Stop time of the segment.


Segment rate.

Return Value

Returns an HRESULT value. Possible values include those shown in the following table.

Value Description
S_OK Success.
E_FAIL Failure. Possibly the owning filter did not call CDynamicOutputPin::SetConfigInfo.
VFW_E_NOT_CONNECTED The pin is not connected.


This method changes the format type while the filter is running. If the downstream pin accepts the new format, no reconnection is necessary. Otherwise, the method attempts to reconnect the pin. If the method successfully changes the format, it delivers the new segment information. This method calls the CDynamicOutputPin::ChangeMediaType method to perform the format change.

You must call the CDynamicOutputPin::StartUsingOutputPin method before calling this method.

See Also