lostmsu
New Member
I am trying to make a tool to quickly setup gameplay streaming over WebRTC, and hit an issue where DXGI output duplication stops when PC is locked, so I searched for alternatives.
My first move was to hook DXGI calls with 2 shared DXGI surfaces guarded by 2 mutexes where Present hook would draw into one of them while my tool would read and process the other one, and then they'd swap.
Now that worked marvelously, until I realized OpenGL games on Windows generally don't use DXGI. Then I found on Reddit, that OBS works to capture games off-screen/locked, so I took a look at win-capture, and it seems that it works basically the same way, but supports more APIs. So I'd love to reuse it, and probably contribute back too. The problem is - there's no internal documentation for it. E.g. it is hard to grasp the protocol of setting up mutexes, shared memory and textures by looking at the source code. Can somebody familiar describe how the communication between the parent process and the hooked game goes?
My first move was to hook DXGI calls with 2 shared DXGI surfaces guarded by 2 mutexes where Present hook would draw into one of them while my tool would read and process the other one, and then they'd swap.
Now that worked marvelously, until I realized OpenGL games on Windows generally don't use DXGI. Then I found on Reddit, that OBS works to capture games off-screen/locked, so I took a look at win-capture, and it seems that it works basically the same way, but supports more APIs. So I'd love to reuse it, and probably contribute back too. The problem is - there's no internal documentation for it. E.g. it is hard to grasp the protocol of setting up mutexes, shared memory and textures by looking at the source code. Can somebody familiar describe how the communication between the parent process and the hooked game goes?