I am trying to build Desktop application using Electron framework which can output content of particular <div>
element to DirectShow based virtual camera.
With the help of famous Viveks virtual camera and Sample Push Source Filter I am able to create virtual camera which is rendering Desktop in virtual camera.
Now I want to use this virtual camera with electron app to output content of <div>
. I am not able to figure out what should be approach to achieve this? I guess I have to develop DirectShow Capture Filter which will interact with virtual camera which I am not sure.
What should be approach to render <div>
content to virtual camera?
https://learn.microsoft.com/en-us/windows/win32/directshow/step-2--declare-cvideorenderer-and-derived-classes
It appears you'd need to get the window handle HWND for the Electron window and write to a RECT within that window, similar to how you'd do it with a DirectX swapchain. I'm not sure there's a way specifically to render to an element within the window, but you may be able to expose some variable that your C++ component could read to determine the viewport.