DirectShow Filter Graph RRS feed

  • Question

  • Hello fellas,
       Thanks for stopping by.I have two questions.

    First One:

     I have the following filter graph.

    Video Crossbar --> TV Tunner Card --> DV Encoder --> DV Decoder --> Sample Grabber --> Video Renderer.

    This filter graph is not running when i run the application with debugger support. I am using Visual studio 05. This one runs fine and do all i need, when i run without debugger support. Why i am getting this behaviour. When i put the Following code.

    OAFilterState pfs;
            hr = pControl->GetState(INFINITE,&pfs); // pControl is IMediaControl
            hr = pControl->Run();
            hr = pControl->GetState(INFINITE,&pfs);
                AfxMessageBox(L"Failed at Run");

    i am getting S_FALSE, when i call IMediaControl::Run. When i call IMediaControl::GetState subsequently. I get pfs value  2. Which i think, it means running. The Active movie Window is displayed. But its not painting the frames. so i am sure whether my filter graph is running. Why is this running without debugger support but not so when with debugger support?

    Second Question:

    I have an Class called Camera. This Class wraps around all the Direct show funcitons for Creating Filter Graph. This Object Holds my filter graph. This Class got methods to create, run, pause and stop the filter graph. So, if i declare an object of this class as a member of MFC Dialog Class. It throws up an exception during Building the Following Graph.

    Video Crossbar --> TV Tunner Card --> smart tee -->  DV Encoder --> DV MUX --> AVI mux --> File Writer
                                                         Video Renderer

    The Exception occurs, when i am Connecting the Smart tee to Video render. But  it is created in the Code, where i connect the DV mux with AVI Mux. Thats where the debugger stops. When i step through using F11. I move freely till i step through to smart tee and video render connection. The DV Mux is already connected to AVI Mux. I connect smart tee to Video rendere as a last step in my filter graph buiding process. Then suddenly exception is thrown at the code, where i connect the DV MUX to AVI mux. This code has been already executed without any problem when stepping using F11. I checked all the Variable have valid values.

    This exception does not occur when i declare the class Camera as a global object. The exception occurs only when the Class Camera is a member of Dialog class, irrespective to the Access right ( Private or public or protected). What makes it to behave like this.

    I am not a computer engineer i am an electronics engineer. My application is working. But i am curious about the behaviours and I would be great if any of you explain these questions.

    I thank you for reading this question.


    Tuesday, January 22, 2008 5:16 AM