IFilterGraph2 Interface


The IFilterGraph2 interface adds new functionality to the IGraphBuilder and the IFilterGraph interfaces. It inherits from both interfaces and exposes all their methods. For this reason, IFilterGraph2 should normally be used instead of the other two.

When to Implement

This interface is implemented by the filter graph and not intended to be implemented by developers.

When to Use

Use this interface in applications that previously called IFilterGraph::Reconnect and in applications that need a source filter for a moniker.

Methods in Vtable Order
IUnknown methods Description
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IFilterGraph methods Description
AddSourceFilterForMoniker Adds a source for a moniker.
ReconnectEx Specifies a pin and a media type to reconnect with.


IFilterGraph2::AddSourceFilterForMoniker

IFilterGraph2 Interface

Adds a source for a moniker.

HRESULT AddSourceFilterForMoniker(
  IMoniker *pMoniker,
  IBindCtx *pCtx,
  LPCWSTR lpcwstrFilterName,
  IBaseFilter **ppFilter );

Parameters
pMoniker
[in] Pointer to an IMoniker interface.
pCtx
[in] Pointer to an IBindCtx bind context interface.
lpcwstrFilterName
[in] Pointer to the filter's name.
ppFilter
[out] Address of a pointer to an IBaseFilter interface.
Return Values

Returns an HRESULT value that depends on the implementation of the interface.

Remarks

When adding a source filter for the given moniker to the graph, the COM member function IMoniker::BindToStorage will query for an IStream interface. If this fails IMoniker::BindToObject will attempt to retrieve an IBaseFilter interface.


IFilterGraph2::ReconnectEx

IFilterGraph2 Interface

Specifies a pin and a media type to reconnect with.

HRESULT ReconnectEx(
  IPin * ppin,
  const AM_MEDIA_TYPE *pmt );

Parameters
ppin
[in] The pin to disconnect and reconnect.
pmt
[in] The media type to reconnect with. Specify NULL to use existing media type.
Return Values

Returns an HRESULT value that depends on the implementation of the interface.

Remarks

Like the IFilterGraph::Reconnect method, the ReconnectExmethod schedules a reconnection of the pin with the pin it is currently connected to. Specifying a media type removes the burden of remembering what type to reconnect with from the pins and thus makes the reconnection more likely to succeed.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.