smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
616 stars 156 forks source link

Capturing Windows and Monitors at the same time #100

Closed Ozzadar closed 3 years ago

Ozzadar commented 3 years ago

Is this possible? If not I have 2 questions:

1) Was there a reason why not? Fundamental difference in how they're parsed? 2) I havent fully dug in yet; but how difficult would it be to allow IScreenCaptureManager to run more than once? If i could have 2 I'd be able to combine monitor and windows no problem

            //you must ONLY HAVE ONE INSTANCE RUNNING AT A TIME. Destroy the first instance then create one!
            assert(!ScreenCaptureManagerExists);
            ScreenCaptureManagerExists = true;
smasherprog commented 3 years ago

YUP u can capture both at the same time

smasherprog commented 3 years ago

Actually I take that back I dont think i Added support for that, but it should be easy to add https://github.com/smasherprog/screen_capture_lite/blob/master/src/ThreadManager.cpp Change the else if to another separate if

smasherprog commented 3 years ago

IF it works, issue a PR on it please

Ozzadar commented 3 years ago

The issue of capturing both windows and desktops at the same time seems alot deeper than just that if statement.

Also need to allow the passing in of both a vector<Monitor> and vector<Window> to the CaptureConfiguration; cascading into needing new sets of callbacks and the callback signatures being baked into Thread_Data_->ScreenCaptureData and Thread_Data_->ScreenCaptureData .

I'll take another look at it later and see if there's a different approach that I can take without refactoring a large chunk. If you have any more suggestions; feel free to let me know and I'll look

smasherprog commented 3 years ago

I supposed U could have 2 seperate screen captures as well one with windows and the other with monitors?

smasherprog commented 3 years ago

Windows and monitors are fundamentally different internally. So, you would have to create multiple capture objects. let mw know if this doesnt work.

smasherprog commented 3 years ago

I think the best approach is to create multiple capture objects. Going to close this for now unless something new needs to be added