-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basic unity exsample #112
Comments
i see your not using dispose on the resources, this is likely whats causing the issues you are getting when trying to stop capturing. Dispose will block and wait until the capturing has completely stopped and all resources have been successfully cleaned up. |
I think the stop function isnt necessary,. Give disposing the resources a shot and see if that fixes it. |
dispose seems to work equally well. i have checked in that change already, however i did not remove the stop functions from c & c# codes. the problems with the images onFrameChanged appear to be a wrong width/height. width should be 2 - 3 times bigger. in most images. |
Maybe its time for me to start up the good ol' mac thats collecting dust.... Ill see checking the mac stuff this weekend and look over the branch that you made. Thanks for all the hard work. I saw that you were implementing your own c# library. |
Fired up the good'ol mac, updated everything and everything seemed to work fine for my setup which is a simple, single monitor setup. |
This was also not using unity. I dont use that either. I just did the simple demo of capturing monitors/windows |
Also, on the topic of unity plugin. I was going through merging your code into the repo and was reviewing the code. Since I dont use unity. The resource cleanup of Should OnDestory be used instead of OnApplicationQuit? I am asking this because I generally dont know. I did google this and it seems to indicate that OnDestroy should be used. Is this correct? |
It does make sense to move the destroy code to that function if i think about it. However i would recommend testing the editor play/stopping again with OnDestroy multiple times. As the editor sometimes has issues with the cleanup of plugins which dont seem completely logical to me.
… Am 06.09.2021 um 23:51 schrieb Scott ***@***.***>:
Also, on the topic of unity plugin. I was going through merging your code into the repo and was reviewing the code.
Since I dont use unity. The resource cleanup of
OnApplicationQuit
vs OnDestroy
Should OnDestory be used instead of OnApplicationQuit?
I am asking this because I generally dont know. I did google this and it seems to indicate that OnDestroy should be used. Is this correct?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
I just wanted to remind you that the samples in the repository https://github.com/ludos1978/screen_capture_lite should be working. if you wanna import them. you could leave out the ExtendedSample in Scripts and Sample as well as the built lib in Plugins and all the meta files with the same name as the files. but othervise it's about as small it gets. |
Yeah sorry ive been busy. |
Hi, i've added a basic unity example in the fork https://github.com/ludos1978/screen_capture_lite . Also there is a extendedSample in scenes and in Scripts that are wip and not needed in the basic sample.
the dll or dylib needs to be added to the Example_Unity/UnityProject/Assets/Plugins folder so it works.
onMouseChanged and onNewFrame work as far as i can tell. But the onFrameChanged generates broken images. I assume thats an internal problem, also it has happened that i received a wrong size of buffer for the image size.
To cleanup i had to add a function. Unity closes the application fast and afaik only awaits the OnApplicationQuit function call. Garbage collection is not fast enougth i think. I do encounter problems when play/stopping the project in unity from time to time, but it's really hard to tell where these unity crashes come from. I assume it's because it may still execute the callback even if i set TerminateThreadsEvent true and Paused false in rare cases.
The text was updated successfully, but these errors were encountered: