Add a filter to a DirectShow Graph using its name
public static IBaseFilter AddFilterByName(
IGraphBuilder graphBuilder,
Guid deviceCategory,
string friendlyName
);
IGraphBuilder graphBuilder,
Guid deviceCategory,
string friendlyName
);
Parameters
- graphBuilder
- the IGraphBuilder interface of the graph
- deviceCategory
- the filter category (see DirectShowLib.FilterCategory)
- friendlyName
- the filter name (case-sensitive)
Return Value
an instance of the filter if the method successfully created it, null if not
Exceptions
Exception Type | Condition |
---|---|
ArgumentNullException | Thrown if graphBuilder is null |
COMException | Thrown if errors occur when the filter is add to the graph |
Example
This sample shows how to programmatically add a NVIDIA Video decoder filter to a graph
filter = FilterGraphTools.AddFilterByName(graphBuilder, FilterCategory.LegacyAmFilterCategory, "NVIDIA Video Decoder");