Search code examples
c++windows-10visual-studio-2019directshowdevice-driver

How to build and run Vivek's Virtual Camera on Windows 10?


https://github.com/roman380/tmhare.mvps.org-vcam

I gave look on Vivek's Virtual Camera. I could not understand how to compile and run this project.
In the project I am seeing two directories

alok@LAPTOP-DG8ME7Q5:/mnt/c/Users/alokm/tmp/vcam/vcam$ tree .
.
├── Bin
│   ├── VCam.ax
│   └── VCamD.ax
└── Filters
    ├── Dll.cpp
    ├── Filters.cpp
    ├── Filters.def
    ├── Filters.dsp
    └── Filters.h

2 directories, 7 files

By seeing dll and .def file in source code I guess I need compile this project as .dll and register it using regsvr32.exe.
How can I build and run this project to test Virtual camera?


Solution

  • Filters folder contains source code for the project. .DSP is the project file for old Visual Studio (or was it Visual C++ 6.0 yet?). If current Visual Studio cannot convert the project file you should still be able to create a new DLL project file and add the source code files.

    You need DirectShow BaseClasses to build the code. BaseClasses are no longer a part of Windows 10 SDK, so you have to have Windows 10 SDK and you additionally need this:

    Note that BaseClasses there are fresher than VCam sample itself and Visual Studio solution file is already .SLN and is known to be buildable and acceptable (via conversion) for current Visual Studio.

    Also you can find other filter projects in neighboring folders.

    Bin folder contains pre-built Win32 binaries of the project. Don't be confused with .AX extension - the files are regular .DLL files and you can use them directly against regsvr32. If you build the code into .DLL files you will have the same effect as with .AX.

    To see the project in action you need a 32-bit application that works with cameras via DirectShow, for example:

    You should see a new camera option once you regsvr32 the built project (from privilege elevated command prompt!)

    To have the project working with 64-bit applications, you need to build the project first, then regsvr32 it. Virtual Driver Cam not recognized by browser question clarifies why 32 and 64 builds work separately and target different applications.