Microsoft Windows CE 3.0  

IGraphBuilder::AddSourceFilter

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Adds a source filter to the filter graph for a specific file.

HRESULT
AddSourceFilter(
LPCWSTR
lpwstrFileName
,
LPCWSTR
lpwstrFilterName
,
IbaseFilter **
ppFilter
);

Parameters

lpwstrFileName
[in] Pointer to the file.
lpwstrFilterName
[in] Name to give the source filter when it is added.
ppFilter
[out] Pointer to an IBaseFilterinterface on the filter that was added.

Return Values

Returns an HRESULTvalue.

Remarks

This method allows you to obtain and retain more control over building the rest of the graph. For example, you can use the IFilterGraph::AddFiltermethod to add a renderer of your choice, and then use the IGraphBuilder::Connectmethod to connect the two filters. The IBaseFilterinterface exposed by the source filter is returned in the ppFilterparameter, and the reference is already added by the IUnknown::AddRefmethod. The lpwstrFilterNameparameter is used to allow the filter to be identified by this name in this filter graph. For more information, see FindFilterByName.

It is the application's responsibility to find the output pin of the added source filter in order to build the rest of the filter graph, which can be done by calling IGraphBuilder::Renderon the output pin, to build the entire filter graph automatically, or by adding and connecting filters individually. Note that, when adding filters individually, the asynchronous file reader source filter and the URL moniker source filter do not parse the data, so the output pins of these source filters can be connected only to a parser filter, such as the MPEG splitter filter.

Note that the IGraphBuilder::RenderFilemethod adds the same source filter.