Microsoft DirectX 8.0 |
This interface extends the IFilterGraph and IGraphBuilder interfaces, which contain methods for building filter graphs.
The filter graph manager implements this interface. Applications can use it when building graphs, to take advantage of the additional methods it provides.
IFilterGraph2 adds two methods to IFilterGraph and IGraphBuilder.
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 AddFilter Adds a filter to the graph and gives it a name. RemoveFilter Removes a filter from the graph. EnumFilters Provides an enumerator for all filters in the graph. FindFilterByName Finds a filter that was added with a specified name. ConnectDirect Connects two pins directly (without intervening filters). Reconnect Breaks the existing pin connection and reconnects it to the same pin. Disconnect Disconnects a specified pin. SetDefaultSyncSource Sets the default synchronization source (a clock). IGraphBuilder methods Description Connect Connects two pins. If they do not connect directly, this method connects them with intervening transforms. Render Adds a chain of filters to a specified output pin to render it. RenderFile Builds a filter graph that renders the specified file. AddSourceFilter Adds a source filter to the filter graph for a specific file. The IGraphBuilder::RenderFile method calls this to find the source filter. SetLogFile Sets the file for logging actions taken when attempting to perform an operation. Abort Requests that the graph builder return as soon as possible from its current task. ShouldOperationContinue Queries whether the current operation should continue. IFilterGraph2 methods Description AddSourceFilterForMoniker Adds a source filter based on a moniker. ReconnectEx Breaks the existing pin connection and reconnects it to the same pin, using a specified media type.
Adds a source filter based on a moniker. For example, you can obtain a moniker for a system device, such as a video capture device, and add a video capture filter for that device. (For more information about system device monikers, see ICreateDevEnum.)
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
If the method succeeds, the return value is one of the following values.
S_OK Success. VFW_S_DUPLICATE_NAME Successfully added a filter with a duplicate name. If the method fails, the return value may be one of the following error values.
E_FAIL Failure. E_OUTOFMEMORY Insufficient memory. VFW_E_DUPLICATE_NAME Failed to add a filter with a duplicate name. VFW_E_CANNOT_LOAD_SOURCE_FILTER The source filter for could not be loaded. VFW_E_UNKNOWN_FILE_TYPE The media type of this file is not recognized.
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.
Breaks the existing pin connection and reconnects it to the same pin, using a specified media type.
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
S_OK Success. S_FALSE Pin was not connected. No error. If the method fails, the return value may be one of the following error values.
E_FAIL Failure. E_POINTER Null pointer argument. VFW_E_NOT_STOPPED The filter is not stopped, but it does not support reconnection while in a running state.
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