Add a filter to a DirectShow Graph using its Moniker's device path
public static IBaseFilter AddFilterByDevicePath(
IGraphBuilder graphBuilder,
string devicePath,
string name
);
IGraphBuilder graphBuilder,
string devicePath,
string name
);
Parameters
- graphBuilder
- the IGraphBuilder interface of the graph
- devicePath
- a moniker path
- name
- the name to use for the filter in the graph
Return Value
an instance of the filter if the method successfully creates 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
string devicePath = @"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{71E4616A-DB5E-452B-8CA5-71D9CC7805E9}"; filter = FilterGraphTools.AddFilterByDevicePath(graphBuilder, devicePath, "NVIDIA Video Decoder");