The filter graph manager exposes the IPinInfo interface, which allows access to pin information such as the media type and the pin direction. It also allows control of pins; for example, connecting and disconnecting pins and rendering a filter graph for a pin's media type.
When to Implement
This interface is implemented by the filter graph manager for use by Automation client applications, such as Microsoft® Visual Basic®.
When to Use
Applications that do not have access to the IFilterGraph or IGraphBuilder interface use this interface to retrieve pin information, to connect and disconnect pins, and to have the filter graph manager automatically generate filter graphs given the output pin of a source filter.
Methods in Vtable Order
| IUnknown methods | Description |
| QueryInterface | Returns pointers to supported interfaces. |
| AddRef | Increments the reference count. |
| Release | Decrements the reference count. |
| IDispatch methods | Description |
| GetTypeInfoCount | Determines whether there is type information available for this dispinterface. |
| GetTypeInfo | Retrieves the type information for this dispinterface if GetTypeInfoCount returned successfully. |
| GetIDsOfNames | Converts text names of properties and methods (including arguments) to their corresponding DISPIDs. |
| Invoke | Calls a method or accesses a property in this dispinterface if given a DISPID and any other necessary parameters. |
| IPinInfo methods | Description |
| get_Pin | Retrieves the pin object that supports the IPin interface. |
| get_ConnectedTo | Retrieves the IPinInfo object for the corresponding pin to which this pin is connected. |
| get_ConnectionMediaType | Retrieves the media type on this connection. |
| get_FilterInfo | Retrieves the IFilterInfo object for the filter to which this pin belongs. |
| get_Name | Retrieves the name of this pin. |
| get_Direction | Retrieves the pin direction. |
| get_PinID | Retrieves the pin identifier. |
| get_MediaTypes | Retrieves an IAMCollection interface providing access to the preferred media types supported by this pin. |
| Connect | Connects to the specified pin. |
| ConnectDirect | Connects directly to the specified pin. |
| ConnectWithType | Connects directly to the specified pin using only the specified media type. |
| Disconnect | Disconnects this pin from its connected pin. |
| Render | Creates a filter graph capable of rendering the pin's media type. |
Connects to the specified pin using other transform filters as necessary.
HRESULT Connect(
IUnknown *pPin
);
Returns an HRESULT value.
The pPin parameter can be either an IPin or an IPinInfo object. This method uses the graph builder to determine the required transform filters to enable the connection of this pin with the specified pin. For example, if the pin is an output pin of a source filter, and the requested connection is the input pin of a video renderer, this method will insert a decompressor filter of the appropriate media type to make this a valid filter graph. This method is essentially an Automation wrapper for the IGraphBuilder::Connect method.
Connects directly to the given pin, not using any intermediate filters.
HRESULT ConnectDirect(
IUnknown *pPin
);
Returns an HRESULT value.
This method will return an error if a common media type for the connecting pins cannot be agreed on. This method is essentially an Automation wrapper for the IFilterGraph::ConnectDirect method.
Connects directly to the specified pin by using the specified media type.
HRESULT ConnectWithType(
IUnknown *pPin,
IDispatch *pMediaType
);
Returns an HRESULT value.
This method allows you to determine which media type you want the connection to be made with, rather than letting the pins decide the media type upon connection.
Disconnects this pin from its connected pin.
HRESULT Disconnect(void);
Returns an HRESULT value.
This method calls IPin::Disconnect on both pins.
Retrieves the IPinInfo interface for the connected pin.
HRESULT get_ConnectedTo(
IDispatch **ppUnk
);
Returns an HRESULT value.
This method is essentially an Automation wrapper for the IPin::ConnectedTo method.
Retrieves the IMediaTypeInfo object containing the connection information.
HRESULT get_ConnectionMediaType(
IDispatch **ppUnk
);
Returns an HRESULT value.
This method is essentially an Automation wrapper for the IPin::ConnectionMediaType method.
Retrieves the pin direction.
HRESULT get_Direction(
LONG *ppDirection
);
Returns an HRESULT value.
Retrieves the IFilterInfo interface for the filter to which this pin belongs.
HRESULT get_FilterInfo(
IDispatch **ppUnk
);
Returns an HRESULT value.
Retrieves an IAMCollection interface providing access to the preferred media types supported by this pin.
HRESULT get_MediaTypes(
IDispatch **ppUnk
);
Returns an HRESULT value.
This method is essentially an Automation wrapper for the IPin::EnumMediaTypes method.
Retrieves the name of this pin.
HRESULT get_Name(
BSTR **ppUnk
);
Returns an HRESULT value.
Retrieves the pin object that supports the IPin interface.
HRESULT get_Pin(
IUnknown **ppUnk
);
Returns an HRESULT value.
The IPinInfo interface is implemented by a wrapper COM object, so QueryInterface for IPin on this object will fail. The IPinInfo::get_Pin method returns the pin object, on which the IPin interface is supported.
Retrieves the pin identifier.
HRESULT get_PinID(
BSTR *strPinID
);
Returns an HRESULT value.
The returned strPinID string can be passed to IFilterInfo::FindPin. This is often the same as the name of the pin, but might be some other value. This identifier can be written to persistent storage and used later to identify the same pin in a different instance of the filter.
Connects filters together as necessary in order to render the output of this pin, using any necessary transform and rendering filters.
HRESULT Render(void);
Returns an HRESULT value.
This method is essentially an Automation wrapper for the IGraphBuilder::Render method. This method is valid only on output pins.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.