Search code examples
c#directshowcapture

Crossbar filter change current input to Composite


I am new to DirectShow. I am writing an application in C# for capturing from Analog capture card. I have an analog capture card & I want to know how to change Analog Crossbar filter property, from "0: Analog Tuner In" to "1: Video Composite In". Here is my Filter Graph

FilterGraph

I can not connect Tuner's "Analog Video pin" to "Video Composite In" of Crossbar filter. I tried running "Route" method of IAMCrossbar filter, which failed. I don't know whether my path is correct. Please guide...


Solution

  • IAMCrossbar::Route is how you do it. Make sure to read Working with Crossbars for details - it is C++ API, however I suppose you are using DirectShow.NET and it has similar methods.

    Solution code snippet pulled from comment below:

    IAMCrossbar Xbar = (IAMCrossbar)pNM8001AnalogXbar; 
    //hr = Xbar.CanRoute(1, 0); 
    hr = Xbar.Route(1, 0); 
    checkHR(hr, "Some NM8001AnalogXbar Problem"); //CONNECT NM8001 Analog TUNER and NM8001 Analog XBAR 
    hr = pGraph.ConnectDirect(
      GetPin(pNM8001AnalogTuner, "Analog Video"), 
      GetPin(pNM8001AnalogXbar, "0: Video Tuner In"), 
      null); 
    checkHR(hr, "Can't Connect NM8001AnalogTuner and NM8001AnalogXbar");