Namespacehierarchy
ClassesClass Description
FilterGraphTools AcollectionofmethodstodocommonDirectShowtasks.
DirectShowLib.UtilsNamespace
AcollectionofmethodstodocommonDirectShowtasks.
Foralistofallmembersofthistype,seeFilterGraphToolsMembers.
System.ObjectDirectShowLib.Utils.FilterGraphTools
publicsealedclassFilterGraphTools
ThreadSafetyPublicstatic(SharedinVisualBasic)membersofthistypearesafeformultithreadedoperations.Instancemembersarenotguaranteedtobethread-safe.
RequirementsNamespace:DirectShowLib.UtilsAssembly:DirectShowLib.Utils(inDirectShowLib.Utils.dll)
SeeAlsoFilterGraphToolsMembers|DirectShowLib.UtilsNamespace
FilterGraphToolsClass
FilterGraphToolsoverview
PublicStaticMethods
AddFilterByDevicePath AddafiltertoaDirectShowGraphusingitsMoniker'sdevicepath
AddFilterByName AddafiltertoaDirectShowGraphusingitsname
AddFilterFromClsid AddafiltertoaDirectShowGraphusingitsCLSID
ConnectFilters Overloaded.Connectpinsfromtwofilters
DisconnectAllPins DisconnectpinsofallthefiltersinaDirectShowGraph
DisconnectPins Disconnectallpinsonagivenfilter
FindFilterByClsid FindafilterinaDirectShowGraphusingitsCLSID
FindFilterByName FindafilterinaDirectShowGraphusingitsname
HasPropertyPages CheckifaDirectShowfiltercandisplayPropertyPages
IsThisComObjectInstalled CheckifaCOMObjectisavailable
IsVMR7Present CheckiftheVideoMixingRenderer7Filterisavailable
IsVMR9Present CheckiftheVideoMixingRenderer9Filterisavailable
LoadGraphFile LoadaDirectShowGraphfrom
FilterGraphToolsMembers
afile
RemoveAllFilters RemoveandreleaseallfiltersfromaDirectShowGraph
RenderPin Renderafilter'spininaDirectShowGraph
SaveGraphFile SaveaDirectShowGraphtoaGRFfile
ShowFilterPropertyPage DisplayPropertyPagesofagivenDirectShowfilter
PublicInstanceMethods
Equals(inheritedfromObject)
GetHashCode(inheritedfromObject)
GetType(inheritedfromObject)
ToString(inheritedfromObject)
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace
ThemethodsoftheFilterGraphToolsclassarelistedbelow.ForacompletelistofFilterGraphToolsclassmembers,seetheFilterGraphToolsMemberstopic.
PublicStaticMethods
AddFilterByDevicePath AddafiltertoaDirectShowGraphusingitsMoniker'sdevicepath
AddFilterByName AddafiltertoaDirectShowGraphusingitsname
AddFilterFromClsid AddafiltertoaDirectShowGraphusingitsCLSID
ConnectFilters Overloaded.Connectpinsfromtwofilters
DisconnectAllPins DisconnectpinsofallthefiltersinaDirectShowGraph
DisconnectPins Disconnectallpinsonagivenfilter
FindFilterByClsid FindafilterinaDirectShowGraphusingitsCLSID
FindFilterByName FindafilterinaDirectShowGraphusingitsname
HasPropertyPages CheckifaDirectShowfiltercandisplayPropertyPages
IsThisComObjectInstalled CheckifaCOMObjectisavailable
IsVMR7Present CheckiftheVideoMixingRenderer7Filterisavailable
IsVMR9Present CheckiftheVideoMixingRenderer9Filterisavailable
FilterGraphToolsMethods
LoadGraphFile LoadaDirectShowGraphfromafile
RemoveAllFilters RemoveandreleaseallfiltersfromaDirectShowGraph
RenderPin Renderafilter'spininaDirectShowGraph
SaveGraphFile SaveaDirectShowGraphtoaGRFfile
ShowFilterPropertyPage DisplayPropertyPagesofagivenDirectShowfilter
PublicInstanceMethods
Equals(inheritedfromObject)
GetHashCode(inheritedfromObject)
GetType(inheritedfromObject)
ToString(inheritedfromObject)
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace
AddafiltertoaDirectShowGraphusingitsMoniker'sdevicepath
publicstaticIBaseFilterAddFilterByDevicePath(
IGraphBuildergraphBuilder,
stringdevicePath,
stringname
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
devicePathamonikerpath
namethenametouseforthefilterinthegraph
ReturnValueaninstanceofthefilterifthemethodsuccessfullycreatesit,nullifnot
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderisnull
COMException Throwniferrorsoccurwhenthefilterisaddtothegraph
ExampleThissampleshowshowtoprogrammaticallyaddaNVIDIAVideodecoderfiltertoagraph
stringdevicePath=@"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{71E4616A-DB5E-452B-8CA5-71D9CC7805E9}";
filter=FilterGraphTools.AddFilterByDevicePath(graphBuilder,devicePath,"NVIDIAVideoDecoder");
FilterGraphTools.AddFilterByDevicePathMethod
AddafiltertoaDirectShowGraphusingitsname
publicstaticIBaseFilterAddFilterByName(
IGraphBuildergraphBuilder,
GuiddeviceCategory,
stringfriendlyName
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
deviceCategorythefiltercategory(seeDirectShowLib.FilterCategory)
friendlyNamethefiltername(case-sensitive)
ReturnValueaninstanceofthefilterifthemethodsuccessfullycreatedit,nullifnot
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderisnull
COMException Throwniferrorsoccurwhenthefilterisaddtothegraph
ExampleThissampleshowshowtoprogrammaticallyaddaNVIDIAVideodecoderfiltertoagraph
filter=FilterGraphTools.AddFilterByName(graphBuilder,FilterCategory.LegacyAmFilterCategory,"NVIDIAVideoDecoder");
FilterGraphTools.AddFilterByNameMethod
AddafiltertoaDirectShowGraphusingitsCLSID
publicstaticIBaseFilterAddFilterFromClsid(
IGraphBuildergraphBuilder,
Guidclsid,
stringname
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
clsidavalidCLSID.ThisobjectmustimplementIBaseFilter
namethenameusedinthegraph(maybenull)
ReturnValueaninstanceofthefilterifthemethodsuccessfullycreatedit,nullifnot
RemarksYoucanuseIsThisComObjectInstalledtocheckistheCLSIDisvalidbeforecallingthismethod
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderisnull
COMException Throwniferrorsoccurwhenthefilterisaddtothegraph
Example
FilterGraphTools.AddFilterFromClsidMethod
ThissampleshowshowtoprogrammaticallyaddaNVIDIAVideodecoderfiltertoagraph
GuidnvidiaVideoDecClsid=newGuid("71E4616A-DB5E-452B-8CA5-71D9CC7805E9");
if(FilterGraphTools.IsThisComObjectInstalled(nvidiaVideoDecClsid))
{
filter=FilterGraphTools.AddFilterFromClsid(graphBuilder,nvidiaVideoDecClsid,"NVIDIAVideoDecoder");
}
else
{
//useanotherfilter...
}
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|IsThisComObjectInstalled
Connectpinsfromtwofilters
OverloadListConnectpinsfromtwofilters
publicstaticvoidConnectFilters(IGraphBuilder,IBaseFilter,string,IBaseFilter,string,bool);
Connectpinsfromtwofilters
publicstaticvoidConnectFilters(IGraphBuilder,IPin,IPin,bool);
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace
FilterGraphTools.ConnectFiltersMethod
Connectpinsfromtwofilters
publicstaticvoidConnectFilters(
IGraphBuildergraphBuilder,
IBaseFilterupFilter,
stringsourcePinName,
IBaseFilterdownFilter,
stringdestPinName,
booluseIntelligentConnect
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
upFiltertheupstreamfilter
sourcePinNametheupstreamfilterpinname
downFilterthedownstreamfilter
destPinNamethedownstreamfilterpinname
useIntelligentConnectindicateifthemethodshoulduseDirectShow'sIntelligentConnect
RemarksIfuseIntelligentConnectistrue,thismethodcanaddmissingfiltersbetweenthetwopins.IfuseIntelligentConnectisfalse,thismethodworksonlyifthetwomediatypesarecompatible.
FilterGraphTools.ConnectFiltersMethod(IGraphBuilder,IBaseFilter,String,IBaseFilter,String,Boolean)
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilder,upFilterordownFilterarenull
ArgumentException Thrownifpinnamesarenotfoundinfilters
COMException Thrownifpinscan'tconnect
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|FilterGraphTools.ConnectFiltersOverloadList
Connectpinsfromtwofilters
publicstaticvoidConnectFilters(
IGraphBuildergraphBuilder,
IPinsourcePin,
IPindestPin,
booluseIntelligentConnect
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
sourcePinthesource(upstream/output)pin
destPinthedestination(downstream/input)pin
useIntelligentConnectindicatesifthemethodshoulduseDirectShow'sIntelligentConnect
RemarksIfuseIntelligentConnectistrue,thismethodcanaddmissingfiltersbetweenthetwopins.IfuseIntelligentConnectisfalse,thismethodworksonlyifthetwomediatypesarecompatible.
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilder,sourcePinordestPinarenull
COMException Thrownifpinscan'tconnect
FilterGraphTools.ConnectFiltersMethod(IGraphBuilder,IPin,IPin,Boolean)
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|FilterGraphTools.ConnectFiltersOverloadList
DisconnectpinsofallthefiltersinaDirectShowGraph
publicstaticvoidDisconnectAllPins(
IGraphBuildergraphBuilder
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
RemarksThismethoddoesn'tthrowanexceptionifanerroroccursduringpindisconnections
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderisnull
COMException Thrownifthemethodcan'tenumerateitsfilters
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace
FilterGraphTools.DisconnectAllPinsMethod
Disconnectallpinsonagivenfilter
publicstaticvoidDisconnectPins(
IBaseFilterfilter
);
Parametersfilter
thefilteronwhichtodisconnectallthepins
RemarksBothinputandoutputpinsaredisconnected
Exceptions
ExceptionType Condition
ArgumentNullException Throwniffilterisnull
COMException Throwniferrorsoccuredduringthedisconnectionprocess
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace
FilterGraphTools.DisconnectPinsMethod
FindafilterinaDirectShowGraphusingitsCLSID
publicstaticIBaseFilterFindFilterByClsid(
IGraphBuildergraphBuilder,
GuidfilterClsid
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
filterClsidtheCLSIDtofind
ReturnValueaninstanceofthefilteriffound,nullifnot
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderisnull
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|FindFilterByName
FilterGraphTools.FindFilterByClsidMethod
FindafilterinaDirectShowGraphusingitsname
publicstaticIBaseFilterFindFilterByName(
IGraphBuildergraphBuilder,
stringfilterName
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
filterNamethefilternametofind(case-sensitive)
ReturnValueaninstanceofthefilteriffound,nullifnot
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderisnull
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|FindFilterByClsid
FilterGraphTools.FindFilterByNameMethod
CheckifaDirectShowfiltercandisplayPropertyPages
publicstaticboolHasPropertyPages(
IBaseFilterfilter
);
Parametersfilter
ADirectShowFilter
ReturnValuetrueifthefilterhasPropertyPages,falseifnot
RemarksThismethodisintendedtobeusedwithShowFilterPropertyPage
Exceptions
ExceptionType Condition
ArgumentNullException Throwniffilterisnull
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|ShowFilterPropertyPage
FilterGraphTools.HasPropertyPagesMethod
CheckifaCOMObjectisavailable
publicstaticboolIsThisComObjectInstalled(
Guidclsid
);
Parametersclsid
TheCLSIDofthisobject
ReturnValuetrueiftheobjectisavailable,falseifnot
ExampleThissampleshowshowtocheckiftheMPEG-2Demultiplexerfilterisavailable
if(FilterGraphTools.IsThisComObjectInstalled(typeof(MPEG2Demultiplexer).GUID))
{
//Useit...
}
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace
FilterGraphTools.IsThisComObjectInstalledMethod
CheckiftheVideoMixingRenderer7Filterisavailable
publicstaticboolIsVMR7Present();
ReturnValuetrueifVMR7ispresent,falseifnot
RemarksThismethodusesIsThisComObjectInstalledinternally
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|IsThisComObjectInstalled
FilterGraphTools.IsVMR7PresentMethod
CheckiftheVideoMixingRenderer9Filterisavailable
publicstaticboolIsVMR9Present();
ReturnValuetrueifVMR9ispresent,falseifnot
RemarksThismethodusesIsThisComObjectInstalledinternally
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|IsThisComObjectInstalled
FilterGraphTools.IsVMR9PresentMethod
LoadaDirectShowGraphfromafile
publicstaticvoidLoadGraphFile(
IGraphBuildergraphBuilder,
stringfileName
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
fileNamethefiletobeloaded
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderisnull
ArgumentException Thrownifthegivenfileisnotavalidgraphfile
COMException Throwniferrorsoccurduringloading
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|SaveGraphFile
FilterGraphTools.LoadGraphFileMethod
RemoveandreleaseallfiltersfromaDirectShowGraph
publicstaticvoidRemoveAllFilters(
IGraphBuildergraphBuilder
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderisnull
COMException Thrownifthemethodcan'tenumerateitsfilters
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace
FilterGraphTools.RemoveAllFiltersMethod
Renderafilter'spininaDirectShowGraph
publicstaticboolRenderPin(
IGraphBuildergraphBuilder,
IBaseFiltersource,
stringpinName
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
sourcethefiltercontainingthepintorender
pinNamethepinname
ReturnValuetrueifrenderingisasuccess,falseifnot
RemarksThismethodassumesthatthefilterispartofthegivengraph
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderorsourceisnull
Example
hr=graphBuilder.AddSourceFilter(@"foo.avi","SourceFilter",outfilter);
DsError.ThrowExceptionForHR(hr);
if(!FilterGraphTools.RenderPin(graphBuilder,filter,"Output"))
FilterGraphTools.RenderPinMethod
SaveaDirectShowGraphtoaGRFfile
publicstaticvoidSaveGraphFile(
IGraphBuildergraphBuilder,
stringfileName
);
ParametersgraphBuilder
theIGraphBuilderinterfaceofthegraph
fileNamethefiletobesaved
RemarksThismethodoverwritesanyexistingfile
Exceptions
ExceptionType Condition
ArgumentNullException ThrownifgraphBuilderisnull
COMException Throwniferrorsoccurduringthefilecreation
SeeAlsoFilterGraphToolsClass|DirectShowLib.UtilsNamespace|LoadGraphFile
FilterGraphTools.SaveGraphFileMethod
DisplayPropertyPagesofagivenDirectShowfilter
publicstaticvoidShowFilterPropertyPage(
IBaseFilterfilter,
IntPtrparent
);
Parametersfilter
ADirectShowFilter
parentAhwndhandleofawindowtocontainthepages
RemarksYoucancheckifafiltersupportsPropertyPageswiththeHasPropertyPagesmethod.Warning:Thismethodisblocking.ItonlyreturnswhenthePropertyPagesareclosed.
Exceptions
ExceptionType Condition
ArgumentNullException Throwniffilterisnull
ExampleThissampleshowshowtocheckifafiltersupportsPropertyPagesanddisplaysthem
if(FilterGraphTools.HasPropertyPages(myFilter))
{
FilterGraphTools.ShowFilterPropertyPage(myFilter,myForm.Handle);
}
SeeAlso
FilterGraphTools.ShowFilterPropertyPageMethod
System.Object
DirectShowLib.Utils.FilterGraphTools
SeeAlsoDirectShowLib.UtilsNamespace
DirectShowLib.UtilsHierarchy
Top Related