c++debuggingcomdirectshowvirtual-webcam

How to debug DirectShow push source filter?


I tried one of sample DirectShow based virtual camera available at https://github.com/roman380/tmhare.mvps.org-vcam
I am able to compile and build and its working fine in browsers(Chrome and Edge).

But in case of Desktop app like Zoom and Team virtual camera is getting recognized but not showing any frames. On selecting this virtual camera only black screen is visible not the expected output.

enter image description here

I tried to debug after reading Debugging DirectShow Filters and How to debug c++ DirectShow filter I added DbgLog() in constructor of output pin class like

DbgLog((LOG_TRACE, 3, TEXT("test string")));

And set file path in LogToFile field of Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\Debug\Filters.dll

enter image description here

But I am not seeing any log string in vcam-log.txt. What I am missing or how to get log string in that file?


Solution

  • Debugging PushSource/VCam based filter is Zoom is to happen along the same lines as debugging of a DLL project running in context of external application. Namely the procedure is this:

    1. Stop target application (Zoom)
    2. Build your project, register the DLL as/if needed with COM (regsvr32)
    3. Have the target application started
    4. Attach your Visual Studio to the running application (Ctrl+Alt+P, Native code debugger, Zoom process)
    5. Put breakpoints in your project, enable break on exceptions
    6. Have the target appliction running and interactively start activity related to video capture

    Steps 3-4 can be replaced by setting project settings to start Zoom as debug target (Project settings, Debugging, Command).

    Also, you might want to put a breakpoint on this line and see where exactly debug output is routed to. You might be able to see it in integrated Debug Output window (in the case of OutputDebugString use) or you would be able to check what exactly file is being used for writing log to.