Loading a filter

Loading filters are just as easy as playing a media file.

Loading a filter in C#:

Filter filter = new Filter(<CLSID of filter>);

The CLSID of the filter is usually given. However, one can look it up using the Filter Mapper by the name of the filter. There is only one filter mapper available per application to reduce code complexity and prevent bad coding.

Filter filter = null;
foreach(FilterInformation filterInformation in FilterMapper.DefaultMapper.AllFilters)
{
if(filterInformation.Name.Contains("Video Mixing Renderer")) {
filter = filterInformation.CreateInstance();
break;
}
}

The above code looks for the first filter found whose name contains "Video Mixing Renderer" and creates an instance of the selected filter.

Inserting filters into the filter graph happens to be just as easy.

filterGraph.Filters.Add(filter);

That is how you create and insert filters into a filter graph with MediaFramework.