IFilterGraph2 Interface

The IFilterGraph2 interface adds new functionality to the IGraphBuilder and IFilterGraph interfaces. It inherits from both interfaces and exposes all their methods. This interface also includes a method to add a source for a moniker, and an improved version of the IFilterGraph::Reconnect method. For this reason, you should usually use IFilterGraph2 instead of the other two.

The filter graph implements this interface so it isn't intended that you implement it.

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

Syntax

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 Value

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 IMoniker::BindToStorage member function will query for an IStream interface. If this fails, IMoniker::BindToObject will try to retrieve an IBaseFilter interface.

IFilterGraph2::ReconnectEx

IFilterGraph2 Interface

Specifies a pin and a media type to reconnect with.

Syntax

HRESULT ReconnectEx(

  IPin *ppin,
  const AM_MEDIA_TYPE *pmt );

Parameters

ppin
[in] Pointer to the pin to disconnect and reconnect.
pmt
[in] Pointer to the media type to reconnect with. Specify NULL to use the existing media type.

Return Value

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

Remarks

Like the IFilterGraph::Reconnect method, the ReconnectEx method schedules a reconnection of the pin with the pin it is currently connected to. By specifying a media type when this method is called, the pins don't have to check what type they were originally connected with or enumerate possible new types. This makes the reconnection more likely to succeed.

See Also

IFilterGraph::Reconnect


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