sskodje / ScreenRecorderLib

A .NET library for screen recording in Windows, using native Microsoft Media Foundation for realtime encoding to h264 video or PNG images.
MIT License
411 stars 93 forks source link

C# implementation & Cursor click render with WindowsGraphicCapture #110

Closed veler closed 3 years ago

veler commented 3 years ago

Hello,

Congrats for this awesome library! I have 2 naive questions.

  1. I see that the mouse click render is only supported in the implementation details related to Desktop Duplication API. Is it impossible to support it with WindowsGraphicCapture API? It looks like (again, naive question...) it's using similar APIs to treat the frames, what's blocking here?

  2. What is the original reason for making the library in C++ instead of C#? Anything preventing to do it in C#? Any concern regarding the performances if the Native library was Managed?

Thanks :-)

sskodje commented 3 years ago

1: You see, it's quite technical, the reason is that.. i had forgotten all about it. I'll add it to the bucketlist, unless you want to do a PR?

2: I have no idea, i've never made a c# implementation. I know you can use wrappers like SharpDX and NAudio, which would probably work fine. Personally i just wanted to write it in c++. Windows APIs are also natively c++, so there is more documentation for it in that language.

veler commented 3 years ago

Sounds good, thank you very much :) I was just curious.

If it's not too complicated to support the mouse click render with WindowsGraphicCapture, that would be very nice to have! Perhaps some refactoring would help at merging the code to avoid duplicating the implementation.

sskodje commented 3 years ago

Fixed with 8094572c012c0ed5bf68d36a09a62aa11f603ce3