nomi-san / parsec-vdd

✨ Perfect 4K@240Hz Virtual Display
MIT License
1.78k stars 89 forks source link

Can you provide a dll version #7

Closed telppa closed 4 months ago

telppa commented 6 months ago

This will allow more people to call it in their favorite language!

nomi-san commented 6 months ago

That's no meaning when you already have the C/C++ source code.

Btw, building a DLL is quite easy, and my header is fully compatible with C.

  1. Create a new main.c that includes the core header.
#include "parsec-vdd.h"
  1. List API functions in a exports.def.
EXPORTS
  OpenDeviceHandle
  VddAddDisplay
  VddRemoveDisplay
  # etc
  1. Build the DLL, e.g with MSVC CL.exe.
cl /LD /OUT:parsec-vdd.dll main.c /link /DEF:exports.def
WinkelCode commented 5 days ago

@nomi-san I have a slightly related question, do you happen to know if there is an interface for the Parsec driver to get access to the swapchain? (https://learn.microsoft.com/en-us/windows-hardware/drivers/display/iddcx-objects)

I've been playing around with the idea of writing a thing using the IDD functionality and directly grabbing the image off of there, rather than relying on other capture APIs.

nomi-san commented 5 days ago

@WinkelCode

Parsec VDD doesn't have any interface to obtain the swapchain from the outside. You should write your own IddCx driver, then access the dxgi swapchain to process the desktop image. But I think capturing desktop with native-gpu encoders are lower level than Idd, Parsec host also uses this method to capture the entire desktop.

graph LR
A[idd] --> B[dxgi] --> |post-process| C[output]
B .->|encode| D[streaming]

Z[gpu] <-..-> B

There are alot of sample projects that can be found in the README.