I've done something similar to what you're interested in, I've got a
varying custom filtergraph and I wanted to assemble the graph for a
capture source myself.
To do this I used some of the
code from a tutorial by R. Laganiere that explains how to use open CV
with directshow. He puts together custom filter graphs in the
tutorial and has a number of helper functions to find pins etc.
It's quite good if you want to learn how to construct a graph.
From here I dug into the DShow doc and learnt how to add all the
upstreams for a given input source.
The code I'm working with (it's been a while since I put it together)
finds the corresponding Medium (KSMedium interface) for the input
filter. It uses it to assemble a list of upstream filters
using an IFilterMapper2 and the enumMatchingFilters
function. Each physical capture device has a unique ID that is
shared with all soft devices directshow sees related to the
hardware. It then gets friendly names from each moniker and adds
the filters to the graph. From here the pins are connected and
the interfaces to the crossbar and tuner can be accessed.
---------------------------------------------------------------------------- Mike Wasson, DirectShow SDK Documentation This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
(c) 2005 Microsoft Corporation. All rights reserved.
HI, My question is: how can i add the IAMCrossbar filter into the filter graph, if i don't want to use ICaptureGraphBuilder2. for example: we use CoCreateInstance() method, we can find the overlay mixer filter and add it into the filter graph. but for IAMCrossbar filter, what shall i do
ICaptureGraphBuilder2 is the recommended way to add a crossbar. Even if you build the rest of the graph manually, you can call ICaptureGraphBuilder::FindInterface to insert the crossbar filter (if needed) and get the IAMCrossbarFilter pointer.
By the way, crossbar filters are only required for some hardware. If the hardware doesn't require a crossbar filter, there is no need to insert one.
There is no sample code in the SDK for adding crossbar filters without using ICaptureGraphBuilder2, but here is some information:
But I strongly recommend using ICaptureGraphBuilder2!
---------------------------------------------------------------------------- Mike Wasson, DirectShow SDK Documentation This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
(c) 2006 Microsoft Corporation. All rights reserved.
I've done something similar to what you're interested in, I require a
variable custom filtergraph and I needed to assemble the graph for a
capture source myself.
To do this I used some of the
code from a tutorial by R. Laganiere that explains how to use open CV
with directshow. He puts together custom filter graphs in the
tutorial and has a number of helper functions to find pins etc.
It's quite good if you want to learn how to construct a graph yourself.
From here I dug into the DShow doc and learnt how to add all the
upstreams for a given input source.
The code I'm working with (it's been a while since I put it together so I apologise for how light this explaination is)
finds the corresponding Medium (KSMedium interface) for the input
filter. It uses it to assemble a list of upstream filters
using an IFilterMapper2 and the enumMatchingFilters
function. It then gets friendly names from each moniker and adds
the filters to the graph. From here the pins are connected and
the interfaces to the crossbar and tuner can be accessed. Note that each physical capture device has a unique ID that is
shared with all soft devices directshow sees related to the
hardware so if you're running with several of the same input devices you can be assured that you're getting the correct device.
How to use the IAMCrossbar interface
erivas
advind
To do this I used some of the code from a tutorial by R. Laganiere that explains how to use open CV with directshow. He puts together custom filter graphs in the tutorial and has a number of helper functions to find pins etc. It's quite good if you want to learn how to construct a graph. From here I dug into the DShow doc and learnt how to add all the upstreams for a given input source.
tutorial here
http://www.site.uottawa.ca/~laganier/tutorial/opencv+directshow/cvision.htm
The code I'm working with (it's been a while since I put it together) finds the corresponding Medium (KSMedium interface) for the input filter. It uses it to assemble a list of upstream filters using an IFilterMapper2 and the enumMatchingFilters function. Each physical capture device has a unique ID that is shared with all soft devices directshow sees related to the hardware. It then gets friendly names from each moniker and adds the filters to the graph. From here the pins are connected and the interfaces to the crossbar and tuner can be accessed.
owangecounty
----------------------------------------------------------------------------
Mike Wasson, DirectShow SDK Documentation
This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
(c) 2005 Microsoft Corporation. All rights reserved.
CSharpner
how can i add the IAMCrossbar filter into the filter graph, if i don't want to use ICaptureGraphBuilder2. for example:
we use CoCreateInstance() method, we can find the overlay mixer filter and add it into the filter graph. but for IAMCrossbar filter, what shall i do
SeveQ
ICaptureGraphBuilder2 is the recommended way to add a crossbar. Even if you build the rest of the graph manually, you can call ICaptureGraphBuilder::FindInterface to insert the crossbar filter (if needed) and get the IAMCrossbarFilter pointer.
By the way, crossbar filters are only required for some hardware. If the hardware doesn't require a crossbar filter, there is no need to insert one.
There is no sample code in the SDK for adding crossbar filters without using ICaptureGraphBuilder2, but here is some information:
http://msdn.microsoft.com/library/en-us/directshow/htm/wdmstreamclassdriverfilters.asp
But I strongly recommend using ICaptureGraphBuilder2!
----------------------------------------------------------------------------
Mike Wasson, DirectShow SDK Documentation
This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
(c) 2006 Microsoft Corporation. All rights reserved.
PavanE
up.
hi guys, please help me.
any suggestion shall be appreciated
JPulham
To do this I used some of the code from a tutorial by R. Laganiere that explains how to use open CV with directshow. He puts together custom filter graphs in the tutorial and has a number of helper functions to find pins etc. It's quite good if you want to learn how to construct a graph yourself. From here I dug into the DShow doc and learnt how to add all the upstreams for a given input source.
tutorial here
http://www.site.uottawa.ca/~laganier/tutorial/opencv+directshow/cvision.htm
The code I'm working with (it's been a while since I put it together so I apologise for how light this explaination is) finds the corresponding Medium (KSMedium interface) for the input filter. It uses it to assemble a list of upstream filters using an IFilterMapper2 and the enumMatchingFilters function. It then gets friendly names from each moniker and adds the filters to the graph. From here the pins are connected and the interfaces to the crossbar and tuner can be accessed. Note that each physical capture device has a unique ID that is shared with all soft devices directshow sees related to the hardware so if you're running with several of the same input devices you can be assured that you're getting the correct device.