## IPinInfo Interface

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.

###

IPinInfo::Connect

IPinInfo Interface

Connects to the specified pin using other transform filters as necessary.

HRESULT Connect(
IUnknown *pPin
);

##### Parameters

pPin
  [in] Pin to connect with.

##### Return Values

Returns an HRESULT value.

##### Remarks

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.

###

IPinInfo::ConnectDirect

IPinInfo Interface

Connects directly to the given pin, not using any intermediate filters.

HRESULT ConnectDirect(
IUnknown *pPin
);

##### Parameters

pPin
  [in] Pin to connect directly to.

##### Return Values

Returns an HRESULT value.

##### Remarks

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.

###

IPinInfo::ConnectWithType

IPinInfo Interface

Connects directly to the specified pin by using the specified media type.

HRESULT ConnectWithType(
IUnknown *pPin,
IDispatch *pMediaType
);

##### Parameters

pPin
  [in] Pin to connect to. pPin is an object that must support either the IPin or the IPinInfo interface.
pMediaType
  [in] Media type the pin is connecting with. pMediaType must support the IMediaTypeInfo interface.

##### Return Values

Returns an HRESULT value.

##### Remarks

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.

###

IPinInfo::Disconnect

IPinInfo Interface

Disconnects this pin from its connected pin.

HRESULT Disconnect(void);

##### Return Values

Returns an HRESULT value.

##### Remarks

This method calls IPin::Disconnect on both pins.

###

IPinInfo::get_ConnectedTo

IPinInfo Interface

Retrieves the IPinInfo interface for the connected pin.

HRESULT get_ConnectedTo(
IDispatch **ppUnk
);

##### Parameters

ppUnk
  [out, retval] IPinInfo interface for the pin.

##### Return Values

Returns an HRESULT value.

##### Remarks

This method is essentially an Automation wrapper for the IPin::ConnectedTo method.

###

IPinInfo::get_ConnectionMediaType

IPinInfo Interface

Retrieves the IMediaTypeInfo object containing the connection information.

HRESULT get_ConnectionMediaType(
IDispatch **ppUnk
);

##### Parameters

ppUnk
  [out, retval] Returned IMediaTypeInfo interface.

##### Return Values

Returns an HRESULT value.

##### Remarks

This method is essentially an Automation wrapper for the IPin::ConnectionMediaType method.

###

IPinInfo::get_Direction

IPinInfo Interface

Retrieves the pin direction.

HRESULT get_Direction(
LONG *ppDirection
);

##### Parameters

ppDirection
  [out, retval] Pin direction; either PINDIR_INPUT or PINDIR_OUTPUT.

##### Return Values

Returns an HRESULT value.

###

IPinInfo::get_FilterInfo

IPinInfo Interface

Retrieves the IFilterInfo interface for the filter to which this pin belongs.

HRESULT get_FilterInfo(
IDispatch **ppUnk
);

##### Parameters

ppUnk
  [out, retval] Retrieved IFilterInfo interface.

##### Return Values

Returns an HRESULT value.

###

IPinInfo::get_MediaTypes

IPinInfo Interface

Retrieves an IAMCollection interface providing access to the preferred media types supported by this pin.

HRESULT get_MediaTypes(
IDispatch **ppUnk
);

##### Parameters

ppUnk
  [out, retval] IAMCollection interface containing the preferred media types as IMediaTypeInfo objects.

##### Return Values

Returns an HRESULT value.

##### Remarks

This method is essentially an Automation wrapper for the IPin::EnumMediaTypes method.

###

IPinInfo::get_Name

IPinInfo Interface

Retrieves the name of this pin.

HRESULT get_Name(
BSTR **ppUnk
);

##### Parameters

ppUnk
  [out, retval] Name of the pin.

##### Return Values

Returns an HRESULT value.

###

IPinInfo::get_Pin

IPinInfo Interface

Retrieves the pin object that supports the IPin interface.

HRESULT get_Pin(
IUnknown **ppUnk
);

##### Parameters

ppUnk
  [out, retval] IUnknown object that supports IPin.

##### Return Values

Returns an HRESULT value.

##### Remarks

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.

###

IPinInfo::get_PinID

IPinInfo Interface

Retrieves the pin identifier.

HRESULT get_PinID(
BSTR *strPinID
);

##### Parameters

strPinID
  [out, retval] Pin identifier string.

##### Return Values

Returns an HRESULT value.

##### Remarks

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.

###

IPinInfo::Render

IPinInfo Interface

Connects filters together as necessary in order to render the output of this pin, using any necessary transform and rendering filters.

HRESULT Render(void);

##### Return Values

Returns an HRESULT value.

##### Remarks

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.