How to use the IAMCrossbar interface

Hi everybody:
can you provide me a sample to describe the use of IAMCrossbar interface.
thanks a lot


Answer this question

How to use the IAMCrossbar interface

  • erivas

    There is a sample in the Platform SDK documentation, which you will need to build any DirectShow application.

  • advind

    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.

    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

    The AmCap sample has code for working with crossbars (and a helper class). Also, see http://msdn.microsoft.com/library/en-us/directshow/htm/workingwithcrossbars.asp

    ----------------------------------------------------------------------------
    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

    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

  • 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

    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.

    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 e
    ach 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