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.

This interface is implemented by the filter graph manager for use by Automation client applications, such as Microsoft® Visual Basic®.

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 methodsDescription
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IDispatch methodsDescription
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 methodsDescription
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.

Syntax

HRESULT Connect(
    IUnknown *pPin
    );

Parameters

pPin
[in] Pointer to the pin to connect with.

Return Value

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.

Syntax

HRESULT ConnectDirect(
  IUnknown *pPin
  );

Parameters

pPin
[in] Pointer to the pin to connect directly to.

Return Value

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.

Syntax

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

Parameters

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

Return Value

Returns an HRESULT value.

Remarks

This method enables 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.

Syntax

HRESULT Disconnect(void);

Return Value

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.

Syntax

HRESULT get_ConnectedTo(
  IDispatch **ppUnk
  );

Parameters

ppUnk
[out, retval] Address of a pointer to the IPinInfo interface for the pin.

Return Value

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.

Syntax

HRESULT get_ConnectionMediaType(
  IDispatch **ppUnk
  );

Parameters

ppUnk
[out, retval] Address of a pointer to the returned IMediaTypeInfo interface.

Return Value

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.

Syntax

HRESULT get_Direction(
  LONG *ppDirection
  );

Parameters

ppDirection
[out, retval] Address of a pointer to the pin direction; either PINDIR_INPUT or PINDIR_OUTPUT.

Return Value

Returns an HRESULT value.

IPinInfo::get_FilterInfo

IPinInfo Interface

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

Syntax

HRESULT get_FilterInfo(
  IDispatch **ppUnk
  );

Parameters

ppUnk
[out, retval] Address of a pointer to the retrieved IFilterInfo interface.

Return Value

Returns an HRESULT value.

IPinInfo::get_MediaTypes

IPinInfo Interface

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

Syntax

HRESULT get_MediaTypes(
  IDispatch **ppUnk
  );

Parameters

ppUnk
[out, retval] Address of a pointer to the IAMCollection interface containing the preferred media types as IMediaTypeInfo objects.

Return Value

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.

Syntax

HRESULT get_Name(
  BSTR **ppUnk
  );

Parameters

ppUnk
[out, retval] Address of a pointer to the name of the pin.

Return Value

Returns an HRESULT value.

IPinInfo::get_Pin

IPinInfo Interface

Retrieves the pin object that supports the IPin interface.

Syntax

HRESULT get_Pin(
  IUnknown **ppUnk
  );

Parameters

ppUnk
[out, retval] Address of a pointer to the IUnknown object that supports IPin.

Return Value

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.

Syntax

HRESULT get_PinID(
  BSTR *strPinID
  );

Parameters

strPinID
[out, retval] Pointer to the pin identifier string.

Return Value

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.

Syntax

HRESULT Render(void);

Return Value

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.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.