C# Class DirectShowLib.Utils.FilterGraphTools

A collection of methods to do common DirectShow tasks.
Datei anzeigen Open project: dgis/CodeTV

Public Methods

Method Description
AddFilterByName ( IGraphBuilder graphBuilder, System.Guid deviceCategory, string friendlyName ) : IBaseFilter

Add a filter to a DirectShow Graph using its name

ConnectFilters ( IGraphBuilder graphBuilder, IBaseFilter upFilter, string sourcePinName, IBaseFilter downFilter, string destPinName, bool useIntelligentConnect ) : void

Connect pins from two filters

If useIntelligentConnect is true, this method can add missing filters between the two pins.
If useIntelligentConnect is false, this method works only if the two media types are compatible.

HasPropertyPages ( IBaseFilter filter ) : bool

Check if a DirectShow filter can display Property Pages

This method is intended to be used with ShowFilterPropertyPage

Private Methods

Method Description
AddFilterByDevicePath ( IGraphBuilder graphBuilder, string devicePath, string name ) : IBaseFilter
AddFilterFromClsid ( IGraphBuilder graphBuilder, System.Guid clsid, string name ) : IBaseFilter
ConnectFilters ( IGraphBuilder graphBuilder, IPin sourcePin, IPin destPin, bool useIntelligentConnect ) : void
DisconnectAllPins ( IGraphBuilder graphBuilder ) : void
DisconnectPins ( IBaseFilter filter ) : void
FilterGraphTools ( ) : System
FindFilterByClsid ( IGraphBuilder graphBuilder, System.Guid filterClsid ) : IBaseFilter
FindFilterByName ( IGraphBuilder graphBuilder, string filterName ) : IBaseFilter
IsThisComObjectInstalled ( System.Guid clsid ) : bool
IsVMR7Present ( ) : bool
IsVMR9Present ( ) : bool
LoadGraphFile ( IGraphBuilder graphBuilder, string fileName ) : void
RemoveAllFilters ( IGraphBuilder graphBuilder ) : void
RenderPin ( IGraphBuilder graphBuilder, IBaseFilter source, string pinName ) : bool
SaveGraphFile ( IGraphBuilder graphBuilder, string fileName ) : void
ShowFilterPropertyPage ( IBaseFilter filter, IntPtr parent ) : void

Method Details

AddFilterByName() public static method

Add a filter to a DirectShow Graph using its name
Thrown if graphBuilder is null Thrown if errors occur when the filter is add to the graph
public static AddFilterByName ( IGraphBuilder graphBuilder, System.Guid deviceCategory, string friendlyName ) : IBaseFilter
graphBuilder IGraphBuilder the IGraphBuilder interface of the graph
deviceCategory System.Guid the filter category (see DirectShowLib.FilterCategory)
friendlyName string the filter name (case-sensitive)
return IBaseFilter

ConnectFilters() public static method

Connect pins from two filters
If useIntelligentConnect is true, this method can add missing filters between the two pins.
If useIntelligentConnect is false, this method works only if the two media types are compatible.
Thrown if graphBuilder, upFilter or downFilter are null Thrown if pin names are not found in filters Thrown if pins can't connect
public static ConnectFilters ( IGraphBuilder graphBuilder, IBaseFilter upFilter, string sourcePinName, IBaseFilter downFilter, string destPinName, bool useIntelligentConnect ) : void
graphBuilder IGraphBuilder the IGraphBuilder interface of the graph
upFilter IBaseFilter the upstream filter
sourcePinName string the upstream filter pin name
downFilter IBaseFilter the downstream filter
destPinName string the downstream filter pin name
useIntelligentConnect bool indicate if the method should use DirectShow's Intelligent Connect
return void

HasPropertyPages() public static method

Check if a DirectShow filter can display Property Pages
This method is intended to be used with ShowFilterPropertyPage
Thrown if filter is null
public static HasPropertyPages ( IBaseFilter filter ) : bool
filter IBaseFilter A DirectShow Filter
return bool