Microsoft DirectX 9.0 |
The ChangeMediaType method dynamically changes the media type for the connection. 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.
Syntax
HRESULT ChangeMediaType(
const CMediaType *pmt
);
Parameters
pmt
Pointer to an AM_MEDIA_TYPE structure that specifies the media type.
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. |
Remarks
Call the CDynamicOutputPin::StartUsingOutputPin method before calling this method.
This method first checks whether the downstream input pin can accept the new format without reconnecting. It queries the input pin for the IPinConnection interface. If the input pin supports IPinConnection, the method calls the IPinConnection::DynamicQueryAccept method with the proposed media type. If the input pin accepts the new media type, the method calls the IPin::ReceiveConnection method and renegotiates the allocator requirements.
On the other hand, if the downstream pin does not support IPinConnection, or if it rejects the new media type, the method calls the CDynamicOutputPin::DynamicReconnect method to perform a dynamic reconnection.
See Also